summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/polyglossia/gloss-catalan.ldf
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/polyglossia/gloss-catalan.ldf')
-rw-r--r--Master/texmf-dist/tex/xelatex/polyglossia/gloss-catalan.ldf94
1 files changed, 92 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-catalan.ldf b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-catalan.ldf
index e89999a2846..acc0c27e759 100644
--- a/Master/texmf-dist/tex/xelatex/polyglossia/gloss-catalan.ldf
+++ b/Master/texmf-dist/tex/xelatex/polyglossia/gloss-catalan.ldf
@@ -1,12 +1,88 @@
\ProvidesFile{gloss-catalan.ldf}[polyglossia: module for catalan]
\makeatletter
-\def\catalan@font{\normalfontlatin}
+\def\catalan@font{\selectfontfamilylatin}
\ifx\l@catalan\@undefined%
\xpg@nopatterns{Catalan}%
\adddialect\l@catalan\l@nohyphenation%
\fi
+\define@boolkey{catalan}[catalan@]{babelshorthands}[true]{}
+\ifsystem@babelshorthands
+ \setkeys{catalan}{babelshorthands=true}
+\else
+ \setkeys{catalan}{babelshorthands=false}
+\fi
+\ifcsundef{initiate@active@char}{%
+\input{babelsh.def}%
+\initiate@active@char{"}%
+}{}
+
+%%% adapted from Babel's catalan.ldf
+\newdimen\leftllkern \newdimen\rightllkern \newdimen\raiselldim
+% we check if char · exists, and use it instead of raised dot:
+\def\xpg@raiseddot{\ifnum\XeTeXcharglyph"00B7 > 0\hbox{\char"00B7}%
+ \else\raise\raiselldim\hbox{.}\fi}
+\def\lgem{%
+ \ifmmode
+ \csname normal@char\string"\endcsname l%
+ \else
+ \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
+ \setbox0\hbox{l}\setbox1\hbox{l\/}%
+ \ifnum\XeTeXcharglyph"00B7 > 0\setbox2\hbox{\char"00B7}\else\setbox2\hbox{.}\fi
+ \advance\raiselldim by \the\fontdimen5\the\font
+ \advance\raiselldim by -\ht2%
+ \leftllkern=-.25\wd0%
+ \advance\leftllkern by \wd1%
+ \advance\leftllkern by -\wd0%
+ \rightllkern=-.25\wd0%
+ \advance\rightllkern by -\wd1%
+ \advance\rightllkern by \wd0%
+ \allowhyphens\discretionary{l-}{l}%
+ {\hbox{l}\kern\leftllkern\xpg@raiseddot%
+ \kern\rightllkern\hbox{l}}\allowhyphens
+ \fi
+}
+\def\Lgem{%
+ \ifmmode
+ \csname normal@char\string"\endcsname L%
+ \else
+ \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
+ \setbox0\hbox{L}\setbox1\hbox{L\/}%
+ \ifnum\XeTeXcharglyph"00B7 > 0\setbox2\hbox{\char"00B7}\else\setbox2\hbox{.}\fi
+ \advance\raiselldim by .5\ht0%
+ \advance\raiselldim by -.5\ht2%
+ \leftllkern=-.125\wd0%
+ \advance\leftllkern by \wd1%
+ \advance\leftllkern by -\wd0%
+ \rightllkern=-\wd0%
+ \divide\rightllkern by 6%
+ \advance\rightllkern by -\wd1%
+ \advance\rightllkern by \wd0%
+ \allowhyphens\discretionary{L-}{L}%
+ {\hbox{L}\kern\leftllkern\xpg@raiseddot%
+ \kern\rightllkern\hbox{L}}\allowhyphens
+ \fi
+}
+\AtBeginDocument{%
+ \let\lslash\l
+ \let\Lslash\L
+ \DeclareRobustCommand\l{\@ifnextchar.\bbl@l{\@ifnextchar·\bbl@l\lslash}}
+ \DeclareRobustCommand\L{\@ifnextchar.\bbl@L{\@ifnextchar·\bbl@L\Lslash}}}
+\def\bbl@l#1#2{\lgem}
+\def\bbl@L#1#2{\Lgem}
+
+\def\catalan@shorthands{%
+ \bbl@activate{"}%
+ \def\language@group{catalan}%
+ \declare@shorthand{catalan}{"l}{\lgem{}}
+ \declare@shorthand{catalan}{"L}{\Lgem{}}
+}
+
+\def\nocatalan@shorthands{%
+ \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}%
+}
+
\def\captionscatalan{%
\def\refname{Referències}%
\def\abstractname{Resum}%
@@ -31,7 +107,7 @@
\def\proofname{Demostració}%
\def\glossaryname{Glossari}%
}
-\datecatalan{%
+\def\datecatalan{%
\def\today{\number\day~\ifcase\month\or
de gener\or de febrer\or de març\or d'abril\or de maig\or
de juny\or de juliol\or d'agost\or de setembre\or d'octubre\or
@@ -42,4 +118,18 @@
\setlocalhyphenmins{catalan}{2}{2}
+\def\noextras@catalan{%
+ \nonfrenchspacing%
+ \nocatalan@shorthands%
+}
+
+\def\blockextras@catalan{%
+ \frenchspacing%
+ \ifcatalan@babelshorthands\catalan@shorthands\fi%
+}
+
+\def\inlineextras@catalan{%
+ \frenchspacing%
+ \ifcatalan@babelshorthands\catalan@shorthands\fi%
+}
\endinput