summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf')
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf66
1 files changed, 54 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf
index 16d75c4192c..106e8a2be1e 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v1.66 -- 2023/12/11)
+% Language definition file (part of polyglossia v2.0 -- 2024/02/17)
%
\ProvidesFile{gloss-finnish.ldf}[polyglossia: module for Finnish]
\PolyglossiaSetup{finnish}{
@@ -18,10 +18,37 @@
\define@boolkey{finnish}[finnish@]{babelshorthands}[true]{}
-\define@boolkey{finnish}[finnish@]{schoolhyphens}[true]{}
+\newif\if@finnish@schoolhyphens
+\newif\if@finnish@babelhyphens
+\define@choicekey*+{finnish}{hyphens}[\xpg@val\xpg@nr]{default,school,babel}[default]{%
+ \ifcase\xpg@nr\relax
+ % default:
+ \@finnish@schoolhyphensfalse
+ \@finnish@babelhyphensfalse
+ \or
+ % school:
+ \@finnish@schoolhyphenstrue
+ \@finnish@babelhyphensfalse
+ \or
+ % babel:
+ \@finnish@schoolhyphensfalse
+ \@finnish@babelhyphenstrue
+ \fi
+ \xpg@info{Option: Finnish, hyphens=\xpg@val}%
+}{\xpg@warning{Unknown Finnish hyphens `#1'}}
+
+% backwards compatibility
+\define@boolkey{finnish}[finnish@]{schoolhyphens}[true]{%
+ \iffinnish@schoolhyphens
+ \@finnish@schoolhyphenstrue
+ \@finnish@babelhyphensfalse
+ \else
+ \@finnish@schoolhyphensfalse
+ \fi
+}
% Register default options
-\xpg@initialize@gloss@options{finnish}{babelshorthands=false,schoolhyphens=false}
+\xpg@initialize@gloss@options{finnish}{babelshorthands=false,hyphens=default}
\ifsystem@babelshorthands
\setkeys{finnish}{babelshorthands=true}
@@ -42,7 +69,7 @@
\declare@shorthand{finnish}{"|}{\textormath{\penalty\@M\discretionary{-}{}{\kern.03em}}{}}%
\declare@shorthand{finnish}{""}{\hskip\z@skip}%
\declare@shorthand{finnish}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
- \declare@shorthand{finnish}{"=}{\penalty\@M-\hskip\z@skip}%
+ \declare@shorthand{finnish}{"=}{\hbox{-}\bbl@allowhyphens}%
\declare@shorthand{finnish}{"/}{\textormath
{\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}%
}
@@ -77,7 +104,7 @@
}
\def\finnish@language{%
- \iffinnish@schoolhyphens
+ \if@finnish@schoolhyphens
\xpg@ifdefined{schoolfinnish}{%
\polyglossia@setup@language@patterns{schoolfinnish}%
}{%
@@ -90,6 +117,28 @@
\fi
}
+% activate babel-style hyphen settings if requested
+\AtBeginDocument{%
+ \if@finnish@babelhyphens
+ \let\xpg@save@hyphenpenalty\hyphenpenalty%
+ \let\xpg@save@exhyphenpenalty\exhyphenpenalty%
+ \let\xpg@save@doublehyphendemerits\doublehyphendemerits%
+ \let\xpg@save@finalhyphendemerits\finalhyphendemerits%
+ \addto\blockextras@finnish{%
+ \hyphenpenalty=30%
+ \exhyphenpenalty=30%
+ \doublehyphendemerits=5000%
+ \finalhyphendemerits=5000%
+ }%
+ \addto\noextras@finnish{%
+ \let\hyphenpenalty\xpg@save@hyphenpenalty%
+ \let\exhyphenpenalty\xpg@save@exhyphenpenalty%
+ \let\doublehyphendemerits\xpg@save@doublehyphendemerits%
+ \let\finalhyphendemerits\xpg@save@finalhyphendemerits%
+ }%
+ \fi
+}
+
\def\datefinnish{%
\def\today{\number\day.~\ifcase\month\or
tammikuuta\or helmikuuta\or maaliskuuta\or huhtikuuta\or
@@ -111,10 +160,3 @@
\endinput
-% TODO ? this is set in babel:
-\gappto\blockextrasfinnish{%
- \babel@savevariable\hyphenpenalty\hyphenpenalty=30%
- \babel@savevariable\exhyphenpenalty\exhyphenpenalty=30%
- \babel@savevariable\doublehyphendemerits\doublehyphendemerits=5000%
- \babel@savevariable\finalhyphendemerits\finalhyphendemerits=5000%
-}