diff options
author | Karl Berry <karl@freefriends.org> | 2016-03-25 22:06:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-03-25 22:06:03 +0000 |
commit | f9e5222a931d1b2671fa84b5c93a4605c00c2373 (patch) | |
tree | 20ac69a38c367d4792d6e3aea532c5ba669fe10a /Master | |
parent | 0cf37a0dcbc1de449eda38e14e357dd7b19dc5dd (diff) |
polyglossia (25mar16)
git-svn-id: svn://tug.org/texlive/trunk@40138 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
21 files changed, 2114 insertions, 570 deletions
diff --git a/Master/texmf-dist/doc/latex/polyglossia/README b/Master/texmf-dist/doc/latex/polyglossia/README index 0a338af02b2..c1ab13419de 100644 --- a/Master/texmf-dist/doc/latex/polyglossia/README +++ b/Master/texmf-dist/doc/latex/polyglossia/README @@ -1,7 +1,7 @@ ¦----------------------------------------------¦ ¦ ¦ - ¦ THE POLYGLOSSIA PACKAGE v1.42.0 ¦ + ¦ THE POLYGLOSSIA PACKAGE v1.42.4 ¦ ¦ ¦ ¦ Modern multilingual typesetting ¦ ¦ with XeLaTeX and LuaLaTeX ¦ @@ -32,7 +32,7 @@ Polyglossia makes it possible to automate the following tasks: LICENSE -Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2015 Arthur Reutenauer +Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2016 Arthur Reutenauer Polyglossia is placed under the terms of the LaTeX Project Public Licence (LPPL), either version 1.3, or, at your option, any later version. See diff --git a/Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdf b/Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdf Binary files differindex d147f2c117c..70f06d2e188 100644 --- a/Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdf +++ b/Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdf diff --git a/Master/texmf-dist/doc/latex/polyglossia/example-korean.pdf b/Master/texmf-dist/doc/latex/polyglossia/example-korean.pdf Binary files differindex d37d453ca2a..2f582f59560 100644 --- a/Master/texmf-dist/doc/latex/polyglossia/example-korean.pdf +++ b/Master/texmf-dist/doc/latex/polyglossia/example-korean.pdf diff --git a/Master/texmf-dist/doc/latex/polyglossia/example-thai.pdf b/Master/texmf-dist/doc/latex/polyglossia/example-thai.pdf Binary files differindex 3d95d17c283..11ee9e78ed0 100644 --- a/Master/texmf-dist/doc/latex/polyglossia/example-thai.pdf +++ b/Master/texmf-dist/doc/latex/polyglossia/example-thai.pdf diff --git a/Master/texmf-dist/doc/latex/polyglossia/examples.pdf b/Master/texmf-dist/doc/latex/polyglossia/examples.pdf Binary files differindex 2fa4f69adb3..5a91d825b89 100644 --- a/Master/texmf-dist/doc/latex/polyglossia/examples.pdf +++ b/Master/texmf-dist/doc/latex/polyglossia/examples.pdf diff --git a/Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdf b/Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdf Binary files differindex d7168ae286b..ebfc98a3cad 100644 --- a/Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdf +++ b/Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdf diff --git a/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex b/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex index a2147cc31d3..804fadbd65a 100644 --- a/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex +++ b/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex @@ -347,8 +347,9 @@ The default value of each option is given in italic. \subsection{bengali}\label{bengali}\new{v1.2.0} \textbf{Options}: \begin{itemize} - \item \TB{numerals} = Western, Bengali or \textit{Devanagari} - \item \TB{changecounternumbering} = true or \textit{false} + \item \TB{numerals} = Western, Bengali or \textit{Devanagari} + \item \TB{changecounternumbering} = true or \textit{false} (use specified + numerals for headings and page numbers) \end{itemize} \subsection{catalan}\label{catalan} @@ -758,7 +759,7 @@ And of course my gratitude also goes to Jonathan Kew, the formidable author of \ \section{More acknowledgements (by Arthur Reutenauer)} Many thanks to all the people who have contributed bugfixes and new features to Polyglossia since I took over. Most of them can be identified from the version -control log on \href{https://github.com}{GitHub} and I won’t try to name them +control log on \href{https://github.com/reutenauer/polyglossia}{GitHub} and I won’t try to name them all (maybe, one day ...); among the ones who sent contributions directly to me I would like to especially thank Claudio Beccari, the indefatigable champion of Romance languages, and beyond! diff --git a/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx b/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx index 4137eee9bdf..2ef100d1e1f 100644 --- a/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx +++ b/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx @@ -11,7 +11,7 @@ ¦----------------------------------------------¦ ¦ ¦ - ¦ THE POLYGLOSSIA PACKAGE v1.42.0 ¦ + ¦ THE POLYGLOSSIA PACKAGE v1.42.4 ¦ ¦ ¦ ¦ Modern multilingual typesetting ¦ ¦ with XeLaTeX and LuaLaTeX ¦ @@ -42,7 +42,7 @@ Polyglossia makes it possible to automate the following tasks: LICENSE -Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2015 Arthur Reutenauer +Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2016 Arthur Reutenauer Polyglossia is placed under the terms of the LaTeX Project Public Licence (LPPL), either version 1.3, or, at your option, any later version. See @@ -74,7 +74,7 @@ http://github.com/reutenauer/polyglossia/issues The polyglossia package (C) 2008–2010 François Charette - (C) 2011-2015 Arthur Reutenauer + (C) 2011-2016 Arthur Reutenauer (C) 2013 Elie Roux License information appended @@ -82,7 +82,7 @@ http://github.com/reutenauer/polyglossia/issues \endpreamble \postamble - Copyright (C) 2015 by Arthur Reutenauer <arthur 'dot' reutenauer 'at' normalesup 'dot' org> + Copyright (C) 2016 by Arthur Reutenauer <arthur 'dot' reutenauer 'at' normalesup 'dot' org> This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 @@ -560,8 +560,9 @@ http://github.com/reutenauer/polyglossia/issues % \subsection{bengali}\label{bengali}\new{v1.2.0} % \textbf{Options}: % \begin{itemize} -% \item \TB{numerals} = Western, Bengali or \textit{Devanagari} -% \item \TB{changecounternumbering} = true or \textit{false} +% \item \TB{numerals} = Western, Bengali or \textit{Devanagari} +% \item \TB{changecounternumbering} = true or \textit{false} (use specified +% numerals for headings and page numbers) % \end{itemize} % % \subsection{catalan}\label{catalan} @@ -971,7 +972,7 @@ http://github.com/reutenauer/polyglossia/issues % \section{More acknowledgements (by Arthur Reutenauer)} % Many thanks to all the people who have contributed bugfixes and new features to % Polyglossia since I took over. Most of them can be identified from the version -% control log on \href{https://github.com}{GitHub} and I won’t try to name them +% control log on \href{https://github.com/reutenauer/polyglossia}{GitHub} and I won’t try to name them % all (maybe, one day ...); among the ones who sent contributions directly to me % I would like to especially thank Claudio Beccari, the indefatigable champion of % Romance languages, and beyond! @@ -1349,12 +1350,12 @@ and may look very wrong.} \def\captionsarabic{% \def\prefacename{\@ensure@RTL{مدخل}}% - \def\refname{\@ensure@RTL{المراجع}} + \def\refname{\@ensure@RTL{المراجع}}% \def\abstractname{\@ensure@RTL{ملخص}}% \def\bibname{\@ensure@RTL{المصادر}}% \def\chaptername{\@ensure@RTL{باب}}% \def\appendixname{\@ensure@RTL{الملاحق}}% - \def\contentsname{\@ensure@RTL{المحتويات}} + \def\contentsname{\@ensure@RTL{المحتويات}}% %\def\contentsname{\@ensure@RTL{الفهرس}}% \def\listfigurename{\@ensure@RTL{قائمة الأشكال}}% \def\listtablename{\@ensure@RTL{قائمة الجداول}}% @@ -2640,7 +2641,7 @@ and may look very wrong.} \define@key{english}{variant}{% %needs to be reset for loop over hyphennames below: \def\do##1{% - \ifcsdef{l@#1}% + \xpg@ifdefined{#1}% {\csletcs{l@english}{l@#1}\listbreak}% {}% }% @@ -2660,10 +2661,10 @@ and may look very wrong.} {\@british@hyphenfalse\english@ordinalmonthdayfalse \ifluatex\else\setkeys[xpg@setup]{english}{hyphennames={usenglishmax}}\fi \xpg@info{Option: english variant=american (with additional patterns)}% - \ifcsundef{l@usenglishmax}% + \xpg@ifdefined{usenglishmax}{}% {\xpg@warning{No hyphenation patterns were loaded for "US English Max"\MessageBreak I will use the standard patterns for US English instead}% - \adddialect\l@usenglishmax\l@english\relax}{}% + \adddialect\l@usenglishmax\l@english\relax}% \gdef\english@language{\language=\l@usenglishmax}}% {\ifstrequal{#1}{australian}% {\@british@hyphentrue\english@ordinalmonthdayfalse @@ -2676,10 +2677,10 @@ and may look very wrong.} \if@british@locale\@british@hyphentrue\english@ordinalmonthdaytrue\fi \if@british@hyphen \ifluatex\else\setkeys[xpg@setup]{english}{hyphennames={ukenglish,british,UKenglish}}\fi - \ifcsundef{l@ukenglish}% + \xpg@ifdefined{ukenglish}{}% {\xpg@warning{No hyphenation patterns were loaded for British English\MessageBreak I will use the patterns for US English instead}% - \adddialect\l@ukenglish\l@english\relax}{}% + \adddialect\l@ukenglish\l@english\relax}% \gdef\english@language{\language=\l@ukenglish\xpg@set@language@luatex@ii{ukenglish}}% \fi % and we reset \do to its previous definition here: @@ -3098,8 +3099,8 @@ and may look very wrong.} % \XeTeXinterchartoks \z@ \french@punctguillstart = {\nobreakspace}% "a«" unchanged? % \XeTeXinterchartoks \french@punctguillend \z@ = {\nobreakspace}% "»a" unchanged? \XeTeXinterchartoks \z@ \french@punctguillend = {\nobreakspace}% "a»" -> "a »" - \XeTeXinterchartoks \french@punctguillstart 255 = {\nobreakspace\xpg@nospace}% "« " -> "«~" - \XeTeXinterchartoks 255 \french@punctguillend = {\xpg@unskip\nobreakspace}% " »" -> "~»" + % \XeTeXinterchartoks \french@punctguillstart 255 = {\nobreakspace\xpg@nospace}% "« " -> "«~" + % \XeTeXinterchartoks 255 \french@punctguillend = {\xpg@unskip\nobreakspace}% " »" -> "~»" \XeTeXinterchartoks \french@punctguillend \french@punctthin = {\nobreak\thinspace}% "»;" -> "» ;" \XeTeXinterchartoks \french@punctguillend \french@punctthick = {\nobreakspace}% "»:" -> "» :" \XeTeXinterchartoks \french@punctthin \french@punctguillend = {\nobreakspace}% "?»" -> "? »" @@ -3185,6 +3186,28 @@ and may look very wrong.} \french@punctuation% } +\def\ier{\textsuperscript{er}} +\def\iers{\textsuperscript{ers}} +\def\iere{\textsuperscript{re}} +\def\ieres{\textsuperscript{res}} +\def\ieme{\textsuperscript{e}} +\def\iemes{\textsuperscript{es}} +\def\nd{\textsuperscript{nd}} +\def\nds{\textsuperscript{nds}} +\def\nde{\textsuperscript{nde}} +\def\ndes{\textsuperscript{ndes}} +\def\no{\textsuperscript{o}} +\def\nos{\textsuperscript{os}} + +\def\mme{M\textsuperscript{me}\space} +\def\mmes{M\textsuperscript{mes}\space} +\def\mr{M.\space} +\def\mrs{MM.\space} + +\ifx\@makefntext\undefined\else +\renewcommand\@makefntext[1]{\quad\ifx\@thefnmark\empty\else\@thefnmark.\space\fi #1} +\fi + % \end{macrocode} % \iffalse %</gloss-french.ldf> @@ -3329,23 +3352,23 @@ and may look very wrong.} \def\@tmpa{#1}% \ifx\@tmpa\tmp@oldyr\def\@tmpa{old}\fi \ifx\@tmpa\tmp@old - \ifx\l@german\@undefined + \xpg@ifdefined{german}{}{% \xpg@nopatterns{german}% \adddialect\l@german\l@nohyphenation - \fi + } \@german@oldspellingtrue - \else %try ngerman - \ifx\l@ngerman\@undefined - \ifx\l@german\@undefined - \xpg@nopatterns{ngerman}% - \adddialect\l@ngerman\l@nohyphenation - \else + \else % try ngerman + \xpg@ifdefined{ngerman}{% + \@german@oldspellingfalse + }{% fall back to german + \xpg@ifdefined{german}{% \xpg@warning{You asked for `ngerman' but only `german' hyphenation is available!}% \@german@oldspellingtrue - \fi - \else %we use ngerman - \@german@oldspellingfalse - \fi + }{% + \xpg@nopatterns{ngerman}% + \adddialect\l@ngerman\l@nohyphenation + }% + }% \fi } @@ -3361,10 +3384,10 @@ and may look very wrong.} \@austrian@localefalse% \fi \ifx\@tmpa\tmp@swiss\@swiss@localetrue - \ifcsundef{l@swissgerman}% + \xpg@ifdefined{swissgerman}{}% {\xpg@warning{No hyphenation patterns were loaded for "Swiss German (Old Spelling)"\MessageBreak I will use the standard patterns for German (old spelling) instead}% - \adddialect\l@swissgerman\l@german\relax}{}% + \adddialect\l@swissgerman\l@german\relax}% \else \@swiss@localefalse% \fi} @@ -3504,7 +3527,7 @@ and may look very wrong.} \if@german@fraktur\date@german@fraktur\else\date@german\fi } -\def\german@language{\language=% +\def\german@language{\ifxetex\language=% \csname l@% \if@swiss@locale \if@german@oldspelling @@ -3518,29 +3541,29 @@ and may look very wrong.} \else% (german, austrian) \if@german@oldspelling\else n\fi german\ifgerman@latesthyphen -x-latest\fi \fi - \endcsname + \endcsname\else\ifluatex % LuaTeX \ifgerman@latesthyphen \if@german@oldspelling \if@swiss@locale - \xpg@set@language@luatex@ii{swissgerman}% + \xpg@set@language@luatex@iv{swissgerman}% \else - \xpg@set@language@luatex@ii{german-x-latest}% + \xpg@set@language@luatex@iv{german-x-latest}% \fi \else - \xpg@set@language@luatex@ii{ngerman-x-latest}% + \xpg@set@language@luatex@iv{ngerman-x-latest}% \fi \else% (latesthyphen=false) \if@german@oldspelling \if@swiss@locale - \xpg@set@language@luatex@ii{swissgerman}% + \xpg@set@language@luatex@iv{swissgerman}% \else - \xpg@set@language@luatex@ii{german}% + \xpg@set@language@luatex@iv{german}% \fi \else - \xpg@set@language@luatex@ii{ngerman}% + \xpg@set@language@luatex@iv{ngerman}% \fi - \fi + \fi\fi\fi } \def\noextras@german{% @@ -4581,162 +4604,162 @@ and may look very wrong.} % % \subsection{gloss-khmer.ldf} % \begin{macrocode} -\ProvidesFile{gloss-khmer.ldf}[polyglossia: module for Khmer] -\PolyglossiaSetup{khmer}{ - script=Khmer,% - scripttag=khmr,% - langtag=KHM,% - hyphennames={nohyphenation},% - fontsetup=true% -} -\newif\if@khmer@numerals -\def\tmp@khmer{khmer} -\define@key{khmer}{numerals}[arabic]{% - \def\@tmpa{#1}% - \ifx\@tmpa\tmp@khmer\@khmer@numeralstrue% - \else\@khmer@numeralsfalse\fi% -} -\setkeys{khmer}{numerals} -\def\captionskhmer{% - \def\prefacename{អារម្ភកថា}% - \def\refname{ឯកសារយោង}% - \def\abstractname{សង្ខេប}% - \def\bibname{គន្ថនិទ្ទេស}% - \def\chaptername{ជំពូក}% - \def\appendixname{សេចក្ដីបន្ថែម}% - \def\contentsname{មាតិការ}% - \def\listfigurename{បញ្ជីរូបភាព}% - \def\listtablename{បញ្ជីតារាង}% - \def\indexname{សន្ទស្សន៍}% - \def\figurename{រូប}% - \def\tablename{តារាង}% - \def\partname{ផ្នែក}% - \def\pagename{ទំព័រ}% - \def\seename{មើល}% - \def\alsoname{មើលបន្ថែម}% - \def\enclname{ឯកសារភ្ជាប់}% - \def\ccname{ចម្លងជួន}% - \def\headtoname{ផ្ញើរទៅ}% - \def\proofname{សម្រាយ}% - \def\glossaryname{សទានុក្រម}% -} -\def\datekhmer{% - \def\khmer@month{% - \ifcase\month\or% - មករា\or% - កុម្ភៈ\or% - មិនា\or% - មេសា\or% - ឧសភា\or% - មិថុនា\or% - កក្កដា\or% - សីហា\or% - កញ្ញា\or% - តុលា\or% - វិច្ឆិកា\or% - ធ្នូ\fi}% - \def\today{\khmernumber\day\space\khmer@month\space\khmernumber\year}% -} -\def\khmerdigits#1{\expandafter\@khmer@digits #1@} -\def\@khmer@digits#1{% - \ifx @#1% then terminate - \else\ifx0#1០% - \else\ifx1#1១% - \else\ifx2#1២% - \else\ifx3#1៣% - \else\ifx4#1៤% - \else\ifx5#1៥% - \else\ifx6#1៦% - \else\ifx7#1៧% - \else\ifx8#1៨% - \else\ifx9#1៩% - \else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \expandafter\@khmer@digits% - \fi -} -\def\khmernumber#1{% - \if@khmer@numerals% - \khmerdigits{\number#1}% - \else% - \number#1% - \fi} -\def\khmer@globalnumbers{% - \let\orig@arabic\@arabic% - \let\@arabic\khmernumber% - \renewcommand{\thefootnote}{\protect\khmernumber{\c@footnote}}% -} -\def\nokhmer@globalnumbers{% - \let\@arabic\orig@arabic% - \renewcommand\thefootnote{\protect\number{\c@footnote}}% -} -\def\thepart{\arabic{part}} -\def\@khmeralph#1{% -\ifcase#1% -\or ក\or ខ\or គ\or ឃ\or ង% -\or ច\or ឆ\or ជ\or ឈ\or ញ% -\or ដ\or ឋ\or ឌ\or ឍ\or ណ% -\or ត\or ថ\or ទ\or ធ\or ន% -\or ប\or ផ\or ព\or ភ\or ម% -\or យ\or រ\or ល\or វ\or ស\or ហ\or ឡ\or អ% -\else\xpg@ill@value{#1}{@khmeralph}\fi} -\def\khmerAlph#1{\expandafter\@khmerAlph\csname c@#1\endcsname} -\def\@khmerAlph#1{% -\ifcase#1% -\or ក\or ខ\or គ\or ឃ\or ង% -\or ច\or ឆ\or ជ\or ឈ\or ញ% -\or ដ\or ឋ\or ឌ\or ឍ\or ណ% -\or ត\or ថ\or ទ\or ធ\or ន% -\or ប\or ផ\or ព\or ភ\or ម% -\or យ\or រ\or ល\or វ\or ស\or ហ\or ឡ\or អ% -\else\xpg@ill@value{#1}{@khmeralph}\fi} -\def\khmer@numbers{% - \let\@latinalph\@alph% - \let\@latinAlph\@Alph% - \if@khmer@numerals - \let\@alph\@khmeralph% - \let\@Alph\@khmerAlph% - \fi% -} -\def\nokhmer@numbers{% - \let\@alph\@latinalph% - \let\@Alph\@latinAlph% -} -\def\blockextras@khmer{% - \XeTeXlinebreaklocale "kh" % - \XeTeXlinebreakskip = 0pt plus 1pt minus 1pt -% \let\orig@baselinestretch\baselinestretch% -% \renewcommand{\baselinestretch}{1.2}% not work -} -\def\noblockextras@khmer{% - \XeTeXlinebreaklocale "en"% -% \let\baselinestretch\orig@baselinestretch% -} -\@ifclassloaded{beamer}{% - \usefonttheme{professionalfonts}% - \def\factname{ស្វ័យសត្យ}% - \def\lemmaname{បទគន្លិះ}% - \def\theoremname{ទ្រឹស្ដីបទ}% - \def\corollaryname{អនុសាធ្យ}% - \def\problemname{ចំណោទ}% - \def\solutionname{ដំណោះស្រាយ}% - \def\definitionname{និយមន័យ}% - \def\examplename{ឧទាហរណ៏}% - \uselanguage{khmer}% - \languagepath{khmer}% - \deftranslation[to=khmer]{Fact}{\factname}% - \deftranslation[to=khmer]{Lemma}{\lemmaname}% - \deftranslation[to=khmer]{Theorem}{\theoremname}% - \deftranslation[to=khmer]{Corollary}{\corollaryname}% - \deftranslation[to=khmer]{Problem}{\problemname}% - \deftranslation[to=khmer]{Solution}{\solutionname}% - \deftranslation[to=khmer]{Definition}{\definitionname}% - \deftranslation[to=khmer]{Definitions}{\definitionname}% - \deftranslation[to=khmer]{Example}{\examplename}% - \deftranslation[to=khmer]{Examples}{\examplename}% - \AtEndDocument{\immediate\write\@auxout{\string\@writefile{nav}% - {\noexpand\headcommand{\noexpand\def\noexpand% - \inserttotalframenumber{\khmernumber{\the\c@framenumber}}}}}}% -}{} +\ProvidesFile{gloss-khmer.ldf}[polyglossia: module for Khmer]
+\PolyglossiaSetup{khmer}{
+ script=Khmer,%
+ scripttag=khmr,%
+ langtag=KHM,%
+ hyphennames={nohyphenation},%
+ fontsetup=true%
+}
+\newif\if@khmer@numerals
+\def\tmp@khmer{khmer}
+\define@key{khmer}{numerals}[arabic]{%
+ \def\@tmpa{#1}%
+ \ifx\@tmpa\tmp@khmer\@khmer@numeralstrue%
+ \else\@khmer@numeralsfalse\fi%
+}
+\setkeys{khmer}{numerals}
+\def\captionskhmer{%
+ \def\prefacename{អារម្ភកថា}%
+ \def\refname{ឯកសារយោង}%
+ \def\abstractname{សង្ខេប}%
+ \def\bibname{គន្ថនិទ្ទេស}%
+ \def\chaptername{ជំពូក}%
+ \def\appendixname{សេចក្ដីបន្ថែម}%
+ \def\contentsname{មាតិការ}%
+ \def\listfigurename{បញ្ជីរូបភាព}%
+ \def\listtablename{បញ្ជីតារាង}%
+ \def\indexname{សន្ទស្សន៍}%
+ \def\figurename{រូប}%
+ \def\tablename{តារាង}%
+ \def\partname{ផ្នែក}%
+ \def\pagename{ទំព័រ}%
+ \def\seename{មើល}%
+ \def\alsoname{មើលបន្ថែម}%
+ \def\enclname{ឯកសារភ្ជាប់}%
+ \def\ccname{ចម្លងជួន}%
+ \def\headtoname{ផ្ញើរទៅ}%
+ \def\proofname{សម្រាយ}%
+ \def\glossaryname{សទានុក្រម}%
+}
+\def\datekhmer{%
+ \def\khmer@month{%
+ \ifcase\month\or%
+ មករា\or%
+ កុម្ភៈ\or%
+ មិនា\or%
+ មេសា\or%
+ ឧសភា\or%
+ មិថុនា\or%
+ កក្កដា\or%
+ សីហា\or%
+ កញ្ញា\or%
+ តុលា\or%
+ វិច្ឆិកា\or%
+ ធ្នូ\fi}%
+ \def\today{\khmernumber\day\space\khmer@month\space\khmernumber\year}%
+}
+\def\khmerdigits#1{\expandafter\@khmer@digits #1@}
+\def\@khmer@digits#1{%
+ \ifx @#1% then terminate
+ \else\ifx0#1០%
+ \else\ifx1#1១%
+ \else\ifx2#1២%
+ \else\ifx3#1៣%
+ \else\ifx4#1៤%
+ \else\ifx5#1៥%
+ \else\ifx6#1៦%
+ \else\ifx7#1៧%
+ \else\ifx8#1៨%
+ \else\ifx9#1៩%
+ \else#1\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \expandafter\@khmer@digits%
+ \fi
+}
+\def\khmernumber#1{%
+ \if@khmer@numerals%
+ \khmerdigits{\number#1}%
+ \else%
+ \number#1%
+ \fi}
+\def\khmer@globalnumbers{%
+ \let\orig@arabic\@arabic%
+ \let\@arabic\khmernumber%
+ \renewcommand{\thefootnote}{\protect\khmernumber{\c@footnote}}%
+}
+\def\nokhmer@globalnumbers{%
+ \let\@arabic\orig@arabic%
+ \renewcommand\thefootnote{\protect\number{\c@footnote}}%
+}
+\def\thepart{\arabic{part}}
+\def\@khmeralph#1{%
+\ifcase#1%
+\or ក\or ខ\or គ\or ឃ\or ង%
+\or ច\or ឆ\or ជ\or ឈ\or ញ%
+\or ដ\or ឋ\or ឌ\or ឍ\or ណ%
+\or ត\or ថ\or ទ\or ធ\or ន%
+\or ប\or ផ\or ព\or ភ\or ម%
+\or យ\or រ\or ល\or វ\or ស\or ហ\or ឡ\or អ%
+\else\xpg@ill@value{#1}{@khmeralph}\fi}
+\def\khmerAlph#1{\expandafter\@khmerAlph\csname c@#1\endcsname}
+\def\@khmerAlph#1{%
+\ifcase#1%
+\or ក\or ខ\or គ\or ឃ\or ង%
+\or ច\or ឆ\or ជ\or ឈ\or ញ%
+\or ដ\or ឋ\or ឌ\or ឍ\or ណ%
+\or ត\or ថ\or ទ\or ធ\or ន%
+\or ប\or ផ\or ព\or ភ\or ម%
+\or យ\or រ\or ល\or វ\or ស\or ហ\or ឡ\or អ%
+\else\xpg@ill@value{#1}{@khmeralph}\fi}
+\def\khmer@numbers{%
+ \let\@latinalph\@alph%
+ \let\@latinAlph\@Alph%
+ \if@khmer@numerals
+ \let\@alph\@khmeralph%
+ \let\@Alph\@khmerAlph%
+ \fi%
+}
+\def\nokhmer@numbers{%
+ \let\@alph\@latinalph%
+ \let\@Alph\@latinAlph%
+}
+\def\blockextras@khmer{%
+ \XeTeXlinebreaklocale "kh" %
+ \XeTeXlinebreakskip = 0pt plus 1pt minus 1pt
+% \let\orig@baselinestretch\baselinestretch%
+% \renewcommand{\baselinestretch}{1.2}% not work
+}
+\def\noblockextras@khmer{%
+ \XeTeXlinebreaklocale "en"%
+% \let\baselinestretch\orig@baselinestretch%
+}
+\@ifclassloaded{beamer}{%
+ \usefonttheme{professionalfonts}%
+ \def\factname{ស្វ័យសត្យ}%
+ \def\lemmaname{បទគន្លិះ}%
+ \def\theoremname{ទ្រឹស្ដីបទ}%
+ \def\corollaryname{អនុសាធ្យ}%
+ \def\problemname{ចំណោទ}%
+ \def\solutionname{ដំណោះស្រាយ}%
+ \def\definitionname{និយមន័យ}%
+ \def\examplename{ឧទាហរណ៏}%
+ \uselanguage{khmer}%
+ \languagepath{khmer}%
+ \deftranslation[to=khmer]{Fact}{\factname}%
+ \deftranslation[to=khmer]{Lemma}{\lemmaname}%
+ \deftranslation[to=khmer]{Theorem}{\theoremname}%
+ \deftranslation[to=khmer]{Corollary}{\corollaryname}%
+ \deftranslation[to=khmer]{Problem}{\problemname}%
+ \deftranslation[to=khmer]{Solution}{\solutionname}%
+ \deftranslation[to=khmer]{Definition}{\definitionname}%
+ \deftranslation[to=khmer]{Definitions}{\definitionname}%
+ \deftranslation[to=khmer]{Example}{\examplename}%
+ \deftranslation[to=khmer]{Examples}{\examplename}%
+ \AtEndDocument{\immediate\write\@auxout{\string\@writefile{nav}%
+ {\noexpand\headcommand{\noexpand\def\noexpand%
+ \inserttotalframenumber{\khmernumber{\the\c@framenumber}}}}}}%
+}{}
% \end{macrocode} % \iffalse %</gloss-khmer.ldf> @@ -4753,13 +4776,33 @@ and may look very wrong.} scripttag=hang, language=Korean, langtag=KOR, - hyphennames={english,american,usenglish,USenglish}, + hyphennames={english,USenglish}, hyphenmins={2,3}, frenchspacing=true, fontsetup=true } +% variant : plain (0), classic (1), or modern (2) +\define@choicekey{korean}{variant}[\val\nr]{plain,classic,modern}[plain]{% + \let\xpg@korean@variant\nr +} +% captions : hangul (0) or hanja (1) +\define@choicekey{korean}{captions}[\val\nr]{hangul,hanja}[hangul]{% + \let\xpg@korean@captions\nr +} +\setkeys{korean}{variant,captions} + \def\captionskorean{% + \ifcase\xpg@korean@captions\relax + \captions@korean@hangul + \else + \captions@korean@hanja + \fi + \def\seename{$rightarrow$}% + \def\alsoname{$Rightarrow$}% +} +\def\captions@korean@hangul{% + \def\koreanTHEname{제}% \def\partname##1##2{제##1##2 편}% \def\chaptername{장}% \def\refname{참고문헌}% @@ -4774,24 +4817,39 @@ and may look very wrong.} \def\figurename{그림}% \def\tablename{표}% \def\pagename{페이지}% - \def\seename{$rightarrow$}% - \def\alsoname{$Rightarrow$}% \def\enclname{동봉}% \def\proofname{증명}% \def\headtoname{수신:}% \def\ccname{사본}% } -\def\xpg@korean@language{korean} -\AtBeginDocument{ - \ifx\xpg@main@language\xpg@korean@language - \@ifclassloaded{book}{\def\@chapapp#1#2{제#1#2#1\chaptername}}{ - \@ifclassloaded{report}{\def\@chapapp#1#2{제#1#2#1\chaptername}}{} - } - \fi +\def\captions@korean@hanja{% + \def\koreanTHEname{第}% + \def\partname##1##2{第##1##2 篇}% + \def\chaptername{章}% + \def\refname{參考文獻}% + \def\abstractname{要約}% + \def\bibname{參考文獻}% + \def\prefacename{序文}% + \def\appendixname{附錄}% + \def\contentsname{目次}% + \def\listfigurename{圖版 目次}% + \def\listtablename{表 目次}% + \def\indexname{索引}% + \def\figurename{圖版}% + \def\tablename{表}% + \def\pagename{面}% + \def\enclname{同封}% + \def\proofname{證明}% + \def\headtoname{受信:}% + \def\ccname{寫本}% } \def\datekorean{% - \def\today{\the\year 년 \the\month 월 \the\day 일}% + \ifcase\xpg@korean@captions\relax + \def\today{\the\year 년 \the\month 월 \the\day 일}% + \else + \def\today{\the\year 年 \the\month 月 \the\day 日}% + \fi } \def\koreanAlph#1{\expandafter\@koreanAlph\csname c@#1\endcsname} @@ -4818,139 +4876,465 @@ and may look very wrong.} } \let\nokorean@globalnumbers\nokorean@numbers -\ifluatex -\newluatexattribute\xpg@attr@korean -\directlua{ -local glyph_id = node.id("glyph") -local attr_korean = luatexbase.attributes["xpg@attr@korean"] -local nobreak_after = { - [0x28] = true, [0x3C] = true, [0x5B] = true, [0x60] = true, [0x7B] = true, - [0x2018] = true, [0x201C] = true, [0x3008] = true, [0x300A] = true, - [0x300C] = true, [0x300E] = true, [0x3010] = true, [0x3014] = true, - [0xFF08] = true, [0xFF1C] = true, [0xFF3B] = true, [0xFF5B] = true, -} -local nobreak_before = { - [0x21] = true, [0x22] = true, [0x27] = true, [0x29] = true, [0x2C] = true, - [0x2D] = true, [0x2E] = true, [0x2F] = true, [0x3A] = true, [0x3B] = true, - [0x3E] = true, [0x3F] = true, [0x5D] = true, [0x7D] = true, [0xB7] = true, - [0x2013] = true, [0x2014] = true, [0x2015] = true, [0x2019] = true, - [0x201D] = true, [0x2025] = true, [0x2026] = true, [0x3001] = true, - [0x3002] = true, [0x3009] = true, [0x300B] = true, [0x300D] = true, - [0x300F] = true, [0x3011] = true, [0x3015] = true, [0xFF01] = true, - [0xFF09] = true, [0xFF0C] = true, [0xFF0E] = true, [0xFF1A] = true, - [0xFF1B] = true, [0xFF1F] = true, [0xFF3D] = true, [0xFF5D] = true, - [0x3041] = true, [0x3043] = true, [0x3045] = true, [0x3047] = true, - [0x3049] = true, [0x3063] = true, [0x3083] = true, [0x3085] = true, - [0x3087] = true, [0x308E] = true, [0x3095] = true, [0x3096] = true, - [0x3099] = true, [0x309A] = true, [0x309B] = true, [0x309C] = true, - [0x309D] = true, [0x309E] = true, [0x30A0] = true, [0x30A1] = true, - [0x30A3] = true, [0x30A5] = true, [0x30A7] = true, [0x30A9] = true, - [0x30C3] = true, [0x30E3] = true, [0x30E5] = true, [0x30E7] = true, - [0x30EE] = true, [0x30F5] = true, [0x30F6] = true, [0x30FB] = true, - [0x30FC] = true, [0x30FD] = true, [0x30FE] = true, -} -for i=0x1160, 0x11FF do nobreak_before[i] = true end -for i=0xD7B0, 0xD7FB do nobreak_before[i] = true end -for i=0x302E, 0x302F do nobreak_before[i] = true end -for i=0x31F0, 0x31FF do nobreak_before[i] = true end -local is_cjk = function (c) - return (c >= 0xAC00 and c <= 0xD7A3) - or (c >= 0x1100 and c <= 0x115F) - or (c >= 0xA960 and c <= 0xA97C) - or (c >= 0x3400 and c <= 0x9FFF) - or (c >= 0xF900 and c <= 0xFAFF) - or (c >= 0x2E80 and c <= 0x2FFF) - or (c >= 0x3040 and c <= 0x30FF) - or (c >= 0x20000 and c <= 0x2CEAF) - or (c >= 0x2F800 and c <= 0x2FA1F) - or (nobreak_after[c] and c > 0xFF) - or (nobreak_before[c] and c > 0xFF) -end -local insert_penalty_glue = function (head, curr) - local penalty = node.new("penalty") - penalty.penalty = 50 - local glue = node.new("glue") - local spec = node.new("glue_spec") - local size = fonts.hashes.identifiers[curr.font] or font.fonts[curr.font] - size = size and size.size or 655360 - spec.width = 0 - spec.stretch = size/10 - spec.shrink = size/25 - glue.spec = spec - head, curr = node.insert_after(head, curr, penalty) - head, curr = node.insert_after(head, curr, glue) - return head, curr -end -local korean_break = function (head) - local curr = head - while curr do - if curr.id == glyph_id and node.has_attribute(curr, attr_korean) then - local next = curr.next - if next and next.id == glyph_id then - local c, n = curr.char, next.char - if (is_cjk(c) or is_cjk(n)) and not nobreak_before[n] and not nobreak_after[c] then - head, curr = insert_penalty_glue(head, curr) - end - end - end - curr = curr.next - end - return head -end -local reorder_tm = function (head) - local tone - local curr = node.tail(head) - while curr do - if curr.id == glyph_id and node.has_attribute(curr, attr_korean) then - local c, wd = curr.char, curr.width - if (c == 0x302E or c == 0x302F) and wd and wd > 0 then - tone = curr - elseif tone and not nobreak_before[c] then - head = node.remove(head, tone) - tone.next, tone.prev = nil, nil - head, curr = node.insert_before(head, curr, tone) - tone = nil - end - end - curr = curr.prev - end - return head -end -luatexbase.add_to_callback ("pre_linebreak_filter", reorder_tm, "polyglossia.reorder_korean_tm", 1) -luatexbase.add_to_callback ("pre_linebreak_filter", korean_break, "polyglossia.korean_break", 1) -luatexbase.add_to_callback ("hpack_filter", reorder_tm, "polyglossia.reorder_korean_tm", 1) -} +\ifxetex + \def\inlineextras@korean{% + \ifcase\xpg@korean@variant\relax + \XeTeXinterchartokenstate\z@ + \XeTeXlinebreakpenalty 50 + \or + \setvariantkoreaninterchartoks + \setvariantkoreancharclasses + \def\XPGKOhalfdim{\dimexpr.5em\relax}% + \XeTeXinterchartokenstate\@ne + \XeTeXlinebreakpenalty \z@ + \else + \setvariantkoreaninterchartoks + \setvariantkoreancharclasses + \def\XPGKOhalfdim{\dimexpr.5\fontdimen\tw@\font\relax}% + \XeTeXinterchartokenstate\@ne + \XeTeXlinebreakpenalty 50 + \fi + \XeTeXlinebreakskip 0pt plus.1em minus .01em + \XeTeXlinebreaklocale "ko" + } + \def\noextras@korean{% + \ifcase\xpg@korean@variant\relax + \else + \unsetvariantkoreaninterchartoks + \unsetvariantkoreancharclasses + \fi + \XeTeXinterchartokenstate\z@ + \XeTeXlinebreakpenalty\z@ + \XeTeXlinebreakskip\z@skip + \XeTeXlinebreaklocale "" + \noextras@korean@common + } +\else % luatex + \def\inlineextras@korean{\xpg@attr@korean\xpg@korean@variant\relax} + \def\noextras@korean{% + \unsetattribute\xpg@attr@korean + \noextras@korean@common + } \fi -\def\noextras@korean{% - \ifxetex - \XeTeXlinebreaklocale "" - \else - \unsetluatexattribute\xpg@attr@korean +\def\blockextras@korean{% + \inlineextras@korean + \ifdefined\@chapapp + \long\def\@tmpa{\chaptername}\def\@tmpb{\chaptername}% + \ifnum0\ifx\@chapapp\@tmpa1\else\ifx\@chapapp\@tmpb1\fi\fi>\z@ + \let\xpg@orig@@chapapp\@chapapp + \def\@chapapp##1##2{\koreanTHEname ##1##2##1\chaptername}% + \fi + \fi + \ifdefined\baselinestretch + \let\xpg@orig@linestretch\baselinestretch + \def\baselinestretch{1.3888}\selectfont + \fi + \ifdefined\footnotesep + \edef\xpg@orig@footnotesep{\noexpand\footnotesep=\the\footnotesep\relax}% + \footnotesep=1.3888\footnotesep \fi - \ifdefined\xpg@orig@baselinestretch \xpg@orig@baselinestretch \fi - \ifdefined\xpg@orig@footnotesep \xpg@orig@footnotesep \fi } -\def\inlineextras@korean{% - \ifxetex - \XeTeXlinebreaklocale "ko" - \XeTeXlinebreakpenalty 50 - \XeTeXlinebreakskip 0pt plus.1em minus .04em +\def\noextras@korean@common{% + \ifdefined\xpg@orig@footnotesep \xpg@orig@footnotesep \fi + \ifdefined\xpg@orig@linestretch \let\baselinestretch\xpg@orig@linestretch \fi + \ifdefined\xpg@orig@@chapapp \let\@chapapp\xpg@orig@@chapapp \fi +} + +\ifxetex % XeTeX +% user commands for Josa +% Josa : particles in Korean grammar that immediately follow a noun or pronoun. +% Josa might vary depending on previous character. +\protected\def\jong {\global\let\XPGKO@let@josa=0}\jong +\protected\def\rieul{\global\let\XPGKO@let@josa=1} +\protected\def\jung {\global\let\XPGKO@let@josa=2} +\protected\def\가{\xpg@make@josa 가이} +\protected\def\이{\futurelet\@let@token\xpg@make@josa@I} +\protected\def\은{\xpg@make@josa 는은} \let\는\은 +\protected\def\을{\xpg@make@josa 를을} \let\를\을 +\protected\def\와{\xpg@make@josa 와과} \let\과\와 +\protected\def\으{\xpg@make@josa \empty 으} +\protected\def\로{\으 로} +\protected\def\라{\xpg@make@josa 라{이라}} +\def\xpg@make@josa@I{% + \ifx\@let@token 라% + \expandafter\xpg@make@josa\expandafter\relax\expandafter 이% \else - \xpg@attr@korean=1 + \expandafter\가 \fi } - -\def\blockextras@korean{% - \inlineextras@korean - \xdef\xpg@orig@baselinestretch{\def\noexpand\baselinestretch{\ifdefined\baselinestretch\baselinestretch\else 1\fi}}% - \def\baselinestretch{1.3888}\selectfont - \xdef\xpg@orig@footnotesep{\noexpand\footnotesep=\ifdefined\footnotesep\the\footnotesep\else 0pt\fi}% - \footnotesep=1.3888\footnotesep +\def\xpg@make@josa#1#2{% + \ifcat\xpg@catcode@letter\XPGKO@let@josa + \expandafter\expandafter\expandafter\count@\expandafter + \xpg@letter@to@num\meaning\XPGKO@let@josa\relax + \else\ifcat\xpg@catcode@other\XPGKO@let@josa + \expandafter\expandafter\expandafter\count@\expandafter + \xpg@character@to@num\meaning\XPGKO@let@josa\relax + \fi\fi + \ifnum\count@<"3260 + \else\ifnum\count@<"3280 \advance\count@-"60 + \else\ifnum\count@<"AC00 + \else\ifnum\count@<"D7A4 % Hangul syllables + \advance\count@-"AC00 + \@tempcnta\count@ \divide\@tempcnta28 \multiply\@tempcnta28 + \advance\count@-\@tempcnta \advance\count@"11A7 + \else\ifnum\count@<"FF00 + \else\ifnum\count@<"FF5B \advance\count@-"FEE0 + \fi\fi\fi\fi\fi \fi + \ifnum\count@<"11A8 + \ifnum "30=\count@ \count@\z@ % 0 + \else\ifnum "31=\count@ \count@\@ne % 1 + \else\ifnum "33=\count@ \count@\z@ % 3 + \else\ifnum "36=\count@ \count@\z@ % 6 + \else\ifnum "37=\count@ \count@\@ne % 7 + \else\ifnum "38=\count@ \count@\@ne % 8 + \else\ifnum "4C=\count@ \count@\@ne % L + \else\ifnum "4D=\count@ \count@\z@ % M + \else\ifnum "4E=\count@ \count@\z@ % N + \else\ifnum "6C=\count@ \count@\@ne % l + \else\ifnum "6D=\count@ \count@\z@ % m + \else\ifnum "6E=\count@ \count@\z@ % n + \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi + \else\ifnum\count@<"1200 + \ifnum\count@="11AF \count@\@ne \else \count@\z@ \fi + \else\ifnum\count@<"3131 + \else\ifnum\count@<"318F + \ifnum \count@="3139 \count@\@ne + \else\ifnum\count@<"314F \count@\z@ + \else\ifnum\count@>"3164 + \ifnum\count@<"3187 \count@\z@ \fi + \fi\fi\fi + \else\ifnum\count@<"3200 + \else\ifnum\count@<"321F + \ifnum \count@="3203 \count@\@ne + \else\ifnum\count@<"320E \count@\z@ + \fi\fi + \else\ifnum\count@<"D7CB + \else\ifnum\count@<"D7FC \count@\z@ + \fi\fi\fi\fi\fi \fi\fi\fi + \ifcase\count@ #2% jong + \or \ifx#1\empty\else#2\fi% rieul + \else #1% jung + \fi +} +\expandafter\def\expandafter\xpg@character@to@num\detokenize{the character} #1#2\relax{`#1\relax} +\expandafter\def\expandafter\xpg@letter@to@num\detokenize{the letter} #1#2\relax{`#1\relax} +\begingroup +\catcode`A=11 \catcode`0=12 +\global\let\xpg@catcode@letter=A \global\let\xpg@catcode@other=0 +\endgroup +% macros for interchartoks (Josa selection) +\def\XPGKOstartID{\global\futurelet\XPGKO@let@josa\XPGKO@skipID} +\def\XPGKOstartAA{\global\futurelet\XPGKO@let@josa\XPGKO@skipAA} +\def\XPGKO@skipID{\XeTeXinterchartoks\XeTeXcharclassBoundary\XeTeXcharclassID{\empty}} +\def\XPGKO@skipAA{\XeTeXinterchartoks\XeTeXcharclassBoundary\XPGKOcharclassAA{\empty}} +\def\XPGKOstopID {\XeTeXinterchartoks\XeTeXcharclassBoundary\XeTeXcharclassID{\XPGKOstartID}} +\def\XPGKOstopAA {\XeTeXinterchartoks\XeTeXcharclassBoundary\XPGKOcharclassAA{\XPGKOstartAA}} +% macros for interchartoks (CJK punctuations) +\def\XPGKOstartOP{\leavevmode\hbox to.5em\bgroup\hss}% +\def\XPGKOstopOP {\egroup}% +\def\XPGKOstartCL{\leavevmode\hbox to.5em\bgroup}% +\def\XPGKOstopCL {\hss\egroup}% +\let\XPGKOstartFS\XPGKOstartCL \let\XPGKOstopFS\XPGKOstopCL +\let\XPGKOstartMD\XPGKOstartOP \let\XPGKOstopMD\XPGKOstopCL +\let\XPGKOnobreak \nobreak +\def\XPGKOhalfzero {\hskip \XPGKOhalfdim \relax}% +\def\XPGKOhalfhalf {\hskip \XPGKOhalfdim minus \XPGKOhalfdim \relax}% +\def\XPGKOhalfquarter {\hskip \XPGKOhalfdim minus.5\XPGKOhalfdim \relax}% +\def\XPGKOquarterquarter {\hskip .5\XPGKOhalfdim minus.5\XPGKOhalfdim \relax}% +\def\XPGKOiiiquarterquarter{\hskip1.5\XPGKOhalfdim minus.5\XPGKOhalfdim \relax}% +\def\XPGKOlatincjk {\hskip .5\XPGKOhalfdim plus.25\XPGKOhalfdim minus.125\XPGKOhalfdim}% +% user macro to force zero skip +\let\inhibitglue\relax +% initialize interchartoks and classes +\let\XeTeXcharclassIgnore \@cclvi +\let\XeTeXcharclassBoundary\@cclv +\ifdefined\XeTeXcharclassID\else + \ifdefined\xtxHanGlue + \let\XeTeXcharclassID\@ne + \let\XeTeXcharclassOP\tw@ + \let\XeTeXcharclassCL\thr@@ + \else % email from JW + \newXeTeXintercharclass\XeTeXcharclassID + \newXeTeXintercharclass\XeTeXcharclassOP + \newXeTeXintercharclass\XeTeXcharclassCL + \global\let\XeTeXcharclassEX\XeTeXcharclassCL + \global\let\XeTeXcharclassIS\XeTeXcharclassCL + \global\let\XeTeXcharclassNS\XeTeXcharclassCL + \global\let\XeTeXcharclassCM\XeTeXcharclassIgnore + \input load-unicode-xetex-classes % + \fi +\fi +% assign Hangul +\count@="AC00 \loop + \XeTeXcharclass\count@\XeTeXcharclassID + \ifnum\count@<"D7A3 + \advance\count@\@ne + \repeat +\count@="1100 \loop + \XeTeXcharclass\count@\XeTeXcharclassID + \ifnum\count@<"11FF + \advance\count@\@ne + \repeat +\count@="A960 \loop + \XeTeXcharclass\count@\XeTeXcharclassID + \ifnum\count@<"A97C + \advance\count@\@ne + \repeat +\count@="D7B0 \loop + \XeTeXcharclass\count@\XeTeXcharclassID + \ifnum\count@<"D7FB + \advance\count@\@ne + \repeat +% more classes +\newXeTeXintercharclass\XPGKOcharclassMD % ・ : ; +\newXeTeXintercharclass\XPGKOcharclassFS % 。 . +\newXeTeXintercharclass\XPGKOcharclassLD % ― … ‥ +\newXeTeXintercharclass\XPGKOcharclassEX % ? ! +\newXeTeXintercharclass\XPGKOcharclassAO % ascii ( +\newXeTeXintercharclass\XPGKOcharclassAC % ascii ) +\newXeTeXintercharclass\XPGKOcharclassAA % ascii letters/numbers +% unset all interchartoks +\def\unsetvariantkoreaninterchartoks{% + \@tfor\@tmpa :=\XeTeXcharclassID\XeTeXcharclassOP\XeTeXcharclassCL\XPGKOcharclassMD\XPGKOcharclassFS + \XPGKOcharclassLD\XPGKOcharclassEX\XPGKOcharclassAO\XPGKOcharclassAC\XPGKOcharclassAA + \do{\count@\XeTeXcharclassBoundary \loop + \XeTeXinterchartoks\@tmpa\count@{}% + \XeTeXinterchartoks\count@\@tmpa{}% + \ifnum\count@=\XeTeXcharclassBoundary \count@\m@ne \fi + \ifnum\count@<\xe@alloc@intercharclass + \advance\count@\@ne + \repeat + }% } +% interchartoks for classic/modern variants +\def\setvariantkoreaninterchartoks{% + \count@\XeTeXcharclassBoundary \loop + \ifnum\count@=\XeTeXcharclassID\else + \ifnum\count@=\XeTeXcharclassOP\else + \ifnum\count@=\XeTeXcharclassCL\else + \ifnum\count@=\XPGKOcharclassMD\else + \ifnum\count@=\XPGKOcharclassFS\else + \ifnum\count@=\XPGKOcharclassAA\else + \XeTeXinterchartoks\count@\XeTeXcharclassID{\XPGKOstartID}% + \XeTeXinterchartoks\count@\XeTeXcharclassOP{\XPGKOstartOP}% + \XeTeXinterchartoks\count@\XeTeXcharclassCL{\XPGKOstartCL}% + \XeTeXinterchartoks\count@\XPGKOcharclassMD{\XPGKOstartMD}% + \XeTeXinterchartoks\count@\XPGKOcharclassFS{\XPGKOstartFS}% + \XeTeXinterchartoks\count@\XPGKOcharclassAA{\XPGKOstartAA}% + \XeTeXinterchartoks\XeTeXcharclassID\count@{\XPGKOstopID}% + \XeTeXinterchartoks\XeTeXcharclassOP\count@{\XPGKOstopOP}% + \XeTeXinterchartoks\XeTeXcharclassCL\count@{\XPGKOstopCL}% + \XeTeXinterchartoks\XPGKOcharclassMD\count@{\XPGKOstopMD}% + \XeTeXinterchartoks\XPGKOcharclassFS\count@{\XPGKOstopFS}% + \XeTeXinterchartoks\XPGKOcharclassAA\count@{\XPGKOstopAA}% + \fi\fi\fi\fi\fi\fi + \ifnum\count@=\XeTeXcharclassBoundary \count@\m@ne \fi + \ifnum\count@<\xe@alloc@intercharclass + \advance\count@\@ne + \repeat + % + \XeTeXinterchartoks\XPGKOcharclassAA\XeTeXcharclassID{\XPGKOstartID}% + \XeTeXinterchartoks\XPGKOcharclassAA\XeTeXcharclassOP{\XPGKOstopAA\XPGKOstartOP}% + \XeTeXinterchartoks\XPGKOcharclassAA\XeTeXcharclassCL{\XPGKOstopAA\XPGKOstartCL}% + \XeTeXinterchartoks\XPGKOcharclassAA\XPGKOcharclassMD{\XPGKOstopAA\XPGKOstartMD}% + \XeTeXinterchartoks\XPGKOcharclassAA\XPGKOcharclassFS{\XPGKOstopAA\XPGKOstartFS}% + \XeTeXinterchartoks\XPGKOcharclassAA\XPGKOcharclassAA{\XPGKOstartAA}% + % + \XeTeXinterchartoks\XeTeXcharclassID\XeTeXcharclassID{\XPGKOstartID}% + \XeTeXinterchartoks\XeTeXcharclassID\XeTeXcharclassOP{\XPGKOstopID\XPGKOhalfhalf\XPGKOstartOP}% + \XeTeXinterchartoks\XeTeXcharclassID\XeTeXcharclassCL{\XPGKOstopID\XPGKOstartCL}% + \XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassMD{\XPGKOstopID\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% + \XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassFS{\XPGKOstopID\XPGKOstartFS}% + \XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassAO{\XPGKOstopID\XPGKOlatincjk}% + \XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassAA{\XPGKOstartAA}% + % + \XeTeXinterchartoks\XeTeXcharclassOP\XeTeXcharclassID{\XPGKOstopOP\XPGKOstartID}% + \XeTeXinterchartoks\XeTeXcharclassOP\XeTeXcharclassOP{\XPGKOstopOP\XPGKOstartOP}% + \XeTeXinterchartoks\XeTeXcharclassOP\XeTeXcharclassCL{\XPGKOstopOP\XPGKOstartCL}% + \XeTeXinterchartoks\XeTeXcharclassOP\XPGKOcharclassMD{\XPGKOstopOP\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% + \XeTeXinterchartoks\XeTeXcharclassOP\XPGKOcharclassFS{\XPGKOstopOP\XPGKOstartFS}% + \XeTeXinterchartoks\XeTeXcharclassOP\XPGKOcharclassAA{\XPGKOstopOP\XPGKOstartAA}% + % + \XeTeXinterchartoks\XeTeXcharclassCL\XeTeXcharclassID{\XPGKOstopCL\XPGKOhalfhalf\XPGKOstartID}% + \XeTeXinterchartoks\XeTeXcharclassCL\XeTeXcharclassOP{\XPGKOstopCL\XPGKOhalfhalf\XPGKOstartOP}% + \XeTeXinterchartoks\XeTeXcharclassCL\XeTeXcharclassCL{\XPGKOstopCL\XPGKOstartCL}% + \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassMD{\XPGKOstopCL\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% + \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassFS{\XPGKOstopCL\XPGKOstartFS}% + \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassLD{\XPGKOstopCL\XPGKOnobreak\XPGKOhalfhalf}% + \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassEX{\XPGKOstopCL\XPGKOnobreak\XPGKOhalfhalf}% + \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassAO{\XPGKOstopCL\XPGKOhalfhalf}% + \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassAC{\XPGKOstopCL\XPGKOnobreak\XPGKOhalfhalf}% + \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassAA{\XPGKOstopCL\XPGKOstartAA}% + % + \XeTeXinterchartoks\XPGKOcharclassMD\XeTeXcharclassID{\XPGKOstopMD\XPGKOquarterquarter\XPGKOstartID}% + \XeTeXinterchartoks\XPGKOcharclassMD\XeTeXcharclassOP{\XPGKOstopMD\XPGKOquarterquarter\XPGKOstartOP}% + \XeTeXinterchartoks\XPGKOcharclassMD\XeTeXcharclassCL{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartCL}% + \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassMD{\XPGKOstopMD\XPGKOnobreak\XPGKOhalfquarter\XPGKOstartMD}% + \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassFS{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartFS}% + \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassLD{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter}% + \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassEX{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter}% + \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassAO{\XPGKOstopMD\XPGKOquarterquarter}% + \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassAC{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter}% + \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassAA{\XPGKOstopMD\XPGKOstartAA}% + % + \XeTeXinterchartoks\XPGKOcharclassFS\XeTeXcharclassID{\XPGKOstopFS\XPGKOhalfzero\XPGKOstartID}% + \XeTeXinterchartoks\XPGKOcharclassFS\XeTeXcharclassOP{\XPGKOstopFS\XPGKOhalfzero\XPGKOstartOP}% + \XeTeXinterchartoks\XPGKOcharclassFS\XeTeXcharclassCL{\XPGKOstopFS\XPGKOstartCL}% + \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassMD{\XPGKOstopFS\XPGKOnobreak\XPGKOiiiquarterquarter\XPGKOstartMD}% + \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassFS{\XPGKOstopFS\XPGKOstartFS}% + \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassLD{\XPGKOstopFS\XPGKOnobreak\XPGKOhalfzero}% + \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassEX{\XPGKOstopFS\XPGKOnobreak\XPGKOhalfzero}% + \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassAO{\XPGKOstopFS\XPGKOhalfzero}% + \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassAC{\XPGKOstopFS\XPGKOnobreak\XPGKOhalfzero}% + \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassAA{\XPGKOstopFS\XPGKOstartAA}% + % + \XeTeXinterchartoks\XPGKOcharclassLD\XeTeXcharclassOP{\XPGKOhalfhalf\XPGKOstartOP}% + \XeTeXinterchartoks\XPGKOcharclassLD\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% + % + \XeTeXinterchartoks\XPGKOcharclassEX\XeTeXcharclassID{\XPGKOhalfhalf\XPGKOstartID}% + \XeTeXinterchartoks\XPGKOcharclassEX\XeTeXcharclassOP{\XPGKOhalfhalf\XPGKOstartOP}% + \XeTeXinterchartoks\XPGKOcharclassEX\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% + \XeTeXinterchartoks\XPGKOcharclassEX\XPGKOcharclassAO{\XPGKOhalfhalf}% + \XeTeXinterchartoks\XPGKOcharclassEX\XPGKOcharclassAC{\XPGKOnobreak\XPGKOhalfhalf}% + % + \XeTeXinterchartoks\XPGKOcharclassAO\XeTeXcharclassOP{\XPGKOnobreak\XPGKOhalfhalf\XPGKOstartOP}% + \XeTeXinterchartoks\XPGKOcharclassAO\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% + % + \XeTeXinterchartoks\XPGKOcharclassAC\XeTeXcharclassID{\XPGKOlatincjk\XPGKOstartID}% + \XeTeXinterchartoks\XPGKOcharclassAC\XeTeXcharclassOP{\XPGKOhalfhalf\XPGKOstartOP}% + \XeTeXinterchartoks\XPGKOcharclassAC\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% +} +% char classes for classic/modern variants +\def\setvariantkoreancharclasses{} +\def\unsetvariantkoreancharclasses{} +\def\@tmpa#1=#2{% + \edef\setvariantkoreancharclasses{% + \unexpanded\expandafter{\setvariantkoreancharclasses + \XeTeXcharclass#1=#2}}% + \edef\unsetvariantkoreancharclasses{% + \noexpand\XeTeXcharclass#1=\the\XeTeXcharclass#1\relax + \unexpanded\expandafter{\unsetvariantkoreancharclasses}}% +} +\count@"30 \loop % 0 .. 9 + \expandafter\@tmpa\the\count@=\XPGKOcharclassAA + \ifnum\count@<"39 + \advance\count@\@ne + \repeat +\count@"41 \loop % A .. Z + \expandafter\@tmpa\the\count@=\XPGKOcharclassAA + \ifnum\count@<"5A + \advance\count@\@ne + \repeat +\count@"61 \loop % a .. z + \expandafter\@tmpa\the\count@=\XPGKOcharclassAA + \ifnum\count@<"7A + \advance\count@\@ne + \repeat +% NS +\@tmpa "3005=\XeTeXcharclassID % 々 IDEOGRAPHIC ITERATION MARK +\@tmpa "301C=\XeTeXcharclassID % 〜 WAVE DASH +\@tmpa "303B=\XeTeXcharclassID % 〻 VERTICAL IDEOGRAPHIC ITERATION MARK +\@tmpa "303C=\XeTeXcharclassID % 〼 MASU MARK +\@tmpa "309B=\XeTeXcharclassID % ゛ KATAKANA-HIRAGANA VOICED SOUND MARK +\@tmpa "309C=\XeTeXcharclassID % ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK +\@tmpa "309D=\XeTeXcharclassID % ゝ HIRAGANA ITERATION MARK +\@tmpa "309E=\XeTeXcharclassID % ゞ HIRAGANA VOICED ITERATION MARK +\@tmpa "30A0=\XeTeXcharclassID % ゠ KATAKANA-HIRAGANA DOUBLE HYPHEN +\@tmpa "30FD=\XeTeXcharclassID % ヽ KATAKANA ITERATION MARK +\@tmpa "30FE=\XeTeXcharclassID % ヾ KATAKANA VOICED ITERATION MARK +\@tmpa "A015=\XeTeXcharclassID % ꀕ YI SYLLABLE ITERATION MARK +\@tmpa "FF9E=\XeTeXcharclassID % ゙ HALFWIDTH KATAKANA VOICED SOUND MARK +\@tmpa "FF9F=\XeTeXcharclassID % ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK +% IS +\@tmpa "FE13=\XeTeXcharclassID % ︓ PRESENTATION FORM FOR VERTICAL COLON +\@tmpa "FE14=\XeTeXcharclassID % ︔ PRESENTATION FORM FOR VERTICAL SEMICOLON +% CJ +\@tmpa "3041=\XeTeXcharclassID +\@tmpa "3043=\XeTeXcharclassID +\@tmpa "3045=\XeTeXcharclassID +\@tmpa "3047=\XeTeXcharclassID +\@tmpa "3049=\XeTeXcharclassID +\@tmpa "3063=\XeTeXcharclassID +\@tmpa "3083=\XeTeXcharclassID +\@tmpa "3085=\XeTeXcharclassID +\@tmpa "3087=\XeTeXcharclassID +\@tmpa "308E=\XeTeXcharclassID +\@tmpa "3095=\XeTeXcharclassID +\@tmpa "3096=\XeTeXcharclassID +\@tmpa "30A1=\XeTeXcharclassID +\@tmpa "30A3=\XeTeXcharclassID +\@tmpa "30A5=\XeTeXcharclassID +\@tmpa "30A7=\XeTeXcharclassID +\@tmpa "30A9=\XeTeXcharclassID +\@tmpa "30C3=\XeTeXcharclassID +\@tmpa "30E3=\XeTeXcharclassID +\@tmpa "30E5=\XeTeXcharclassID +\@tmpa "30E7=\XeTeXcharclassID +\@tmpa "30EE=\XeTeXcharclassID +\@tmpa "30F5=\XeTeXcharclassID +\@tmpa "30F6=\XeTeXcharclassID +\@tmpa "30FC=\XeTeXcharclassID +\count@"31F0 \loop + \expandafter\@tmpa\the\count@=\XeTeXcharclassID + \ifnum\count@<"31FF + \advance\count@\@ne + \repeat +\count@"FF67 \loop + \expandafter\@tmpa\the\count@=\XeTeXcharclassID + \ifnum\count@<"FF70 + \advance\count@\@ne + \repeat +% +\@tmpa "28=\XPGKOcharclassAO % ( +\@tmpa "5B=\XPGKOcharclassAO % [ +\@tmpa "60=\XPGKOcharclassAO % ` +\@tmpa "7B=\XPGKOcharclassAO % { +% +\@tmpa "21=\XPGKOcharclassAC % ! +\@tmpa "27=\XPGKOcharclassAC % ' +\@tmpa "29=\XPGKOcharclassAC % ) +\@tmpa "2C=\XPGKOcharclassAC % , +\@tmpa "2E=\XPGKOcharclassAC % . +\@tmpa "3B=\XPGKOcharclassAC % ; +\@tmpa "3F=\XPGKOcharclassAC % ? +\@tmpa "5D=\XPGKOcharclassAC % ] +\@tmpa "7D=\XPGKOcharclassAC % } +% +\@tmpa "2018=\XeTeXcharclassOP % ‘ LEFT SINGLE QUOTATION MARK +\@tmpa "201C=\XeTeXcharclassOP % “ LEFT DOUBLE QUOTATION MARK +% +\@tmpa "2019=\XeTeXcharclassCL % ’ RIGHT SINGLE QUOTATION MARK +\@tmpa "201D=\XeTeXcharclassCL % ” RIGHT DOUBLE QUOTATION MARK +\@tmpa "FE10=\XeTeXcharclassCL % ︐ PRESENTATION FORM FOR VERTICAL COMMA +% NS +\@tmpa "00B7=\XPGKOcharclassMD % · MIDDLE DOT +\@tmpa "30FB=\XPGKOcharclassMD % ・ KATAKANA MIDDLE DOT +\@tmpa "FE54=\XPGKOcharclassMD % ﹔ SMALL SEMICOLON +\@tmpa "FE55=\XPGKOcharclassMD % ﹕ SMALL COLON +\@tmpa "FF1A=\XPGKOcharclassMD % : FULLWIDTH COLON +\@tmpa "FF1B=\XPGKOcharclassMD % ; FULLWIDTH SEMICOLON +\@tmpa "FF65=\XPGKOcharclassMD % ・ HALFWIDTH KATAKANA MIDDLE DOT +% +\@tmpa "3002=\XPGKOcharclassFS % 。 IDEOGRAPHIC FULL STOP +\@tmpa "FE12=\XPGKOcharclassFS % ︒ PRESENTATION FORM FOR VERTICAL IDEOGRAPHIC FULL STOP +\@tmpa "FE52=\XPGKOcharclassFS % ﹒ SMALL FULL STOP +\@tmpa "FF0E=\XPGKOcharclassFS % . FULLWIDTH FULL STOP +\@tmpa "FF61=\XPGKOcharclassFS % 。 HALFWIDTH IDEOGRAPHIC FULL STOP +% +\@tmpa "2014=\XPGKOcharclassLD % — EM DASH +\@tmpa "2015=\XPGKOcharclassLD % ― HORIZONTAL BAR +\@tmpa "2025=\XPGKOcharclassLD % ‥ TWO DOT LEADER +\@tmpa "2026=\XPGKOcharclassLD % … HORIZONTAL ELLIPSIS +% EX +\@tmpa "FE15=\XPGKOcharclassEX % ︕ PRESENTATION FORM FOR VERTICAL EXCLAMATION MARK +\@tmpa "FE16=\XPGKOcharclassEX % ︖ PRESENTATION FORM FOR VERTICAL QUESTION MARK +\@tmpa "FE56=\XPGKOcharclassEX % ﹖ SMALL QUESTION MARK +\@tmpa "FE57=\XPGKOcharclassEX % ﹗ SMALL EXCLAMATION MARK +\@tmpa "FF01=\XPGKOcharclassEX % ! FULLWIDTH EXCLAMATION MARK +\@tmpa "FF1F=\XPGKOcharclassEX % ? FULLWIDTH QUESTION MARK -% vim:tw=72:sw=4:ts=4:expandtab % \end{macrocode} % \iffalse %</gloss-korean.ldf> @@ -5067,7 +5451,7 @@ and may look very wrong.} % !TEX encoding = UTF-8 Unicode \ProvidesFile{gloss-latin.ldf}[polyglossia: module for latin] \PolyglossiaSetup{latin}{ -% hyphennames={latin}, +hyphennames={latin}, % hyphenmins={2,2}, frenchspacing=true, fontsetup=true, @@ -5129,7 +5513,7 @@ and may look very wrong.} % set modern as default \def\latin@variant{\l@latin}% -\ifluatex\xpg@set@language@luatex@ii{latin}\fi +\ifluatex\xpg@set@language@luatex@iv{latin}\fi \def\captionslatin{\modernlatincaptions}% \def\datelatin{\modernlatindate}% \def\classicuclccodes{\lccode`\V=`\u \uccode`\u=`\V} @@ -5142,28 +5526,28 @@ and may look very wrong.} \def\@tempa{#1}% \ifx\@tempa\tmp@medieval \def\latin@variant{\l@latin}% - \xpg@set@language@luatex@ii{latin} + \xpg@set@language@luatex@iv{latin} \def\captionslatin{\medievallatincaptions}% \def\datelatin{\classiclatindate}% \classicuclccodes \xpg@info{Option: Medieval Latin}% \else \ifx\@tempa\tmp@classic - \ifx\l@classiclatin\undefined + \xpg@ifdefined{classiclatin}{% + \def\latin@variant{\l@classiclatin}% + \xpg@set@language@luatex@iv{classiclatin}% + }{% \xpg@nopatterns{Classic Latin}% \adddialect\l@classiclatin\l@latin \def\latin@variant{\l@latin}% - \else - \def\latin@variant{\l@classiclatin}% - \xpg@set@language@luatex@ii{classiclatin}% - \fi + }% \def\captionslatin{\modernlatincaptions}% \def\datelatin{\classiclatindate}% \classicuclccodes \xpg@info{Option: Classic Latin}% \else \def\latin@variant{\l@latin}% - \xpg@set@language@luatex@ii{latin} + \xpg@set@language@luatex@iv{latin} \def\captionslatin{\modernlatincaptions}% \def\datelatin{\modernlatindate}% \xpg@info{Option: Modern Latin}% @@ -5630,9 +6014,9 @@ and may look very wrong.} \def\chaptername{प्रकरण}% \def\appendixname{परिशिष्ट}% \def\contentsname{अनुक्रमणिका}% - \def\listfigurename{आक्रुत्यांची यादी}% + \def\listfigurename{आकृत्यांची यादी}% \def\listtablename{कॊष्टकांची यादी}% - \def\indexname{सुची}% + \def\indexname{सूची}% \def\figurename{आक्रुती}% \def\tablename{कोष्टक}% %\def\thepart{}% TODO @@ -5643,8 +6027,8 @@ and may look very wrong.} \def\enclname{समाविष्ट}% \def\ccname{सि.सि.}% \def\headtoname{प्रति}% - \def\proofname{कसोटी}% - \def\glossaryname{स्पष्टीकरणकोश}% + \def\proofname{सिद्धता}% + \def\glossaryname{स्पष्टीकरणांची यादी}% } \def\datemarathi{% \def\marathimonth{% @@ -5654,11 +6038,11 @@ and may look very wrong.} मार्च\or एप्रिल\or मे\or - जुन\or - जुलॆ\or - ओगस्ट\or + जून\or + जुलै\or + ऑगस्ट\or सप्टेंबर\or - ओक्टोबर\or + ऑक्टोबर\or नोव्हेंबर\or डिसेंबर\fi }% @@ -5860,9 +6244,25 @@ and may look very wrong.} % % \subsection{gloss-occitan.ldf} % \begin{macrocode} -% Translated by Cédric Valmary <cvalmary@yahoo.fr> of Tot en òc <http://www.totenoc.org/> -\ProvidesFile{gloss-occitan.ldf}[polyglossia: module for occitan] - +%% +%% This is file `gloss-occitan.ldf', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% gloss-occitan.dtx (with options: `ldf') +%% ------------------------------------------------------------------ +%% The gloss-occitan module for polyglossia +%% Copyright (C) 2016 Cédric Valmary +%% All rights reserved +%% +%% Licence information appended +%% +%% Created by Cédric Valmary: cvalmary at yahoo dot fr +%% of Tot en òc <http://www.totenoc.eu/> +%% +\ProvidesFile{gloss-occitan.ldf}[2016/02/04 v0.3 polyglossia: + module for Occitan] \PolyglossiaSetup{occitan}{ hyphennames={occitan}, hyphenmins={2,2}, @@ -5870,12 +6270,64 @@ and may look very wrong.} indentfirst=true, fontsetup=true, } +\define@boolkey{occitan}[occitan@]{babelshorthands}[true]{} +\ifsystem@babelshorthands + \setkeys{occitan}{babelshorthands=true} +\else + \setkeys{occitan}{babelshorthands=false} +\fi +\ifcsundef{initiate@active@char}{% +\input{babelsh.def}% +\initiate@active@char{"}% +}{} +\def\occitan@shorthands{% + \bbl@activate{"}% + \def\language@group{occitan}% + \declare@shorthand{occitan}{"}{% + \relax\ifmmode + \def\xpgoc@next{''}% + \else + \def\xpgoc@next{\futurelet\xpgoc@temp\xpgoc@cwm}% + \fi + \xpgoc@next}% +} +\def\xpgoc@@cwm{\nobreak\discretionary{-}{}{}\nobreak\hskip\z@skip} +\def\xpgoc@ponchinterior{% + \nobreak\discretionary{-}{}{\mbox{$\cdot$}}\nobreak\hskip\z@skip} +\def\xpgoc@cwm{\let\xpgoc@@next\relax + \ifcat\noexpand\xpgoc@temp a% + \def\xpgoc@@next{\xpgoc@@cwm}% + \else + \if\noexpand\xpgoc@temp \string|% + \def\xpgoc@@next##1{\xpgoc@@cwm}% + \else + \if\noexpand\xpgoc@temp \string<% + \def\xpgoc@@next##1{«\ignorespaces}% + \else + \if\noexpand\xpgoc@temp \string>% + \def\xpgoc@@next##1{\unskip»}% + \else + \if\noexpand\xpgoc@temp\string/% + \def\xpgoc@@next##1{\slash}% + \else + \if\noexpand\xpgoc@temp\string.% + \def\xpgoc@@next##1{\xpgoc@ponchinterior}% + \fi + \fi + \fi + \fi + \fi + \fi + \xpgoc@@next} +\def\nooccitan@shorthands{% + \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}% +} \def\captionsoccitan{% \def\refname{Referéncias}% \def\abstractname{Resumit}% \def\bibname{Bibliografia}% - \def\prefacename{Prefàcia}% + \def\prefacename{Prefaci}% \def\chaptername{Capítol}% \def\appendixname{Annèx}% \def\contentsname{Ensenhador}% @@ -5914,9 +6366,41 @@ and may look very wrong.} 1èr\else% primièr \number\day\fi% all other numbers }% - \def\today{\occitanday \occitanmonth\space de~\number\year}% + \def\today{\occitanday\space \occitanmonth\space de~\number\year}% +} +\let\xpgoc@savedvalues\empty +\AtEndPreamble{% the user or the class might define different values + \edef\xpgoc@savedvalues{% + \clubpenalty=\the\clubpenalty\space + \@clubpenalty=\the\@clubpenalty\space + \widowpenalty=\the\widowpenalty\space + \finalhyphendemerits=\the\finalhyphendemerits} +} +\def\noextras@occitan{% + \lccode\string"2019=\z@ + \nooccitan@shorthands + \xpgoc@savedvalues +} +\def\blockextras@occitan{% + \lccode\string"2019=\string"2019 + \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000 + \finalhyphendemerits=50000000 + \ifoccitan@babelshorthands\occitan@shorthands\fi } +\def\inlineextras@occitan{% + \lccode\string"2019=\string"2019 + \ifoccitan@babelshorthands\occitan@shorthands\fi +} +%% Distributable under the LaTeX Project Public License, +%% version 1.3c or higher (your choice). The latest version of +%% this license is at: http://www.latex-project.org/lppl.txt +%% +%% This work is "author-maintained" +%% The maintainer is Cédric Valmary +%% +%% +%% End of file `gloss-occitan.ldf'. % \end{macrocode} % \iffalse %</gloss-occitan.ldf> @@ -8253,6 +8737,20 @@ and may look very wrong.} \def\glossaryname{Rhestr termau}% } +\newif\ifwelsh@first +\def\welsh@article#1{\welsh@firsttrue y\expandafter\welsh@article@do#1} +\def\welsh@article@do#1{\ifwelsh@first\welsh@isvowel#1\ifwelsh@vowel r\space\welsh@vowelfalse\else\space\fi#1\welsh@firstfalse\fi} +\newif\ifwelsh@vowel +\def\welsh@isvowel#1{\show#1\ifx#1a\welsh@voweltrue\else\ifx#1u\welsh@voweltrue\else\ifx#1w\welsh@voweltrue\fi\fi\fi}% FIXME Add the other vowels, just for good measure + +\def\welsh@ordinal@long#1{% + \ifcase#1\or cyntaf\or ail\or trydydd\or pedwerydd\or + pumed\or chweched\or seithfed\or wythfed\or nawfed\or degfed\or unfed ar ddeg\or deuddegfed\or trydydd ar ddeg\or pedwerydd ar ddeg\or pymthegfed\or unfed ar bymtheg\or ail ar bymtheg\or deunawfed\or pedwerydd ar bymtheg\or ugeinfed\else\expandafter\welsh@ordinalplusxx@long#1\fi} + +\def\welsh@ordinalplusxx@long#1{% + \let\dday=#1\advance\dday by -20\relax\welsh@ordinal@long\dday\space ar hugain% +} + \def\datewelsh{% \def\today{\ifwelsh@formaldate\formaltoday\else\standardtoday\fi} \def\standardtoday{% @@ -8266,8 +8764,7 @@ and may look very wrong.} \space\number\year}% \def\formaltoday{% - \space\ifcase\day\or y\space cyntaf\or yr\space ail\or y\space trydydd\or y\space pedwerydd\or - y\space pumed\or y\space chweched\or y\space seithfed\or yr\space wythfed\or y\space nawfed\or y\space degfed\or yr\space unfed ar ddeg\or y\space deuddegfed\or y\space trydydd ar ddeg\or y\space pedwerydd ar ddeg\or y\space pymthegfed\or yr\space unfed ar bymtheg\or yr\space ail ar bymtheg\or y\space deunawfed\or y\space pedwerydd ar bymtheg\or yr\space ugeinfed\or yr\space unfed ar hugain\or yr\space ail ar hugain\or y\space trydydd ar hugain\or y\space pedwerydd ar hugain\or y\space pumed ar hugain\or y\space chweched ar hugain\or y\space seithfed ar hugain\or yr\space wythfed ar hugain\or y\space nawfed ar hugain\or y\space degfed ar hugain\or yr\space unfed ar ddeg ar hugain\fi\space o\space\ifcase\month\or Ionawr\or Chwefror\or Fawrth\or Ebrill\or Fai\or Fehefin\or Orffenaf\or Awst\or Fedi\or Hydref\or Dachwedd\or Ragfyr\fi + \expandafter\welsh@article\welsh@ordinal@long\day\space o\space\ifcase\month\or Ionawr\or Chwefror\or Fawrth\or Ebrill\or Fai\or Fehefin\or Orffenaf\or Awst\or Fedi\or Hydref\or Dachwedd\or Ragfyr\fi \space\number\year}% } @@ -8526,7 +9023,7 @@ local mappings = { [byte('⁈')] = {left, thinspace}, [byte('⁉')] = {left, thinspace}, [byte('»')] = {left, thinspace}, - [byte('>')] = {left, thinspace}, + [byte('›')] = {left, thinspace}, [byte('«')] = {right, thinspace}, [byte('‹')] = {right, thinspace}, } @@ -8761,6 +9258,19 @@ local current_language local last_language local default_language +polyglossia.newloader_loaded_languages = { } +polyglossia.newloader_max_langid = 0 +local newloader_available_languages = dofile(kpse.find_file('language.dat.lua')) +-- Suggestion by Dohyun Kim on #129 +local t = { } +for k, v in pairs(newloader_available_languages) do + t[k] = v + for _, vv in pairs(v.synonyms) do + t[vv] = v + end +end +newloader_available_languages = t + local function loadlang(lang, id) if luatexhyphen.lookupname(lang) then luatexhyphen.loadlanguage(lang, id) @@ -8824,6 +9334,55 @@ local function load_tibt_eol() require('polyglossia-tibt') end +-- New hyphenation pattern loader: use language.dat.lua directly and the language identifiers +local function newloader(langentry) + loaded_language = polyglossia.newloader_loaded_languages[langentry] + if loaded_language then + texio.write_nl('term and log', 'Language ' .. langentry .. ' already loaded; id is ' .. lang.id(loaded_language)) + -- texio.write_nl('term and log', 'Language ' .. langentry .. ' already loaded with patterns ' .. tostring(loaded_language) .. '; id is ' .. lang.id(loaded_language)) + -- texio.write_nl('term and log', 'Language ' .. langentry .. ' already loaded with patterns ' .. loaded_language['patterns'] .. '; id is ' .. lang.id(loaded_language)) + return lang.id(loaded_language) + else + langdata = newloader_available_languages[langentry] + if langdata and langdata['special'] == 'language0' then return 0 end + + if langdata then + print("Language data for " .. langentry) + for k, v in pairs(langdata) do + print(k, tostring(v)) + end + polyglossia.newloader_max_langid = polyglossia.newloader_max_langid + 1 + -- langobject = lang.new(newloader_max_langid) + lang.new(); lang.new(); lang.new() + langobject = lang.new() + texio.write_nl('term and log', langdata.patterns) + if langdata.patterns and langdata.patterns ~= '' then + pattfilepath = kpse.find_file(langdata.patterns) + if pattfilepath then + pattfile = io.open(pattfilepath) + lang.patterns(langobject, pattfile:read('*all')) + pattfile:close() + end + end + if langdata.hyphenation and langdata.hyphenation ~= '' then + hyphfilepath = kpse.find_file(langdata.hyphenation) + if hyphfilepath then + hyphfile = io.open(hyphfilepath) + lang.hyphenation(langobject, hyphfile:read('*all')) + hyphfile:close() + end + end + polyglossia.newloader_loaded_languages[langentry] = langobject + + texio.write_nl('term and log', 'Language ' .. langentry .. ' was not yet loaded; created with id ' .. lang.id(langobject)) + return lang.id(langobject) + else + texio.write_nl('term and log', 'Language ' .. langentry .. ' not found in language.dat.lua') + return 255 + end + end +end + polyglossia.loadlang = loadlang polyglossia.select_language = select_language polyglossia.set_default_language = set_default_language @@ -8834,6 +9393,7 @@ polyglossia.load_frpt = load_frpt polyglossia.load_tibt_eol = load_tibt_eol polyglossia.disable_hyphenation = disable_hyphenation polyglossia.enable_hyphenation = enable_hyphenation +polyglossia.newloader = newloader % \end{macrocode} % \iffalse %</polyglossia.lua> @@ -8847,7 +9407,7 @@ polyglossia.enable_hyphenation = enable_hyphenation ¦----------------------------------------------¦ ¦ ¦ - ¦ THE POLYGLOSSIA PACKAGE v1.42.0 ¦ + ¦ THE POLYGLOSSIA PACKAGE v1.42.4 ¦ ¦ ¦ ¦ Modern multilingual typesetting ¦ ¦ with XeLaTeX and LuaLaTeX ¦ @@ -8878,7 +9438,7 @@ Polyglossia makes it possible to automate the following tasks: LICENSE -Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2015 Arthur Reutenauer +Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2016 Arthur Reutenauer Polyglossia is placed under the terms of the LaTeX Project Public Licence (LPPL), either version 1.3, or, at your option, any later version. See @@ -8895,7 +9455,34 @@ Hum, sorry, wishful thinking. Please report any bugs, problems or requests on: http://github.com/reutenauer/polyglossia/issues %</../README> %<*Changelog> -06-08-2015 +1.42.4 (February, March 2016) + * Remedial actions for the Babel changes + +09-02-2016 + * Fixed side effect of pull request #122 (see commit d2a34ff) + * Added automatic Josa selection, variant, and captions options to Korean, by Dohyun Kim (pull request #128) + +08-02-2016 + * Updated gloss-occitan from CTAN + +18-01-2016 + * Fixed issue #124 (minor typo in polyglossia-frpt.lua) + +03-12-2015 + * Merged pull request #117 for more French guillemet spacing + * Merged pull request #121 to add \bbl@loaded; fixes issue #120 + * Merged pull request #122 that build on #121 + +08-11-2015 + * Merged pull request #116 for French (spacing around guillemets) + +22-10-2015 + * Fixed issue #115 (spurious spaces in Arabic) + +19-08-2015 + * Fixed issue #107 for Marathi (labels and month names) + +1.42.0 (06-08-2015) * Add Bengali digits package, and option to reset all numbering functions 05-08-2015 diff --git a/Master/texmf-dist/tex/latex/polyglossia/bengalidigits.sty b/Master/texmf-dist/tex/latex/polyglossia/bengalidigits.sty index 5e0603b37fb..e7642aea138 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/bengalidigits.sty +++ b/Master/texmf-dist/tex/latex/polyglossia/bengalidigits.sty @@ -1,12 +1,12 @@ \ProvidesPackage{bengalidigits} - [2015/05/25 v.01% + [2015/08/07 v.02% Formatting of Bengali digits] \def\bengalidigits#1{\expandafter\@bengali@digits #1@} \def\@bengali@digits#1{% \ifx @#1% terminate \else - \ifx0#1০\else\ifx1#1১\else\ifx2#1২\else\ifx3#1৩\else\ifx4#1৪\else\ifx5#1৫\else\ifx6#1৬\else\ifx7#1৭\else\ifx8#1৮\else\ifx9#1৯\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \ifcase#1০\or১\or২\or৩\or৪\or৫\or৬\or৭\or৮\or৯\fi \expandafter\@bengali@digits \fi } diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf index 441b2f2dd28..72eff1260bb 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf @@ -99,12 +99,12 @@ and may look very wrong.} \def\captionsarabic{% \def\prefacename{\@ensure@RTL{مدخل}}% - \def\refname{\@ensure@RTL{المراجع}} + \def\refname{\@ensure@RTL{المراجع}}% \def\abstractname{\@ensure@RTL{ملخص}}% \def\bibname{\@ensure@RTL{المصادر}}% \def\chaptername{\@ensure@RTL{باب}}% \def\appendixname{\@ensure@RTL{الملاحق}}% - \def\contentsname{\@ensure@RTL{المحتويات}} + \def\contentsname{\@ensure@RTL{المحتويات}}% %\def\contentsname{\@ensure@RTL{الفهرس}}% \def\listfigurename{\@ensure@RTL{قائمة الأشكال}}% \def\listtablename{\@ensure@RTL{قائمة الجداول}}% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf index 9902892aad5..291afeb01cf 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf @@ -17,7 +17,7 @@ \define@key{english}{variant}{% %needs to be reset for loop over hyphennames below: \def\do##1{% - \ifcsdef{l@#1}% + \xpg@ifdefined{#1}% {\csletcs{l@english}{l@#1}\listbreak}% {}% }% @@ -37,10 +37,10 @@ {\@british@hyphenfalse\english@ordinalmonthdayfalse \ifluatex\else\setkeys[xpg@setup]{english}{hyphennames={usenglishmax}}\fi \xpg@info{Option: english variant=american (with additional patterns)}% - \ifcsundef{l@usenglishmax}% + \xpg@ifdefined{usenglishmax}{}% {\xpg@warning{No hyphenation patterns were loaded for "US English Max"\MessageBreak I will use the standard patterns for US English instead}% - \adddialect\l@usenglishmax\l@english\relax}{}% + \adddialect\l@usenglishmax\l@english\relax}% \gdef\english@language{\language=\l@usenglishmax}}% {\ifstrequal{#1}{australian}% {\@british@hyphentrue\english@ordinalmonthdayfalse @@ -53,10 +53,10 @@ \if@british@locale\@british@hyphentrue\english@ordinalmonthdaytrue\fi \if@british@hyphen \ifluatex\else\setkeys[xpg@setup]{english}{hyphennames={ukenglish,british,UKenglish}}\fi - \ifcsundef{l@ukenglish}% + \xpg@ifdefined{ukenglish}{}% {\xpg@warning{No hyphenation patterns were loaded for British English\MessageBreak I will use the patterns for US English instead}% - \adddialect\l@ukenglish\l@english\relax}{}% + \adddialect\l@ukenglish\l@english\relax}% \gdef\english@language{\language=\l@ukenglish\xpg@set@language@luatex@ii{ukenglish}}% \fi % and we reset \do to its previous definition here: diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf index 3de602cf241..3dbdd18414c 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf @@ -49,8 +49,8 @@ % \XeTeXinterchartoks \z@ \french@punctguillstart = {\nobreakspace}% "a«" unchanged? % \XeTeXinterchartoks \french@punctguillend \z@ = {\nobreakspace}% "»a" unchanged? \XeTeXinterchartoks \z@ \french@punctguillend = {\nobreakspace}% "a»" -> "a »" - \XeTeXinterchartoks \french@punctguillstart 255 = {\nobreakspace\xpg@nospace}% "« " -> "«~" - \XeTeXinterchartoks 255 \french@punctguillend = {\xpg@unskip\nobreakspace}% " »" -> "~»" + % \XeTeXinterchartoks \french@punctguillstart 255 = {\nobreakspace\xpg@nospace}% "« " -> "«~" + % \XeTeXinterchartoks 255 \french@punctguillend = {\xpg@unskip\nobreakspace}% " »" -> "~»" \XeTeXinterchartoks \french@punctguillend \french@punctthin = {\nobreak\thinspace}% "»;" -> "» ;" \XeTeXinterchartoks \french@punctguillend \french@punctthick = {\nobreakspace}% "»:" -> "» :" \XeTeXinterchartoks \french@punctthin \french@punctguillend = {\nobreakspace}% "?»" -> "? »" @@ -136,4 +136,26 @@ \french@punctuation% } +\def\ier{\textsuperscript{er}} +\def\iers{\textsuperscript{ers}} +\def\iere{\textsuperscript{re}} +\def\ieres{\textsuperscript{res}} +\def\ieme{\textsuperscript{e}} +\def\iemes{\textsuperscript{es}} +\def\nd{\textsuperscript{nd}} +\def\nds{\textsuperscript{nds}} +\def\nde{\textsuperscript{nde}} +\def\ndes{\textsuperscript{ndes}} +\def\no{\textsuperscript{o}} +\def\nos{\textsuperscript{os}} + +\def\mme{M\textsuperscript{me}\space} +\def\mmes{M\textsuperscript{mes}\space} +\def\mr{M.\space} +\def\mrs{MM.\space} + +\ifx\@makefntext\undefined\else +\renewcommand\@makefntext[1]{\quad\ifx\@thefnmark\empty\else\@thefnmark.\space\fi #1} +\fi + \endinput diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf index a72983d5fd7..edc3cb21cf6 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf @@ -13,23 +13,23 @@ \def\@tmpa{#1}% \ifx\@tmpa\tmp@oldyr\def\@tmpa{old}\fi \ifx\@tmpa\tmp@old - \ifx\l@german\@undefined + \xpg@ifdefined{german}{}{% \xpg@nopatterns{german}% \adddialect\l@german\l@nohyphenation - \fi + } \@german@oldspellingtrue - \else %try ngerman - \ifx\l@ngerman\@undefined - \ifx\l@german\@undefined - \xpg@nopatterns{ngerman}% - \adddialect\l@ngerman\l@nohyphenation - \else + \else % try ngerman + \xpg@ifdefined{ngerman}{% + \@german@oldspellingfalse + }{% fall back to german + \xpg@ifdefined{german}{% \xpg@warning{You asked for `ngerman' but only `german' hyphenation is available!}% \@german@oldspellingtrue - \fi - \else %we use ngerman - \@german@oldspellingfalse - \fi + }{% + \xpg@nopatterns{ngerman}% + \adddialect\l@ngerman\l@nohyphenation + }% + }% \fi } @@ -45,10 +45,10 @@ \@austrian@localefalse% \fi \ifx\@tmpa\tmp@swiss\@swiss@localetrue - \ifcsundef{l@swissgerman}% + \xpg@ifdefined{swissgerman}{}% {\xpg@warning{No hyphenation patterns were loaded for "Swiss German (Old Spelling)"\MessageBreak I will use the standard patterns for German (old spelling) instead}% - \adddialect\l@swissgerman\l@german\relax}{}% + \adddialect\l@swissgerman\l@german\relax}% \else \@swiss@localefalse% \fi} @@ -188,7 +188,7 @@ \if@german@fraktur\date@german@fraktur\else\date@german\fi } -\def\german@language{\language=% +\def\german@language{\ifxetex\language=% \csname l@% \if@swiss@locale \if@german@oldspelling @@ -202,29 +202,29 @@ \else% (german, austrian) \if@german@oldspelling\else n\fi german\ifgerman@latesthyphen -x-latest\fi \fi - \endcsname + \endcsname\else\ifluatex % LuaTeX \ifgerman@latesthyphen \if@german@oldspelling \if@swiss@locale - \xpg@set@language@luatex@ii{swissgerman}% + \xpg@set@language@luatex@iv{swissgerman}% \else - \xpg@set@language@luatex@ii{german-x-latest}% + \xpg@set@language@luatex@iv{german-x-latest}% \fi \else - \xpg@set@language@luatex@ii{ngerman-x-latest}% + \xpg@set@language@luatex@iv{ngerman-x-latest}% \fi \else% (latesthyphen=false) \if@german@oldspelling \if@swiss@locale - \xpg@set@language@luatex@ii{swissgerman}% + \xpg@set@language@luatex@iv{swissgerman}% \else - \xpg@set@language@luatex@ii{german}% + \xpg@set@language@luatex@iv{german}% \fi \else - \xpg@set@language@luatex@ii{ngerman}% + \xpg@set@language@luatex@iv{ngerman}% \fi - \fi + \fi\fi\fi } \def\noextras@german{% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf index 8f28d8bd2cf..6efc21a154c 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf @@ -5,13 +5,33 @@ scripttag=hang, language=Korean, langtag=KOR, - hyphennames={english,american,usenglish,USenglish}, + hyphennames={english,USenglish}, hyphenmins={2,3}, frenchspacing=true, fontsetup=true } +% variant : plain (0), classic (1), or modern (2) +\define@choicekey{korean}{variant}[\val\nr]{plain,classic,modern}[plain]{% + \let\xpg@korean@variant\nr +} +% captions : hangul (0) or hanja (1) +\define@choicekey{korean}{captions}[\val\nr]{hangul,hanja}[hangul]{% + \let\xpg@korean@captions\nr +} +\setkeys{korean}{variant,captions} + \def\captionskorean{% + \ifcase\xpg@korean@captions\relax + \captions@korean@hangul + \else + \captions@korean@hanja + \fi + \def\seename{$rightarrow$}% + \def\alsoname{$Rightarrow$}% +} +\def\captions@korean@hangul{% + \def\koreanTHEname{제}% \def\partname##1##2{제##1##2 편}% \def\chaptername{장}% \def\refname{참고문헌}% @@ -26,24 +46,39 @@ \def\figurename{그림}% \def\tablename{표}% \def\pagename{페이지}% - \def\seename{$rightarrow$}% - \def\alsoname{$Rightarrow$}% \def\enclname{동봉}% \def\proofname{증명}% \def\headtoname{수신:}% \def\ccname{사본}% } -\def\xpg@korean@language{korean} -\AtBeginDocument{ - \ifx\xpg@main@language\xpg@korean@language - \@ifclassloaded{book}{\def\@chapapp#1#2{제#1#2#1\chaptername}}{ - \@ifclassloaded{report}{\def\@chapapp#1#2{제#1#2#1\chaptername}}{} - } - \fi +\def\captions@korean@hanja{% + \def\koreanTHEname{第}% + \def\partname##1##2{第##1##2 篇}% + \def\chaptername{章}% + \def\refname{參考文獻}% + \def\abstractname{要約}% + \def\bibname{參考文獻}% + \def\prefacename{序文}% + \def\appendixname{附錄}% + \def\contentsname{目次}% + \def\listfigurename{圖版 目次}% + \def\listtablename{表 目次}% + \def\indexname{索引}% + \def\figurename{圖版}% + \def\tablename{表}% + \def\pagename{面}% + \def\enclname{同封}% + \def\proofname{證明}% + \def\headtoname{受信:}% + \def\ccname{寫本}% } \def\datekorean{% - \def\today{\the\year 년 \the\month 월 \the\day 일}% + \ifcase\xpg@korean@captions\relax + \def\today{\the\year 년 \the\month 월 \the\day 일}% + \else + \def\today{\the\year 年 \the\month 月 \the\day 日}% + \fi } \def\koreanAlph#1{\expandafter\@koreanAlph\csname c@#1\endcsname} @@ -70,42 +105,538 @@ } \let\nokorean@globalnumbers\nokorean@numbers -\ifluatex -\newluatexattribute\xpg@attr@korean +\ifxetex + \def\inlineextras@korean{% + \ifcase\xpg@korean@variant\relax + \XeTeXinterchartokenstate\z@ + \XeTeXlinebreakpenalty 50 + \or + \setvariantkoreaninterchartoks + \setvariantkoreancharclasses + \def\XPGKOhalfdim{\dimexpr.5em\relax}% + \XeTeXinterchartokenstate\@ne + \XeTeXlinebreakpenalty \z@ + \else + \setvariantkoreaninterchartoks + \setvariantkoreancharclasses + \def\XPGKOhalfdim{\dimexpr.5\fontdimen\tw@\font\relax}% + \XeTeXinterchartokenstate\@ne + \XeTeXlinebreakpenalty 50 + \fi + \XeTeXlinebreakskip 0pt plus.1em minus .01em + \XeTeXlinebreaklocale "ko" + } + \def\noextras@korean{% + \ifcase\xpg@korean@variant\relax + \else + \unsetvariantkoreaninterchartoks + \unsetvariantkoreancharclasses + \fi + \XeTeXinterchartokenstate\z@ + \XeTeXlinebreakpenalty\z@ + \XeTeXlinebreakskip\z@skip + \XeTeXlinebreaklocale "" + \noextras@korean@common + } +\else % luatex + \def\inlineextras@korean{\xpg@attr@korean\xpg@korean@variant\relax} + \def\noextras@korean{% + \unsetattribute\xpg@attr@korean + \noextras@korean@common + } +\fi + +\def\blockextras@korean{% + \inlineextras@korean + \ifdefined\@chapapp + \long\def\@tmpa{\chaptername}\def\@tmpb{\chaptername}% + \ifnum0\ifx\@chapapp\@tmpa1\else\ifx\@chapapp\@tmpb1\fi\fi>\z@ + \let\xpg@orig@@chapapp\@chapapp + \def\@chapapp##1##2{\koreanTHEname ##1##2##1\chaptername}% + \fi + \fi + \ifdefined\baselinestretch + \let\xpg@orig@linestretch\baselinestretch + \def\baselinestretch{1.3888}\selectfont + \fi + \ifdefined\footnotesep + \edef\xpg@orig@footnotesep{\noexpand\footnotesep=\the\footnotesep\relax}% + \footnotesep=1.3888\footnotesep + \fi +} + +\def\noextras@korean@common{% + \ifdefined\xpg@orig@footnotesep \xpg@orig@footnotesep \fi + \ifdefined\xpg@orig@linestretch \let\baselinestretch\xpg@orig@linestretch \fi + \ifdefined\xpg@orig@@chapapp \let\@chapapp\xpg@orig@@chapapp \fi +} + +\ifxetex % XeTeX +% user commands for Josa +% Josa : particles in Korean grammar that immediately follow a noun or pronoun. +% Josa might vary depending on previous character. +\protected\def\jong {\global\let\XPGKO@let@josa=0}\jong +\protected\def\rieul{\global\let\XPGKO@let@josa=1} +\protected\def\jung {\global\let\XPGKO@let@josa=2} +\protected\def\가{\xpg@make@josa 가이} +\protected\def\이{\futurelet\@let@token\xpg@make@josa@I} +\protected\def\은{\xpg@make@josa 는은} \let\는\은 +\protected\def\을{\xpg@make@josa 를을} \let\를\을 +\protected\def\와{\xpg@make@josa 와과} \let\과\와 +\protected\def\으{\xpg@make@josa \empty 으} +\protected\def\로{\으 로} +\protected\def\라{\xpg@make@josa 라{이라}} +\def\xpg@make@josa@I{% + \ifx\@let@token 라% + \expandafter\xpg@make@josa\expandafter\relax\expandafter 이% + \else + \expandafter\가 + \fi +} +\def\xpg@make@josa#1#2{% + \ifcat\xpg@catcode@letter\XPGKO@let@josa + \expandafter\expandafter\expandafter\count@\expandafter + \xpg@letter@to@num\meaning\XPGKO@let@josa\relax + \else\ifcat\xpg@catcode@other\XPGKO@let@josa + \expandafter\expandafter\expandafter\count@\expandafter + \xpg@character@to@num\meaning\XPGKO@let@josa\relax + \fi\fi + \ifnum\count@<"3260 + \else\ifnum\count@<"3280 \advance\count@-"60 + \else\ifnum\count@<"AC00 + \else\ifnum\count@<"D7A4 % Hangul syllables + \advance\count@-"AC00 + \@tempcnta\count@ \divide\@tempcnta28 \multiply\@tempcnta28 + \advance\count@-\@tempcnta \advance\count@"11A7 + \else\ifnum\count@<"FF00 + \else\ifnum\count@<"FF5B \advance\count@-"FEE0 + \fi\fi\fi\fi\fi \fi + \ifnum\count@<"11A8 + \ifnum "30=\count@ \count@\z@ % 0 + \else\ifnum "31=\count@ \count@\@ne % 1 + \else\ifnum "33=\count@ \count@\z@ % 3 + \else\ifnum "36=\count@ \count@\z@ % 6 + \else\ifnum "37=\count@ \count@\@ne % 7 + \else\ifnum "38=\count@ \count@\@ne % 8 + \else\ifnum "4C=\count@ \count@\@ne % L + \else\ifnum "4D=\count@ \count@\z@ % M + \else\ifnum "4E=\count@ \count@\z@ % N + \else\ifnum "6C=\count@ \count@\@ne % l + \else\ifnum "6D=\count@ \count@\z@ % m + \else\ifnum "6E=\count@ \count@\z@ % n + \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi + \else\ifnum\count@<"1200 + \ifnum\count@="11AF \count@\@ne \else \count@\z@ \fi + \else\ifnum\count@<"3131 + \else\ifnum\count@<"318F + \ifnum \count@="3139 \count@\@ne + \else\ifnum\count@<"314F \count@\z@ + \else\ifnum\count@>"3164 + \ifnum\count@<"3187 \count@\z@ \fi + \fi\fi\fi + \else\ifnum\count@<"3200 + \else\ifnum\count@<"321F + \ifnum \count@="3203 \count@\@ne + \else\ifnum\count@<"320E \count@\z@ + \fi\fi + \else\ifnum\count@<"D7CB + \else\ifnum\count@<"D7FC \count@\z@ + \fi\fi\fi\fi\fi \fi\fi\fi + \ifcase\count@ #2% jong + \or \ifx#1\empty\else#2\fi% rieul + \else #1% jung + \fi +} +\expandafter\def\expandafter\xpg@character@to@num\detokenize{the character} #1#2\relax{`#1\relax} +\expandafter\def\expandafter\xpg@letter@to@num\detokenize{the letter} #1#2\relax{`#1\relax} +\begingroup +\catcode`A=11 \catcode`0=12 +\global\let\xpg@catcode@letter=A \global\let\xpg@catcode@other=0 +\endgroup +% macros for interchartoks (Josa selection) +\def\XPGKOstartID{\global\futurelet\XPGKO@let@josa\XPGKO@skipID} +\def\XPGKOstartAA{\global\futurelet\XPGKO@let@josa\XPGKO@skipAA} +\def\XPGKO@skipID{\XeTeXinterchartoks\XeTeXcharclassBoundary\XeTeXcharclassID{\empty}} +\def\XPGKO@skipAA{\XeTeXinterchartoks\XeTeXcharclassBoundary\XPGKOcharclassAA{\empty}} +\def\XPGKOstopID {\XeTeXinterchartoks\XeTeXcharclassBoundary\XeTeXcharclassID{\XPGKOstartID}} +\def\XPGKOstopAA {\XeTeXinterchartoks\XeTeXcharclassBoundary\XPGKOcharclassAA{\XPGKOstartAA}} +% macros for interchartoks (CJK punctuations) +\def\XPGKOstartOP{\leavevmode\hbox to.5em\bgroup\hss}% +\def\XPGKOstopOP {\egroup}% +\def\XPGKOstartCL{\leavevmode\hbox to.5em\bgroup}% +\def\XPGKOstopCL {\hss\egroup}% +\let\XPGKOstartFS\XPGKOstartCL \let\XPGKOstopFS\XPGKOstopCL +\let\XPGKOstartMD\XPGKOstartOP \let\XPGKOstopMD\XPGKOstopCL +\let\XPGKOnobreak \nobreak +\def\XPGKOhalfzero {\hskip \XPGKOhalfdim \relax}% +\def\XPGKOhalfhalf {\hskip \XPGKOhalfdim minus \XPGKOhalfdim \relax}% +\def\XPGKOhalfquarter {\hskip \XPGKOhalfdim minus.5\XPGKOhalfdim \relax}% +\def\XPGKOquarterquarter {\hskip .5\XPGKOhalfdim minus.5\XPGKOhalfdim \relax}% +\def\XPGKOiiiquarterquarter{\hskip1.5\XPGKOhalfdim minus.5\XPGKOhalfdim \relax}% +\def\XPGKOlatincjk {\hskip .5\XPGKOhalfdim plus.25\XPGKOhalfdim minus.125\XPGKOhalfdim}% +% user macro to force zero skip +\let\inhibitglue\relax +% initialize interchartoks and classes +\let\XeTeXcharclassIgnore \@cclvi +\let\XeTeXcharclassBoundary\@cclv +\ifdefined\XeTeXcharclassID\else + \ifdefined\xtxHanGlue + \let\XeTeXcharclassID\@ne + \let\XeTeXcharclassOP\tw@ + \let\XeTeXcharclassCL\thr@@ + \else % email from JW + \newXeTeXintercharclass\XeTeXcharclassID + \newXeTeXintercharclass\XeTeXcharclassOP + \newXeTeXintercharclass\XeTeXcharclassCL + \global\let\XeTeXcharclassEX\XeTeXcharclassCL + \global\let\XeTeXcharclassIS\XeTeXcharclassCL + \global\let\XeTeXcharclassNS\XeTeXcharclassCL + \global\let\XeTeXcharclassCM\XeTeXcharclassIgnore + \input load-unicode-xetex-classes % + \fi +\fi +% assign Hangul +\count@="AC00 \loop + \XeTeXcharclass\count@\XeTeXcharclassID + \ifnum\count@<"D7A3 + \advance\count@\@ne + \repeat +\count@="1100 \loop + \XeTeXcharclass\count@\XeTeXcharclassID + \ifnum\count@<"11FF + \advance\count@\@ne + \repeat +\count@="A960 \loop + \XeTeXcharclass\count@\XeTeXcharclassID + \ifnum\count@<"A97C + \advance\count@\@ne + \repeat +\count@="D7B0 \loop + \XeTeXcharclass\count@\XeTeXcharclassID + \ifnum\count@<"D7FB + \advance\count@\@ne + \repeat +% more classes +\newXeTeXintercharclass\XPGKOcharclassMD % ・ : ; +\newXeTeXintercharclass\XPGKOcharclassFS % 。 . +\newXeTeXintercharclass\XPGKOcharclassLD % ― … ‥ +\newXeTeXintercharclass\XPGKOcharclassEX % ? ! +\newXeTeXintercharclass\XPGKOcharclassAO % ascii ( +\newXeTeXintercharclass\XPGKOcharclassAC % ascii ) +\newXeTeXintercharclass\XPGKOcharclassAA % ascii letters/numbers +% unset all interchartoks +\def\unsetvariantkoreaninterchartoks{% + \@tfor\@tmpa :=\XeTeXcharclassID\XeTeXcharclassOP\XeTeXcharclassCL\XPGKOcharclassMD\XPGKOcharclassFS + \XPGKOcharclassLD\XPGKOcharclassEX\XPGKOcharclassAO\XPGKOcharclassAC\XPGKOcharclassAA + \do{\count@\XeTeXcharclassBoundary \loop + \XeTeXinterchartoks\@tmpa\count@{}% + \XeTeXinterchartoks\count@\@tmpa{}% + \ifnum\count@=\XeTeXcharclassBoundary \count@\m@ne \fi + \ifnum\count@<\xe@alloc@intercharclass + \advance\count@\@ne + \repeat + }% +} +% interchartoks for classic/modern variants +\def\setvariantkoreaninterchartoks{% + \count@\XeTeXcharclassBoundary \loop + \ifnum\count@=\XeTeXcharclassID\else + \ifnum\count@=\XeTeXcharclassOP\else + \ifnum\count@=\XeTeXcharclassCL\else + \ifnum\count@=\XPGKOcharclassMD\else + \ifnum\count@=\XPGKOcharclassFS\else + \ifnum\count@=\XPGKOcharclassAA\else + \XeTeXinterchartoks\count@\XeTeXcharclassID{\XPGKOstartID}% + \XeTeXinterchartoks\count@\XeTeXcharclassOP{\XPGKOstartOP}% + \XeTeXinterchartoks\count@\XeTeXcharclassCL{\XPGKOstartCL}% + \XeTeXinterchartoks\count@\XPGKOcharclassMD{\XPGKOstartMD}% + \XeTeXinterchartoks\count@\XPGKOcharclassFS{\XPGKOstartFS}% + \XeTeXinterchartoks\count@\XPGKOcharclassAA{\XPGKOstartAA}% + \XeTeXinterchartoks\XeTeXcharclassID\count@{\XPGKOstopID}% + \XeTeXinterchartoks\XeTeXcharclassOP\count@{\XPGKOstopOP}% + \XeTeXinterchartoks\XeTeXcharclassCL\count@{\XPGKOstopCL}% + \XeTeXinterchartoks\XPGKOcharclassMD\count@{\XPGKOstopMD}% + \XeTeXinterchartoks\XPGKOcharclassFS\count@{\XPGKOstopFS}% + \XeTeXinterchartoks\XPGKOcharclassAA\count@{\XPGKOstopAA}% + \fi\fi\fi\fi\fi\fi + \ifnum\count@=\XeTeXcharclassBoundary \count@\m@ne \fi + \ifnum\count@<\xe@alloc@intercharclass + \advance\count@\@ne + \repeat + % + \XeTeXinterchartoks\XPGKOcharclassAA\XeTeXcharclassID{\XPGKOstartID}% + \XeTeXinterchartoks\XPGKOcharclassAA\XeTeXcharclassOP{\XPGKOstopAA\XPGKOstartOP}% + \XeTeXinterchartoks\XPGKOcharclassAA\XeTeXcharclassCL{\XPGKOstopAA\XPGKOstartCL}% + \XeTeXinterchartoks\XPGKOcharclassAA\XPGKOcharclassMD{\XPGKOstopAA\XPGKOstartMD}% + \XeTeXinterchartoks\XPGKOcharclassAA\XPGKOcharclassFS{\XPGKOstopAA\XPGKOstartFS}% + \XeTeXinterchartoks\XPGKOcharclassAA\XPGKOcharclassAA{\XPGKOstartAA}% + % + \XeTeXinterchartoks\XeTeXcharclassID\XeTeXcharclassID{\XPGKOstartID}% + \XeTeXinterchartoks\XeTeXcharclassID\XeTeXcharclassOP{\XPGKOstopID\XPGKOhalfhalf\XPGKOstartOP}% + \XeTeXinterchartoks\XeTeXcharclassID\XeTeXcharclassCL{\XPGKOstopID\XPGKOstartCL}% + \XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassMD{\XPGKOstopID\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% + \XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassFS{\XPGKOstopID\XPGKOstartFS}% + \XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassAO{\XPGKOstopID\XPGKOlatincjk}% + \XeTeXinterchartoks\XeTeXcharclassID\XPGKOcharclassAA{\XPGKOstartAA}% + % + \XeTeXinterchartoks\XeTeXcharclassOP\XeTeXcharclassID{\XPGKOstopOP\XPGKOstartID}% + \XeTeXinterchartoks\XeTeXcharclassOP\XeTeXcharclassOP{\XPGKOstopOP\XPGKOstartOP}% + \XeTeXinterchartoks\XeTeXcharclassOP\XeTeXcharclassCL{\XPGKOstopOP\XPGKOstartCL}% + \XeTeXinterchartoks\XeTeXcharclassOP\XPGKOcharclassMD{\XPGKOstopOP\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% + \XeTeXinterchartoks\XeTeXcharclassOP\XPGKOcharclassFS{\XPGKOstopOP\XPGKOstartFS}% + \XeTeXinterchartoks\XeTeXcharclassOP\XPGKOcharclassAA{\XPGKOstopOP\XPGKOstartAA}% + % + \XeTeXinterchartoks\XeTeXcharclassCL\XeTeXcharclassID{\XPGKOstopCL\XPGKOhalfhalf\XPGKOstartID}% + \XeTeXinterchartoks\XeTeXcharclassCL\XeTeXcharclassOP{\XPGKOstopCL\XPGKOhalfhalf\XPGKOstartOP}% + \XeTeXinterchartoks\XeTeXcharclassCL\XeTeXcharclassCL{\XPGKOstopCL\XPGKOstartCL}% + \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassMD{\XPGKOstopCL\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% + \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassFS{\XPGKOstopCL\XPGKOstartFS}% + \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassLD{\XPGKOstopCL\XPGKOnobreak\XPGKOhalfhalf}% + \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassEX{\XPGKOstopCL\XPGKOnobreak\XPGKOhalfhalf}% + \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassAO{\XPGKOstopCL\XPGKOhalfhalf}% + \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassAC{\XPGKOstopCL\XPGKOnobreak\XPGKOhalfhalf}% + \XeTeXinterchartoks\XeTeXcharclassCL\XPGKOcharclassAA{\XPGKOstopCL\XPGKOstartAA}% + % + \XeTeXinterchartoks\XPGKOcharclassMD\XeTeXcharclassID{\XPGKOstopMD\XPGKOquarterquarter\XPGKOstartID}% + \XeTeXinterchartoks\XPGKOcharclassMD\XeTeXcharclassOP{\XPGKOstopMD\XPGKOquarterquarter\XPGKOstartOP}% + \XeTeXinterchartoks\XPGKOcharclassMD\XeTeXcharclassCL{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartCL}% + \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassMD{\XPGKOstopMD\XPGKOnobreak\XPGKOhalfquarter\XPGKOstartMD}% + \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassFS{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartFS}% + \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassLD{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter}% + \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassEX{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter}% + \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassAO{\XPGKOstopMD\XPGKOquarterquarter}% + \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassAC{\XPGKOstopMD\XPGKOnobreak\XPGKOquarterquarter}% + \XeTeXinterchartoks\XPGKOcharclassMD\XPGKOcharclassAA{\XPGKOstopMD\XPGKOstartAA}% + % + \XeTeXinterchartoks\XPGKOcharclassFS\XeTeXcharclassID{\XPGKOstopFS\XPGKOhalfzero\XPGKOstartID}% + \XeTeXinterchartoks\XPGKOcharclassFS\XeTeXcharclassOP{\XPGKOstopFS\XPGKOhalfzero\XPGKOstartOP}% + \XeTeXinterchartoks\XPGKOcharclassFS\XeTeXcharclassCL{\XPGKOstopFS\XPGKOstartCL}% + \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassMD{\XPGKOstopFS\XPGKOnobreak\XPGKOiiiquarterquarter\XPGKOstartMD}% + \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassFS{\XPGKOstopFS\XPGKOstartFS}% + \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassLD{\XPGKOstopFS\XPGKOnobreak\XPGKOhalfzero}% + \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassEX{\XPGKOstopFS\XPGKOnobreak\XPGKOhalfzero}% + \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassAO{\XPGKOstopFS\XPGKOhalfzero}% + \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassAC{\XPGKOstopFS\XPGKOnobreak\XPGKOhalfzero}% + \XeTeXinterchartoks\XPGKOcharclassFS\XPGKOcharclassAA{\XPGKOstopFS\XPGKOstartAA}% + % + \XeTeXinterchartoks\XPGKOcharclassLD\XeTeXcharclassOP{\XPGKOhalfhalf\XPGKOstartOP}% + \XeTeXinterchartoks\XPGKOcharclassLD\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% + % + \XeTeXinterchartoks\XPGKOcharclassEX\XeTeXcharclassID{\XPGKOhalfhalf\XPGKOstartID}% + \XeTeXinterchartoks\XPGKOcharclassEX\XeTeXcharclassOP{\XPGKOhalfhalf\XPGKOstartOP}% + \XeTeXinterchartoks\XPGKOcharclassEX\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% + \XeTeXinterchartoks\XPGKOcharclassEX\XPGKOcharclassAO{\XPGKOhalfhalf}% + \XeTeXinterchartoks\XPGKOcharclassEX\XPGKOcharclassAC{\XPGKOnobreak\XPGKOhalfhalf}% + % + \XeTeXinterchartoks\XPGKOcharclassAO\XeTeXcharclassOP{\XPGKOnobreak\XPGKOhalfhalf\XPGKOstartOP}% + \XeTeXinterchartoks\XPGKOcharclassAO\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% + % + \XeTeXinterchartoks\XPGKOcharclassAC\XeTeXcharclassID{\XPGKOlatincjk\XPGKOstartID}% + \XeTeXinterchartoks\XPGKOcharclassAC\XeTeXcharclassOP{\XPGKOhalfhalf\XPGKOstartOP}% + \XeTeXinterchartoks\XPGKOcharclassAC\XPGKOcharclassMD{\XPGKOnobreak\XPGKOquarterquarter\XPGKOstartMD}% +} +% char classes for classic/modern variants +\def\setvariantkoreancharclasses{} +\def\unsetvariantkoreancharclasses{} +\def\@tmpa#1=#2{% + \edef\setvariantkoreancharclasses{% + \unexpanded\expandafter{\setvariantkoreancharclasses + \XeTeXcharclass#1=#2}}% + \edef\unsetvariantkoreancharclasses{% + \noexpand\XeTeXcharclass#1=\the\XeTeXcharclass#1\relax + \unexpanded\expandafter{\unsetvariantkoreancharclasses}}% +} +\count@"30 \loop % 0 .. 9 + \expandafter\@tmpa\the\count@=\XPGKOcharclassAA + \ifnum\count@<"39 + \advance\count@\@ne + \repeat +\count@"41 \loop % A .. Z + \expandafter\@tmpa\the\count@=\XPGKOcharclassAA + \ifnum\count@<"5A + \advance\count@\@ne + \repeat +\count@"61 \loop % a .. z + \expandafter\@tmpa\the\count@=\XPGKOcharclassAA + \ifnum\count@<"7A + \advance\count@\@ne + \repeat +% NS +\@tmpa "3005=\XeTeXcharclassID % 々 IDEOGRAPHIC ITERATION MARK +\@tmpa "301C=\XeTeXcharclassID % 〜 WAVE DASH +\@tmpa "303B=\XeTeXcharclassID % 〻 VERTICAL IDEOGRAPHIC ITERATION MARK +\@tmpa "303C=\XeTeXcharclassID % 〼 MASU MARK +\@tmpa "309B=\XeTeXcharclassID % ゛ KATAKANA-HIRAGANA VOICED SOUND MARK +\@tmpa "309C=\XeTeXcharclassID % ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK +\@tmpa "309D=\XeTeXcharclassID % ゝ HIRAGANA ITERATION MARK +\@tmpa "309E=\XeTeXcharclassID % ゞ HIRAGANA VOICED ITERATION MARK +\@tmpa "30A0=\XeTeXcharclassID % ゠ KATAKANA-HIRAGANA DOUBLE HYPHEN +\@tmpa "30FD=\XeTeXcharclassID % ヽ KATAKANA ITERATION MARK +\@tmpa "30FE=\XeTeXcharclassID % ヾ KATAKANA VOICED ITERATION MARK +\@tmpa "A015=\XeTeXcharclassID % ꀕ YI SYLLABLE ITERATION MARK +\@tmpa "FF9E=\XeTeXcharclassID % ゙ HALFWIDTH KATAKANA VOICED SOUND MARK +\@tmpa "FF9F=\XeTeXcharclassID % ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK +% IS +\@tmpa "FE13=\XeTeXcharclassID % ︓ PRESENTATION FORM FOR VERTICAL COLON +\@tmpa "FE14=\XeTeXcharclassID % ︔ PRESENTATION FORM FOR VERTICAL SEMICOLON +% CJ +\@tmpa "3041=\XeTeXcharclassID +\@tmpa "3043=\XeTeXcharclassID +\@tmpa "3045=\XeTeXcharclassID +\@tmpa "3047=\XeTeXcharclassID +\@tmpa "3049=\XeTeXcharclassID +\@tmpa "3063=\XeTeXcharclassID +\@tmpa "3083=\XeTeXcharclassID +\@tmpa "3085=\XeTeXcharclassID +\@tmpa "3087=\XeTeXcharclassID +\@tmpa "308E=\XeTeXcharclassID +\@tmpa "3095=\XeTeXcharclassID +\@tmpa "3096=\XeTeXcharclassID +\@tmpa "30A1=\XeTeXcharclassID +\@tmpa "30A3=\XeTeXcharclassID +\@tmpa "30A5=\XeTeXcharclassID +\@tmpa "30A7=\XeTeXcharclassID +\@tmpa "30A9=\XeTeXcharclassID +\@tmpa "30C3=\XeTeXcharclassID +\@tmpa "30E3=\XeTeXcharclassID +\@tmpa "30E5=\XeTeXcharclassID +\@tmpa "30E7=\XeTeXcharclassID +\@tmpa "30EE=\XeTeXcharclassID +\@tmpa "30F5=\XeTeXcharclassID +\@tmpa "30F6=\XeTeXcharclassID +\@tmpa "30FC=\XeTeXcharclassID +\count@"31F0 \loop + \expandafter\@tmpa\the\count@=\XeTeXcharclassID + \ifnum\count@<"31FF + \advance\count@\@ne + \repeat +\count@"FF67 \loop + \expandafter\@tmpa\the\count@=\XeTeXcharclassID + \ifnum\count@<"FF70 + \advance\count@\@ne + \repeat +% +\@tmpa "28=\XPGKOcharclassAO % ( +\@tmpa "5B=\XPGKOcharclassAO % [ +\@tmpa "60=\XPGKOcharclassAO % ` +\@tmpa "7B=\XPGKOcharclassAO % { +% +\@tmpa "21=\XPGKOcharclassAC % ! +\@tmpa "27=\XPGKOcharclassAC % ' +\@tmpa "29=\XPGKOcharclassAC % ) +\@tmpa "2C=\XPGKOcharclassAC % , +\@tmpa "2E=\XPGKOcharclassAC % . +\@tmpa "3B=\XPGKOcharclassAC % ; +\@tmpa "3F=\XPGKOcharclassAC % ? +\@tmpa "5D=\XPGKOcharclassAC % ] +\@tmpa "7D=\XPGKOcharclassAC % } +% +\@tmpa "2018=\XeTeXcharclassOP % ‘ LEFT SINGLE QUOTATION MARK +\@tmpa "201C=\XeTeXcharclassOP % “ LEFT DOUBLE QUOTATION MARK +% +\@tmpa "2019=\XeTeXcharclassCL % ’ RIGHT SINGLE QUOTATION MARK +\@tmpa "201D=\XeTeXcharclassCL % ” RIGHT DOUBLE QUOTATION MARK +\@tmpa "FE10=\XeTeXcharclassCL % ︐ PRESENTATION FORM FOR VERTICAL COMMA +% NS +\@tmpa "00B7=\XPGKOcharclassMD % · MIDDLE DOT +\@tmpa "30FB=\XPGKOcharclassMD % ・ KATAKANA MIDDLE DOT +\@tmpa "FE54=\XPGKOcharclassMD % ﹔ SMALL SEMICOLON +\@tmpa "FE55=\XPGKOcharclassMD % ﹕ SMALL COLON +\@tmpa "FF1A=\XPGKOcharclassMD % : FULLWIDTH COLON +\@tmpa "FF1B=\XPGKOcharclassMD % ; FULLWIDTH SEMICOLON +\@tmpa "FF65=\XPGKOcharclassMD % ・ HALFWIDTH KATAKANA MIDDLE DOT +% +\@tmpa "3002=\XPGKOcharclassFS % 。 IDEOGRAPHIC FULL STOP +\@tmpa "FE12=\XPGKOcharclassFS % ︒ PRESENTATION FORM FOR VERTICAL IDEOGRAPHIC FULL STOP +\@tmpa "FE52=\XPGKOcharclassFS % ﹒ SMALL FULL STOP +\@tmpa "FF0E=\XPGKOcharclassFS % . FULLWIDTH FULL STOP +\@tmpa "FF61=\XPGKOcharclassFS % 。 HALFWIDTH IDEOGRAPHIC FULL STOP +% +\@tmpa "2014=\XPGKOcharclassLD % — EM DASH +\@tmpa "2015=\XPGKOcharclassLD % ― HORIZONTAL BAR +\@tmpa "2025=\XPGKOcharclassLD % ‥ TWO DOT LEADER +\@tmpa "2026=\XPGKOcharclassLD % … HORIZONTAL ELLIPSIS +% EX +\@tmpa "FE15=\XPGKOcharclassEX % ︕ PRESENTATION FORM FOR VERTICAL EXCLAMATION MARK +\@tmpa "FE16=\XPGKOcharclassEX % ︖ PRESENTATION FORM FOR VERTICAL QUESTION MARK +\@tmpa "FE56=\XPGKOcharclassEX % ﹖ SMALL QUESTION MARK +\@tmpa "FE57=\XPGKOcharclassEX % ﹗ SMALL EXCLAMATION MARK +\@tmpa "FF01=\XPGKOcharclassEX % ! FULLWIDTH EXCLAMATION MARK +\@tmpa "FF1F=\XPGKOcharclassEX % ? FULLWIDTH QUESTION MARK + +\endinput\fi % end of XeTeX + +% luatex +\protected\def\inhibitglue{\hskip\z@skip} +\ifdefined\newattribute\else + \let\newattribute\newluatexattribute + \let\unsetattribute\unsetluatexattribute +\fi +\newattribute\xpg@attr@korean +\newattribute\xpg@attr@autojosa +\protected\def\rieul{\global\let\xpg@josa@zwang\@ne} +\protected\def\jung {\global\let\xpg@josa@zwang\tw@} +\protected\def\jong {\global\let\xpg@josa@zwang\thr@@} +\protected\def\은{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 은\endgroup\xpg@reset@josa} +\let\는\은 +\protected\def\을{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 을\endgroup\xpg@reset@josa} +\let\를\을 +\protected\def\와{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 와\endgroup\xpg@reset@josa} +\let\과\와 +\protected\def\가{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 가\endgroup\xpg@reset@josa} +\protected\def\이{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 이\endgroup\xpg@reset@josa} +\protected\def\라{\이 라} +\protected\def\으{\begingroup\xpg@attr@autojosa\xpg@josa@zwang 으\endgroup\xpg@reset@josa} +\protected\def\로{\으 로} +\def\xpg@reset@josa {\global\let\xpg@josa@zwang\z@}\xpg@reset@josa \directlua{ local glyph_id = node.id("glyph") +local hbox_id = node.id("hlist") +local vbox_id = node.id("vlist") local attr_korean = luatexbase.attributes["xpg@attr@korean"] -local nobreak_after = { - [0x28] = true, [0x3C] = true, [0x5B] = true, [0x60] = true, [0x7B] = true, - [0x2018] = true, [0x201C] = true, [0x3008] = true, [0x300A] = true, - [0x300C] = true, [0x300E] = true, [0x3010] = true, [0x3014] = true, - [0xFF08] = true, [0xFF1C] = true, [0xFF3B] = true, [0xFF5B] = true, -} -local nobreak_before = { - [0x21] = true, [0x22] = true, [0x27] = true, [0x29] = true, [0x2C] = true, - [0x2D] = true, [0x2E] = true, [0x2F] = true, [0x3A] = true, [0x3B] = true, - [0x3E] = true, [0x3F] = true, [0x5D] = true, [0x7D] = true, [0xB7] = true, - [0x2013] = true, [0x2014] = true, [0x2015] = true, [0x2019] = true, - [0x201D] = true, [0x2025] = true, [0x2026] = true, [0x3001] = true, - [0x3002] = true, [0x3009] = true, [0x300B] = true, [0x300D] = true, - [0x300F] = true, [0x3011] = true, [0x3015] = true, [0xFF01] = true, - [0xFF09] = true, [0xFF0C] = true, [0xFF0E] = true, [0xFF1A] = true, - [0xFF1B] = true, [0xFF1F] = true, [0xFF3D] = true, [0xFF5D] = true, - [0x3041] = true, [0x3043] = true, [0x3045] = true, [0x3047] = true, - [0x3049] = true, [0x3063] = true, [0x3083] = true, [0x3085] = true, - [0x3087] = true, [0x308E] = true, [0x3095] = true, [0x3096] = true, - [0x3099] = true, [0x309A] = true, [0x309B] = true, [0x309C] = true, - [0x309D] = true, [0x309E] = true, [0x30A0] = true, [0x30A1] = true, - [0x30A3] = true, [0x30A5] = true, [0x30A7] = true, [0x30A9] = true, - [0x30C3] = true, [0x30E3] = true, [0x30E5] = true, [0x30E7] = true, - [0x30EE] = true, [0x30F5] = true, [0x30F6] = true, [0x30FB] = true, - [0x30FC] = true, [0x30FD] = true, [0x30FE] = true, -} -for i=0x1160, 0x11FF do nobreak_before[i] = true end -for i=0xD7B0, 0xD7FB do nobreak_before[i] = true end -for i=0x302E, 0x302F do nobreak_before[i] = true end -for i=0x31F0, 0x31FF do nobreak_before[i] = true end -local is_cjk = function (c) +local attr_josa = luatexbase.attributes["xpg@attr@autojosa"] +local nobr_after = { + [0x28] = 1, [0x2D] = 1, [0x2F] = 1, [0x3C] = 1, [0x5B] = 1, + [0x5C] = 1, [0x60] = 1, [0x7B] = 1, [0x7E] = 1, [0x2013] = 1, + [0x2018] = 1, [0x201C] = 1, [0x2329] = 1, [0x3008] = 1, + [0x300A] = 1, [0x300C] = 1, [0x300E] = 1, [0x3010] = 1, + [0x3014] = 1, [0x3016] = 1, [0x3018] = 1, [0x301A] = 1, + [0x301D] = 1, [0xFF08] = 1, [0xFF1C] = 1, [0xFF3B] = 1, + [0xFF5B] = 1, [0xFF5F] = 1, [0xFF62] = 1, +} +local nobr_before = { + [0x21] = 1, [0x22] = 1, [0x27] = 1, [0x29] = 1, [0x2C] = 1, + [0x2D] = 1, [0x2E] = 1, [0x2F] = 1, [0x3A] = 1, [0x3B] = 1, + [0x3E] = 1, [0x3F] = 1, [0x5C] = 1, [0x5D] = 1, [0x7D] = 1, + [0x7E] = 1, [0xB7] = 1, [0x2013] = 1, [0x2014] = 1, [0x2015] = 1, + [0x2019] = 1, [0x201D] = 1, [0x2025] = 1, [0x2026] = 1, + [0x232A] = 1, [0x3001] = 1, [0x3002] = 1, [0x3005] = 1, + [0x3009] = 1, [0x300B] = 1, [0x300D] = 1, [0x300F] = 1, + [0x3011] = 1, [0x3015] = 1, [0x3017] = 1, [0x3019] = 1, + [0x301B] = 1, [0x301C] = 1, [0x301E] = 1, [0x301F] = 1, + [0x3035] = 1, [0x303B] = 1, [0x303C] = 1, [0x3041] = 2, + [0x3043] = 2, [0x3045] = 2, [0x3047] = 2, [0x3049] = 2, + [0x3063] = 2, [0x3083] = 2, [0x3085] = 2, [0x3087] = 2, + [0x308E] = 2, [0x3095] = 2, [0x3096] = 2, [0x3099] = 1, + [0x309A] = 1, [0x309B] = 1, [0x309C] = 1, [0x309D] = 1, + [0x309E] = 1, [0x30A0] = 1, [0x30A1] = 2, [0x30A3] = 2, + [0x30A5] = 2, [0x30A7] = 2, [0x30A9] = 2, [0x30C3] = 2, + [0x30E3] = 2, [0x30E5] = 2, [0x30E7] = 2, [0x30EE] = 2, + [0x30F5] = 2, [0x30F6] = 2, [0x30FB] = 1, [0x30FC] = 1, + [0x30FD] = 1, [0x30FE] = 1, [0x31F0] = 2, [0x31F1] = 2, + [0x31F2] = 2, [0x31F3] = 2, [0x31F4] = 2, [0x31F5] = 2, + [0x31F6] = 2, [0x31F7] = 2, [0x31F8] = 2, [0x31F9] = 2, + [0x31FA] = 2, [0x31FB] = 1, [0x31FC] = 1, [0x31FD] = 1, + [0x31FE] = 1, [0x31FF] = 1, [0xFF01] = 1, [0xFF09] = 1, + [0xFF0C] = 1, [0xFF0E] = 1, [0xFF1A] = 1, [0xFF1B] = 1, + [0xFF1F] = 1, [0xFF3D] = 1, [0xFF5D] = 1, [0xFF60] = 1, + [0xFF61] = 1, [0xFF63] = 1, [0xFF64] = 1, [0xFF65] = 1, + [0xFF9E] = 1, [0xFF9F] = 1, +} +for i=0x1160, 0x11FF do nobr_before[i] = 2 end +for i=0xD7B0, 0xD7FB do nobr_before[i] = 2 end +for i=0x302A, 0x302F do nobr_before[i] = 1 end +local function is_cjk (c) return (c >= 0xAC00 and c <= 0xD7A3) or (c >= 0x1100 and c <= 0x115F) or (c >= 0xA960 and c <= 0xA97C) @@ -115,33 +646,130 @@ local is_cjk = function (c) or (c >= 0x3040 and c <= 0x30FF) or (c >= 0x20000 and c <= 0x2CEAF) or (c >= 0x2F800 and c <= 0x2FA1F) - or (nobreak_after[c] and c > 0xFF) - or (nobreak_before[c] and c > 0xFF) + or (nobr_after[c] and c > 0xFF) + or (nobr_before[c] and c > 0xFF) end -local insert_penalty_glue = function (head, curr) +local charclass = setmetatable({ + [0x2018] = 1, [0x201C] = 1, [0x2329] = 1, [0x3008] = 1, + [0x300A] = 1, [0x300C] = 1, [0x300E] = 1, [0x3010] = 1, + [0x3014] = 1, [0x3016] = 1, [0x3018] = 1, [0x301A] = 1, + [0x301D] = 1, [0xFF08] = 1, [0xFF3B] = 1, [0xFF5B] = 1, + [0xFF5F] = 1, [0xFF62] = 1, [0x2019] = 2, [0x201D] = 2, + [0x232A] = 2, [0x3001] = 2, [0x3009] = 2, [0x300B] = 2, + [0x300D] = 2, [0x300F] = 2, [0x3011] = 2, [0x3015] = 2, + [0x3017] = 2, [0x3019] = 2, [0x301B] = 2, [0x301E] = 2, + [0x301F] = 2, [0xFF09] = 2, [0xFF0C] = 2, [0xFF3D] = 2, + [0xFF5D] = 2, [0xFF60] = 2, [0xFF63] = 2, [0xFF64] = 2, + [0x00B7] = 3, [0x30FB] = 3, [0xFF1A] = 3, [0xFF1B] = 3, + [0xFF65] = 3, [0x3002] = 4, [0xFF0E] = 4, [0xFF61] = 4, + [0x2015] = 5, [0x2025] = 5, [0x2026] = 5, [0xFF01] = 6, + [0xFF1F] = 6, +}, { __index = function() return 0 end }) +local intercharclass = { [0] = + { [0] = nil, {1,1}, nil, {.5,.5} }, + { [0] = nil, nil, nil, {.5,.5} }, + { [0] = {1,1}, {1,1}, nil, {.5,.5}, nil, {1,1}, {1,1} }, + { [0] = {.5,.5},{.5,.5},{.5,.5},{1,.5}, {.5,.5},{.5,.5},{.5,.5} }, + { [0] = {1,0}, {1,0}, nil, {1.5,.5},nil, {1,0}, {1,0} }, + { [0] = nil, {1,1}, nil, {.5,.5} }, + { [0] = {1,1}, {1,1}, nil, {.5,.5} }, +} +local function get_new_penalty (p) local penalty = node.new("penalty") - penalty.penalty = 50 + penalty.penalty = p + return penalty +end +local function get_new_glue (wd, st, sh) local glue = node.new("glue") local spec = node.new("glue_spec") - local size = fonts.hashes.identifiers[curr.font] or font.fonts[curr.font] - size = size and size.size or 655360 - spec.width = 0 - spec.stretch = size/10 - spec.shrink = size/25 + spec.width = wd + spec.stretch = st + spec.shrink = sh glue.spec = spec - head, curr = node.insert_after(head, curr, penalty) + return glue +end +local function get_font_size (fid, space) + local f = fonts.hashes.identifiers[fid] or font.fonts[fid] + local size = f and f.parameters + if space then + size = size and size.space or 196608 + else + size = size and size.quad or 655360 + end + return size/2 +end +local function glyph_to_box (head, curr, class) + local g, h = curr + local size = get_font_size(g.font) + head, curr = node.remove(head, curr) + g.next, g.prev = nil, nil + local hss = get_new_glue(0, 65536, 65536) + hss.spec.stretch_order = 2 + hss.spec.shrink_order = 2 + if class == 1 then + h, hss.next, g.prev = hss, g, hss + elseif class == 2 or class == 4 then + h, g.next, hss.prev = g, hss, g + else + local hss2 = node.copy(hss) + h, hss.next, g.prev, g.next, hss2.prev = hss, g, hss, hss2, g + end + local box = node.hpack(h, size, "exactly") + head, curr = node.insert_before(head, curr, box) + return head, curr +end +local function insert_cjk_penalty_glue (head, curr, f, var, cc, nc, nobr) + if nobr or cc == 1 or nc > 1 then + local penalty = get_new_penalty(10000) + head, curr = node.insert_after(head, curr, penalty) + end + local factor = get_font_size(f, var == 2) + local t = intercharclass[cc][nc] + local glue = get_new_glue(t[1]*factor, nil, t[2]*factor) head, curr = node.insert_after(head, curr, glue) return head, curr end -local korean_break = function (head) +local function insert_penalty_glue (head, curr, f, var, x) + if var == 1 then + else + local penalty = get_new_penalty(50) + head, curr = node.insert_after(head, curr, penalty) + end + local size, glue = get_font_size(f, x and var == 2) + if x then + glue = get_new_glue(size/2, size/4, size/8) + else + glue = get_new_glue(0, size/5, size/50) + end + head, curr = node.insert_after(head, curr, glue) + return head, curr +end +local function korean_break (head, lb) local curr = head while curr do - if curr.id == glyph_id and node.has_attribute(curr, attr_korean) then - local next = curr.next - if next and next.id == glyph_id then - local c, n = curr.char, next.char - if (is_cjk(c) or is_cjk(n)) and not nobreak_before[n] and not nobreak_after[c] then - head, curr = insert_penalty_glue(head, curr) + if curr.id == glyph_id then + local var = node.has_attribute(curr, attr_korean) + if var then + local c, f = curr.char, curr.font + local cc = charclass[c] + if var > 0 and cc > 0 and cc < 5 then + head, curr = glyph_to_box(head, curr, cc) + end + local next = curr.next + if next and next.id == glyph_id then + local n = next.char + local nc = charclass[n] + local nobr = nobr_before[n] or nobr_after[c] + if var > 0 and intercharclass[cc][nc] then + head, curr = insert_cjk_penalty_glue(head, curr, f, var, cc, nc, nobr) + elseif not nobr then + local cjkc, cjkn = is_cjk(c), is_cjk(n) + if var > 0 and (cjkc or cjkn) and not (cjkc and cjkn) then + head, curr = insert_penalty_glue(head, curr, f, var, true) + elseif lb and (cjkc or cjkn) then + head, curr = insert_penalty_glue(head, curr, f, var) + end + end end end end @@ -149,15 +777,119 @@ local korean_break = function (head) end return head end -local reorder_tm = function (head) - local tone - local curr = node.tail(head) +local josa_table = { + % 리을, 중성, 종성 + [0xAC00] = {0xC774, 0xAC00, 0xC774}, % 가 = 이, 가, 이 + [0xC740] = {0xC740, 0xB294, 0xC740}, % 은 = 은, 는, 은 + [0xC744] = {0xC744, 0xB97C, 0xC744}, % 을 = 을, 를, 을 + [0xC640] = {0xACFC, 0xC640, 0xACFC}, % 와 = 과, 와, 과 + [0xC73C] = {nil, nil, 0xC73C}, % 으(로) = , , 으 + [0xC774] = {0xC774, nil, 0xC774}, % 이(라) = 이, , 이 +} +local function josa_char_num (t, c) + c = c - math.floor(c/10)*10 + 0x30 + return t[c] or 2 +end +local josa_code = setmetatable({ + [0x30] = 3, [0x31] = 1, [0x33] = 3, [0x36] = 3, [0x37] = 1, + [0x38] = 1, [0x4C] = 1, [0x4D] = 3, [0x4E] = 3, [0x6C] = 1, + [0x6D] = 3, [0x6E] = 3, [0xFB02] = 1, [0xFB04] = 1, +},{ __index = function(t,c) + if c >= 0xAC00 and c <= 0xD7A3 then + c = c - 0xAC00 + c = c - math.floor(c/28)*28 + 0x11A7 + end + if c >= 0x11A8 and c <= 0x11FF then + if c == 0x11AF then return 1 end + return 3 + end + if c >= 0xD7CB and c <= 0xD7FB then return 3 end + if c >= 0x2170 and c <= 0x217F then c = c - 0x10 end + if c >= 0x2160 and c <= 0x216F then + if c >= 0x216C then return 3 end + return josa_char_num(t, c - 0x215F) + end + if c >= 0x2460 and c <= 0x2473 then return josa_char_num(t, c - 0x245F) end + if c >= 0x2474 and c <= 0x2487 then return josa_char_num(t, c - 0x2473) end + if c >= 0x2488 and c <= 0x249B then return josa_char_num(t, c - 0x2487) end + if c >= 0x249C and c <= 0x24B5 then return t[c - 0x249C + 0x61] or 2 end + if c >= 0x24B6 and c <= 0x24CF then return t[c - 0x24B6 + 0x61] or 2 end + if c >= 0x24D0 and c <= 0x24E9 then return t[c - 0x24D0 + 0x61] or 2 end + if c >= 0x3131 and c <= 0x318E then + if c == 0x3139 then return 1 end + if c >= 0x314F and c <= 0x3163 or c >= 0x3187 then return 2 end + return 3 + end + if c >= 0x3260 and c <= 0x327E then c = c - 0x60 end + if c >= 0x3200 and c <= 0x321E then + if c == 0x3203 then return 1 end + if c >= 0x320E then return 2 end + return 3 + end + if c >= 0xFF10 and c <= 0xFF19 then return josa_char_num(t, c - 0xFF10) end + if c >= 0xFF21 and c <= 0xFF3A then return t[c - 0xFF21 + 0x61] or 2 end + if c >= 0xFF41 and c <= 0xFF5A then return t[c - 0xFF41 + 0x61] or 2 end + return 2 + end }) +local function get_prev_char (p) + while p do + if p.id == glyph_id then + local pc = p.char + if not nobr_after[pc] then + if not nobr_before[pc] or nobr_before[pc] == 2 then + return pc + end + end + elseif p.id == hbox_id or p.id == vbox_id then + local pc = get_prev_char(node.tail(p.head)) + if pc then return pc end + end + p = p.prev + end +end +local function auto_josa (head) + local curr, tofree = head, {} + while curr do + if curr.id == glyph_id then + local josa = node.has_attribute(curr, attr_josa) + if josa then + local cc = curr.char + if josa == 0 then + josa = josa_code[get_prev_char(curr.prev) or 0x30] + end + if cc == 0xC774 then + local n = curr.next + if n and n.id == glyph_id and n.char == 0xB77C then + else + cc = 0xAC00 + end + end + local new = josa_table[cc] + if new then + cc = new[josa] + if cc then + curr.char = cc + else + head = node.remove(head, curr) + table.insert(tofree, curr) + end + end + node.unset_attribute(curr, attr_josa) + end + end + curr = curr.next + end + for _,v in ipairs(tofree) do node.free(v) end + return head +end +local function reorder_tm (head) + local curr, tone = node.tail(head) while curr do if curr.id == glyph_id and node.has_attribute(curr, attr_korean) then - local c, wd = curr.char, curr.width + local c, wd = curr.char, curr.width if (c == 0x302E or c == 0x302F) and wd and wd > 0 then tone = curr - elseif tone and not nobreak_before[c] then + elseif tone and not nobr_before[c] then head = node.remove(head, tone) tone.next, tone.prev = nil, nil head, curr = node.insert_before(head, curr, tone) @@ -168,38 +900,38 @@ local reorder_tm = function (head) end return head end -luatexbase.add_to_callback ("pre_linebreak_filter", reorder_tm, "polyglossia.reorder_korean_tm", 1) -luatexbase.add_to_callback ("pre_linebreak_filter", korean_break, "polyglossia.korean_break", 1) -luatexbase.add_to_callback ("hpack_filter", reorder_tm, "polyglossia.reorder_korean_tm", 1) -} -\fi - -\def\noextras@korean{% - \ifxetex - \XeTeXlinebreaklocale "" - \else - \unsetluatexattribute\xpg@attr@korean - \fi - \ifdefined\xpg@orig@baselinestretch \xpg@orig@baselinestretch \fi - \ifdefined\xpg@orig@footnotesep \xpg@orig@footnotesep \fi -} - -\def\inlineextras@korean{% - \ifxetex - \XeTeXlinebreaklocale "ko" - \XeTeXlinebreakpenalty 50 - \XeTeXlinebreakskip 0pt plus.1em minus .04em - \else - \xpg@attr@korean=1 - \fi -} - -\def\blockextras@korean{% - \inlineextras@korean - \xdef\xpg@orig@baselinestretch{\def\noexpand\baselinestretch{\ifdefined\baselinestretch\baselinestretch\else 1\fi}}% - \def\baselinestretch{1.3888}\selectfont - \xdef\xpg@orig@footnotesep{\noexpand\footnotesep=\ifdefined\footnotesep\the\footnotesep\else 0pt\fi}% - \footnotesep=1.3888\footnotesep +local prepend_to_callback +if luatexbase.callbacktypes then + prepend_to_callback = function(name, func, desc) + local t = { {func, desc} } + for _,v in ipairs(luatexbase.callback_descriptions(name)) do + table.insert(t, {luatexbase.remove_from_callback(name, v)}) + end + for _,v in ipairs(t) do + luatexbase.add_to_callback(name, v[1], v[2]) + end + end +else + prepend_to_callback = function(name, func, desc) + luatexbase.add_to_callback(name, func, desc, 1) + end +end +prepend_to_callback ("pre_linebreak_filter", + function(head) + head = auto_josa(head) + head = korean_break(head, true) + head = reorder_tm(head) + return head + end, + "polyglossia.lang_korean") +prepend_to_callback ("hpack_filter", + function(head) + head = auto_josa(head) + head = korean_break(head) + head = reorder_tm(head) + return head + end, + "polyglossia.lang_korean") } -% vim:tw=72:sw=4:ts=4:expandtab +% vim:ft=tex:tw=0:sw=4:ts=4:expandtab diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf index 13da4cbeafc..e1160c6782e 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf @@ -1,7 +1,7 @@ % !TEX encoding = UTF-8 Unicode \ProvidesFile{gloss-latin.ldf}[polyglossia: module for latin] \PolyglossiaSetup{latin}{ -% hyphennames={latin}, +hyphennames={latin}, % hyphenmins={2,2}, frenchspacing=true, fontsetup=true, @@ -63,7 +63,7 @@ % set modern as default \def\latin@variant{\l@latin}% -\ifluatex\xpg@set@language@luatex@ii{latin}\fi +\ifluatex\xpg@set@language@luatex@iv{latin}\fi \def\captionslatin{\modernlatincaptions}% \def\datelatin{\modernlatindate}% \def\classicuclccodes{\lccode`\V=`\u \uccode`\u=`\V} @@ -76,28 +76,28 @@ \def\@tempa{#1}% \ifx\@tempa\tmp@medieval \def\latin@variant{\l@latin}% - \xpg@set@language@luatex@ii{latin} + \xpg@set@language@luatex@iv{latin} \def\captionslatin{\medievallatincaptions}% \def\datelatin{\classiclatindate}% \classicuclccodes \xpg@info{Option: Medieval Latin}% \else \ifx\@tempa\tmp@classic - \ifx\l@classiclatin\undefined + \xpg@ifdefined{classiclatin}{% + \def\latin@variant{\l@classiclatin}% + \xpg@set@language@luatex@iv{classiclatin}% + }{% \xpg@nopatterns{Classic Latin}% \adddialect\l@classiclatin\l@latin \def\latin@variant{\l@latin}% - \else - \def\latin@variant{\l@classiclatin}% - \xpg@set@language@luatex@ii{classiclatin}% - \fi + }% \def\captionslatin{\modernlatincaptions}% \def\datelatin{\classiclatindate}% \classicuclccodes \xpg@info{Option: Classic Latin}% \else \def\latin@variant{\l@latin}% - \xpg@set@language@luatex@ii{latin} + \xpg@set@language@luatex@iv{latin} \def\captionslatin{\modernlatincaptions}% \def\datelatin{\modernlatindate}% \xpg@info{Option: Modern Latin}% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf index 495fa2897c2..59c94fd8296 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf @@ -46,9 +46,9 @@ and may look very wrong.} \def\chaptername{प्रकरण}% \def\appendixname{परिशिष्ट}% \def\contentsname{अनुक्रमणिका}% - \def\listfigurename{आक्रुत्यांची यादी}% + \def\listfigurename{आकृत्यांची यादी}% \def\listtablename{कॊष्टकांची यादी}% - \def\indexname{सुची}% + \def\indexname{सूची}% \def\figurename{आक्रुती}% \def\tablename{कोष्टक}% %\def\thepart{}% TODO @@ -59,8 +59,8 @@ and may look very wrong.} \def\enclname{समाविष्ट}% \def\ccname{सि.सि.}% \def\headtoname{प्रति}% - \def\proofname{कसोटी}% - \def\glossaryname{स्पष्टीकरणकोश}% + \def\proofname{सिद्धता}% + \def\glossaryname{स्पष्टीकरणांची यादी}% } \def\datemarathi{% \def\marathimonth{% @@ -70,11 +70,11 @@ and may look very wrong.} मार्च\or एप्रिल\or मे\or - जुन\or - जुलॆ\or - ओगस्ट\or + जून\or + जुलै\or + ऑगस्ट\or सप्टेंबर\or - ओक्टोबर\or + ऑक्टोबर\or नोव्हेंबर\or डिसेंबर\fi }% diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf index c647aa9000f..8a14b6efe06 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf @@ -1,6 +1,22 @@ -% Translated by Cédric Valmary <cvalmary@yahoo.fr> of Tot en òc <http://www.totenoc.org/> -\ProvidesFile{gloss-occitan.ldf}[polyglossia: module for occitan] - +%% +%% This is file `gloss-occitan.ldf', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% gloss-occitan.dtx (with options: `ldf') +%% ------------------------------------------------------------------ +%% The gloss-occitan module for polyglossia +%% Copyright (C) 2016 Cédric Valmary +%% All rights reserved +%% +%% Licence information appended +%% +%% Created by Cédric Valmary: cvalmary at yahoo dot fr +%% of Tot en òc <http://www.totenoc.eu/> +%% +\ProvidesFile{gloss-occitan.ldf}[2016/02/04 v0.3 polyglossia: + module for Occitan] \PolyglossiaSetup{occitan}{ hyphennames={occitan}, hyphenmins={2,2}, @@ -8,12 +24,64 @@ indentfirst=true, fontsetup=true, } +\define@boolkey{occitan}[occitan@]{babelshorthands}[true]{} +\ifsystem@babelshorthands + \setkeys{occitan}{babelshorthands=true} +\else + \setkeys{occitan}{babelshorthands=false} +\fi +\ifcsundef{initiate@active@char}{% +\input{babelsh.def}% +\initiate@active@char{"}% +}{} +\def\occitan@shorthands{% + \bbl@activate{"}% + \def\language@group{occitan}% + \declare@shorthand{occitan}{"}{% + \relax\ifmmode + \def\xpgoc@next{''}% + \else + \def\xpgoc@next{\futurelet\xpgoc@temp\xpgoc@cwm}% + \fi + \xpgoc@next}% +} +\def\xpgoc@@cwm{\nobreak\discretionary{-}{}{}\nobreak\hskip\z@skip} +\def\xpgoc@ponchinterior{% + \nobreak\discretionary{-}{}{\mbox{$\cdot$}}\nobreak\hskip\z@skip} +\def\xpgoc@cwm{\let\xpgoc@@next\relax + \ifcat\noexpand\xpgoc@temp a% + \def\xpgoc@@next{\xpgoc@@cwm}% + \else + \if\noexpand\xpgoc@temp \string|% + \def\xpgoc@@next##1{\xpgoc@@cwm}% + \else + \if\noexpand\xpgoc@temp \string<% + \def\xpgoc@@next##1{«\ignorespaces}% + \else + \if\noexpand\xpgoc@temp \string>% + \def\xpgoc@@next##1{\unskip»}% + \else + \if\noexpand\xpgoc@temp\string/% + \def\xpgoc@@next##1{\slash}% + \else + \if\noexpand\xpgoc@temp\string.% + \def\xpgoc@@next##1{\xpgoc@ponchinterior}% + \fi + \fi + \fi + \fi + \fi + \fi + \xpgoc@@next} +\def\nooccitan@shorthands{% + \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}% +} \def\captionsoccitan{% \def\refname{Referéncias}% \def\abstractname{Resumit}% \def\bibname{Bibliografia}% - \def\prefacename{Prefàcia}% + \def\prefacename{Prefaci}% \def\chaptername{Capítol}% \def\appendixname{Annèx}% \def\contentsname{Ensenhador}% @@ -52,7 +120,38 @@ 1èr\else% primièr \number\day\fi% all other numbers }% - \def\today{\occitanday \occitanmonth\space de~\number\year}% + \def\today{\occitanday\space \occitanmonth\space de~\number\year}% +} +\let\xpgoc@savedvalues\empty +\AtEndPreamble{% the user or the class might define different values + \edef\xpgoc@savedvalues{% + \clubpenalty=\the\clubpenalty\space + \@clubpenalty=\the\@clubpenalty\space + \widowpenalty=\the\widowpenalty\space + \finalhyphendemerits=\the\finalhyphendemerits} +} +\def\noextras@occitan{% + \lccode\string"2019=\z@ + \nooccitan@shorthands + \xpgoc@savedvalues +} +\def\blockextras@occitan{% + \lccode\string"2019=\string"2019 + \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000 + \finalhyphendemerits=50000000 + \ifoccitan@babelshorthands\occitan@shorthands\fi } -\endinput +\def\inlineextras@occitan{% + \lccode\string"2019=\string"2019 + \ifoccitan@babelshorthands\occitan@shorthands\fi +} +%% Distributable under the LaTeX Project Public License, +%% version 1.3c or higher (your choice). The latest version of +%% this license is at: http://www.latex-project.org/lppl.txt +%% +%% This work is "author-maintained" +%% The maintainer is Cédric Valmary +%% +%% +%% End of file `gloss-occitan.ldf'. diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf index dccb3137001..1908554cc2d 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf @@ -41,6 +41,20 @@ \def\glossaryname{Rhestr termau}% } +\newif\ifwelsh@first +\def\welsh@article#1{\welsh@firsttrue y\expandafter\welsh@article@do#1} +\def\welsh@article@do#1{\ifwelsh@first\welsh@isvowel#1\ifwelsh@vowel r\space\welsh@vowelfalse\else\space\fi#1\welsh@firstfalse\fi} +\newif\ifwelsh@vowel +\def\welsh@isvowel#1{\show#1\ifx#1a\welsh@voweltrue\else\ifx#1u\welsh@voweltrue\else\ifx#1w\welsh@voweltrue\fi\fi\fi}% FIXME Add the other vowels, just for good measure + +\def\welsh@ordinal@long#1{% + \ifcase#1\or cyntaf\or ail\or trydydd\or pedwerydd\or + pumed\or chweched\or seithfed\or wythfed\or nawfed\or degfed\or unfed ar ddeg\or deuddegfed\or trydydd ar ddeg\or pedwerydd ar ddeg\or pymthegfed\or unfed ar bymtheg\or ail ar bymtheg\or deunawfed\or pedwerydd ar bymtheg\or ugeinfed\else\expandafter\welsh@ordinalplusxx@long#1\fi} + +\def\welsh@ordinalplusxx@long#1{% + \let\dday=#1\advance\dday by -20\relax\welsh@ordinal@long\dday\space ar hugain% +} + \def\datewelsh{% \def\today{\ifwelsh@formaldate\formaltoday\else\standardtoday\fi} \def\standardtoday{% @@ -54,8 +68,7 @@ \space\number\year}% \def\formaltoday{% - \space\ifcase\day\or y\space cyntaf\or yr\space ail\or y\space trydydd\or y\space pedwerydd\or - y\space pumed\or y\space chweched\or y\space seithfed\or yr\space wythfed\or y\space nawfed\or y\space degfed\or yr\space unfed ar ddeg\or y\space deuddegfed\or y\space trydydd ar ddeg\or y\space pedwerydd ar ddeg\or y\space pymthegfed\or yr\space unfed ar bymtheg\or yr\space ail ar bymtheg\or y\space deunawfed\or y\space pedwerydd ar bymtheg\or yr\space ugeinfed\or yr\space unfed ar hugain\or yr\space ail ar hugain\or y\space trydydd ar hugain\or y\space pedwerydd ar hugain\or y\space pumed ar hugain\or y\space chweched ar hugain\or y\space seithfed ar hugain\or yr\space wythfed ar hugain\or y\space nawfed ar hugain\or y\space degfed ar hugain\or yr\space unfed ar ddeg ar hugain\fi\space o\space\ifcase\month\or Ionawr\or Chwefror\or Fawrth\or Ebrill\or Fai\or Fehefin\or Orffenaf\or Awst\or Fedi\or Hydref\or Dachwedd\or Ragfyr\fi + \expandafter\welsh@article\welsh@ordinal@long\day\space o\space\ifcase\month\or Ionawr\or Chwefror\or Fawrth\or Ebrill\or Fai\or Fehefin\or Orffenaf\or Awst\or Fedi\or Hydref\or Dachwedd\or Ragfyr\fi \space\number\year}% } diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-frpt.lua b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-frpt.lua index 56af011152a..ac265fa06f6 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-frpt.lua +++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-frpt.lua @@ -119,7 +119,7 @@ local mappings = { [byte('⁈')] = {left, thinspace}, [byte('⁉')] = {left, thinspace}, [byte('»')] = {left, thinspace}, - [byte('>')] = {left, thinspace}, + [byte('›')] = {left, thinspace}, [byte('«')] = {right, thinspace}, [byte('‹')] = {right, thinspace}, } diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua index cb1e789ad63..bd1afa5e912 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua +++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua @@ -23,6 +23,19 @@ local current_language local last_language local default_language +polyglossia.newloader_loaded_languages = { } +polyglossia.newloader_max_langid = 0 +local newloader_available_languages = dofile(kpse.find_file('language.dat.lua')) +-- Suggestion by Dohyun Kim on #129 +local t = { } +for k, v in pairs(newloader_available_languages) do + t[k] = v + for _, vv in pairs(v.synonyms) do + t[vv] = v + end +end +newloader_available_languages = t + local function loadlang(lang, id) if luatexhyphen.lookupname(lang) then luatexhyphen.loadlanguage(lang, id) @@ -86,6 +99,55 @@ local function load_tibt_eol() require('polyglossia-tibt') end +-- New hyphenation pattern loader: use language.dat.lua directly and the language identifiers +local function newloader(langentry) + loaded_language = polyglossia.newloader_loaded_languages[langentry] + if loaded_language then + texio.write_nl('term and log', 'Language ' .. langentry .. ' already loaded; id is ' .. lang.id(loaded_language)) + -- texio.write_nl('term and log', 'Language ' .. langentry .. ' already loaded with patterns ' .. tostring(loaded_language) .. '; id is ' .. lang.id(loaded_language)) + -- texio.write_nl('term and log', 'Language ' .. langentry .. ' already loaded with patterns ' .. loaded_language['patterns'] .. '; id is ' .. lang.id(loaded_language)) + return lang.id(loaded_language) + else + langdata = newloader_available_languages[langentry] + if langdata and langdata['special'] == 'language0' then return 0 end + + if langdata then + print("Language data for " .. langentry) + for k, v in pairs(langdata) do + print(k, tostring(v)) + end + polyglossia.newloader_max_langid = polyglossia.newloader_max_langid + 1 + -- langobject = lang.new(newloader_max_langid) + lang.new(); lang.new(); lang.new() + langobject = lang.new() + texio.write_nl('term and log', langdata.patterns) + if langdata.patterns and langdata.patterns ~= '' then + pattfilepath = kpse.find_file(langdata.patterns) + if pattfilepath then + pattfile = io.open(pattfilepath) + lang.patterns(langobject, pattfile:read('*all')) + pattfile:close() + end + end + if langdata.hyphenation and langdata.hyphenation ~= '' then + hyphfilepath = kpse.find_file(langdata.hyphenation) + if hyphfilepath then + hyphfile = io.open(hyphfilepath) + lang.hyphenation(langobject, hyphfile:read('*all')) + hyphfile:close() + end + end + polyglossia.newloader_loaded_languages[langentry] = langobject + + texio.write_nl('term and log', 'Language ' .. langentry .. ' was not yet loaded; created with id ' .. lang.id(langobject)) + return lang.id(langobject) + else + texio.write_nl('term and log', 'Language ' .. langentry .. ' not found in language.dat.lua') + return 255 + end + end +end + polyglossia.loadlang = loadlang polyglossia.select_language = select_language polyglossia.set_default_language = set_default_language @@ -96,3 +158,4 @@ polyglossia.load_frpt = load_frpt polyglossia.load_tibt_eol = load_tibt_eol polyglossia.disable_hyphenation = disable_hyphenation polyglossia.enable_hyphenation = enable_hyphenation +polyglossia.newloader = newloader diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty index 8d7f77e692b..ceece27c094 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty +++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty @@ -1,5 +1,5 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{polyglossia}[2015/08/06 v1.42.0 +\ProvidesPackage{polyglossia}[2015/03/25 v1.42.4 Alternative to Babel for XeLaTeX and LuaLaTeX] \RequirePackage{etoolbox} \RequirePackage{makecmds} @@ -26,6 +26,10 @@ \RequireLuaModule{polyglossia} \fi +% Useful for getting list of loaded languages and variants. Like babel's bbl@loaded +\let\xpg@loaded\@empty +\let\xpg@vloaded\@empty + %% custom message macros \providecommand*{\xpg@error}[1]{% \PackageError{polyglossia}{#1}{}% @@ -149,7 +153,7 @@ That is almost guaranteed to cause problems.} %% options currently available: %% language : the name of the language (as understood by fontspec) %% hyphennames : the different hyphenation patterns to try (comma separated list) -%%% TODO: if pattern is prefixed by !, then it should be loaded as a fallback, with \xpg@nopatterns@fallback - i.e. with a warning: e.g. sanskrit for hindi, or catalan for asturian. +%%% TODO: if pattern is prefixed by !, then it should be loaded as a fallback, with \xpg@nopatterns@fallback - i.e. with a warning: e.g. sanskrit for hindi, or catalan for asturian. – Also for languages with variants! (English and German, etc.) %% script : the name of the script (as understood by fontspec) – default is Latin %% direction : the direction of the script: LR or RL %% scripttag : the OpenType tag for the script @@ -163,6 +167,7 @@ That is almost guaranteed to cause problems.} %% TODO: localnumber = <csname> %% or even better localdigits = {0123456789} for fully automatic setup +\newif\if@xpg@language@really@defined@ \newcommand*\PolyglossiaSetup[2]{% %define booleans etoolbox style and set defaults %% TODO ? \providetoggle{#1@setup@done}% @@ -176,15 +181,16 @@ That is almost guaranteed to cause problems.} \csgdef{init@extras@#1}{}% \csgdef{init@noextras@#1}{}% we don't use this yet: remove? \csgdef{xpg@langname@#1}{\xpg@uppercasefirst{#1}}% - %needed for docvslist with hyphennames key: + %needed for docsvlist with hyphennames key: \def\do##1{% - \ifcsdef{l@#1}{}{% + \xpg@check@ifdefined{#1} + \if@xpg@language@really@defined@\else \ifstrequal{#1}{##1}{}% - {\ifcsdef{l@##1}% - {\csletcs{l@#1}{l@##1}\xpg@set@language@luatex@ii{##1}\listbreak}% - {}% + {\xpg@ifdefined{##1}% + {\expandafter\ifx\csname l@##1\endcsname\l@nohyphenation\else\csletcs{l@#1}{l@##1}\xpg@set@language@luatex@iv{##1}\fi}% + {\csdef{l@##1}{l@nohyphenation}}% }% - }% + \fi }% %define all keys: \xpg@define@keys{#1}% @@ -216,20 +222,18 @@ That is almost guaranteed to cause problems.} \csgdef{xpg@langtag@#1}{##1}}% \define@key[xpg@setup]{#1}{hyphennames}[{#1}]{% \docsvlist{##1}% - % \expandafter\show\csname l@##1\endcsname - % \expandafter\show\csname l@#1\endcsname % if l@#1 does not yet exist, % we assign it to nohyphenation % we do this here in case the hyphennames key was omitted - \ifcsundef{l@#1}% + \xpg@ifdefined{#1}{}% {\xpg@nopatterns{\csname xpg@langname@#1\endcsname}% - \expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax}{}% + \expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax}% \csdef{#1@language}{% \ifbool{xpg@hyphenation@disabled}{% \xdef\xpg@lastlanguage{\the\csname l@#1\endcsname}% }{% \ifluatex% - \xpg@set@language@luatex@ii{#1}% + \xpg@set@language@luatex@iv{#1}% \fi% \language=\csname l@#1\endcsname% }% @@ -240,7 +244,7 @@ That is almost guaranteed to cause problems.} \togglefalse{#1@RL}% \or \toggletrue{#1@RL}% - \ifcsundef{RTL}{\ifluatex\RequirePackage{luabidi}\else\RequirePackage{bidi}\fi}{}% + \ifcsundef{RTL}{\ifluatex\RequirePackage{luabidi}\else\RequirePackage{bidi}\fi}{}% FIXME Use \RequireBidi and remove calls in individual gloss files. \fi}% {\xpg@warning{#1: Invalid value \val\space for key "direction"}}% \define@key[xpg@setup]{#1}{hyphenmins}[{2,3}]% @@ -276,7 +280,7 @@ That is almost guaranteed to cause problems.} \ifbool{xpg@hyphenation@disabled}{}{% \booltrue{xpg@hyphenation@disabled}% \xdef\xpg@lastlanguage{\the\language}% - \xpg@set@language@luatex@ii{nohyphenation} + \xpg@set@language@luatex@iv{nohyphenation} \language=\l@nohyphenation% \ifluatex % \directlua{polyglossia.disable_hyphenation()}% @@ -516,6 +520,7 @@ That is almost guaranteed to cause problems.} \input{#1}\catcode`\@=\xpg@atcatcode} \newcommand{\setdefaultlanguage}[2][]{% + \edef\xpg@loaded{#2\ifx\xpg@loaded\@empty\else,\xpg@loaded\fi}% \IfFileExists{gloss-#2.ldf}% {\ifcsundef{#2@loaded}% {\xpg@input{gloss-#2.ldf}% @@ -630,6 +635,7 @@ That is almost guaranteed to cause problems.} } \newcommand{\setotherlanguage}[2][]{% + \edef\xpg@loaded{#2\ifx\xpg@loaded\@empty\else,\xpg@loaded\fi}% \IfFileExists{gloss-#2.ldf}% {\ifcsundef{#2@loaded}% {\xpg@input{gloss-#2.ldf}% @@ -724,11 +730,25 @@ That is almost guaranteed to cause problems.} \xpg@hook@setlanguage% \let\emp@langname\@undefined}% \aftergroup\xpg@pop@language% + % If the optional argument sets a value for the key “variant”, copy it to xpg@langvariant + \def\do##1{% + \def\xpg@parsekeyvalue####1=####2\relax{% + \def\@tmpa{####1} + \def\@tmpb{variant} + \ifx\@tmpa\@tmpb\setkeys{xpg@langvariant}{##1}\fi + }% + \xpg@parsekeyvalue##1=\relax + }% + \docsvlist{#1} \setkeys{#2}{#1}% \xpg@set@language{#2}% }% } +% Save any variant in csv list of variants +\define@key{xpg@langvariant}{variant}{% + \edef\xpg@vloaded{#1\ifx\xpg@vloaded\@empty\else,\xpg@vloaded\fi}} + \newcommand{\xpg@set@language}[1]{% \select@language{#1}% \if@filesw% @@ -739,22 +759,49 @@ That is almost guaranteed to cause problems.} \fi } +\def\xpg@set@language@luatex@iii#1#2{% + % here we use lu@texhyphen@loaded@\the\language, the same as in babel + \ifcsdef{bbl@hyphendata@#2}{}{% + \global\@namedef{bbl@hyphendata@\the\language}{}% + \directlua{polyglossia.select_language('\luatexluaescapestring{\string#1}', \the\csname l@#1\endcsname)}% + } +} + +\newcommand\xpg@check@ifdefined[1]{% + \expandafter\ifx\csname l@#1\endcsname\relax\@xpg@language@really@defined@false\else + \ifx\csname l@#1\endcsname\l@nohyphenation\@xpg@language@really@defined@false\else + \@xpg@language@really@defined@true + \fi + \fi +} + +\newcommand\xpg@ifdefined[3]{% + \ifluatex + \xpg@set@language@luatex@iv{#1}% + \fi + \xpg@check@ifdefined{#1} + \if@xpg@language@really@defined@#2\else#3\fi +}% + +\newcommand\xpg@set@language@luatex@iv[1]{% + \ifluatex + \xpg@check@ifdefined{#1}% + \if@xpg@language@really@defined@\else + \expandafter\chardef\csname l@#1\endcsname=\directlua{tex.sprint(polyglossia.newloader('#1'))}% + \fi + \language\directlua{tex.sprint(polyglossia.newloader('#1'))}% + \fi +} + \newcommand\xpg@set@language@luatex@ii[1]{% \ifluatex % - % here we use lu@texhyphen@loaded@\the\language, the same as in babel - \expandafter\ifcsname lu@texhyphen@loaded@\the\csname l@#1\endcsname\endcsname \else % - \global\@namedef{lu@texhyphen@loaded@\the\language}{}% - \directlua{polyglossia.select_language('\luatexluaescapestring{\string#1}', \the\csname l@#1\endcsname)}% - \fi % + \xpg@set@language@luatex@iii{#1}{\expandafter\the\csname l@#1\endcsname} \fi % } \def\select@language#1{% \ifluatex % - \ifcsname lu@texhyphen@loaded@\the\language\endcsname \else % - \global\@namedef{lu@texhyphen@loaded@\the\language}{}% - \directlua{polyglossia.select_language('\luatexluaescapestring{\string#1}', \the\csname l@#1\endcsname)}% - \fi % + \xpg@set@language@luatex@iii{#1}{\the\language} \fi % \xpg@initial@setup% \select@@language{#1}% @@ -786,15 +833,15 @@ That is almost guaranteed to cause problems.} {} \newcommand{\setlocalhyphenmins}[3]{% - \expandafter\ifx\csname l@#1\endcsname\relax% - \xpg@warning{\string\setlocalhyphenmin\space~ useless~ for~ unknown~ language~ #1}% - \else + \xpg@ifdefined{#1}{% \expandafter\ifx\csname l@#1\endcsname\l@nohyphenation% \xpg@warning{\string\setlocalhyphenmin\space~ useless~ for~ unhyphenated~ language~ #1}% \else \providehyphenmins{#1}{#2#3}% \fi - \fi} + }{% + \xpg@warning{\string\setlocalhyphenmin\space~ useless~ for~ unknown~ language~ #1}% + }}% \def\use@localhyphenmins#1{% \ifcsundef{#1hyphenmins}{}% @@ -802,7 +849,7 @@ That is almost guaranteed to cause problems.} \define@boolkey{polyglossia}[system@]{babelshorthands}[false]{} -\AtEndPreamble{\@ifpackageloaded{bidi}{\providecommand*{\aemph}[1]{$\overline{\hboxR{#1}}$}}{}} +\AtEndPreamble{\@ifpackageloaded{bidi}{\providecommand*{\aemph}[1]{$\overline{\hboxR{#1}}$}}{}}% TODO Make that work for luabidi too. %% Package Options %% \DeclareOption{nolocalmarks}{\setkeys{polyglossia}{localmarks=false}} @@ -819,26 +866,6 @@ That is almost guaranteed to cause problems.} \def\xpg@option#1#2{% \ifcsundef{xpg@main@language}{\setdefaultlanguage}{\setotherlanguage}% [#1]{#2}} -%\DeclareOption{USenglish}{\xpg@option{variant=american}{english}} -%\DeclareOption{american}{\xpg@option{variant=american}{english}} -%\DeclareOption{UKenglish}{\xpg@option{variant=british}{english}} -%\DeclareOption{british}{\xpg@option{variant=british}{english}} -%\DeclareOption{australian}{\xpg@option{variant=australian}{english}} -%\DeclareOption{newzealand}{\xpg@option{variant=newzealand}{english}} -%\DeclareOption{ngerman}{\xpg@option{spelling=new}{german}} -%\DeclareOption{polygreek}{\xpg@option{variant=poly}{greek}} -%\DeclareOption{monogreek}{\xpg@option{variant=mono}{greek}} -%\DeclareOption{ancientgreek}{\xpg@option{variant=ancient}{greek}} -%%% TODO add warning message that this approach is deprecated <<<<<<<<<<<<<< -%\DeclareOption*{% -% \edef\@temp{% -% \noexpand\ifcsundef{xpg@main@language}% -% \noexpand\setdefaultlanguage -% \noexpand\setotherlanguage -% {\CurrentOption}% -% }% -% \expandafter\AtEndOfPackage\expandafter{\@temp}% -%} \ExplSyntaxOff \ProcessOptions* \endinput |