summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-12-08 22:04:48 +0000
committerKarl Berry <karl@freefriends.org>2020-12-08 22:04:48 +0000
commit50911a5d21723effb8f23757a309ee5993ccfd11 (patch)
tree1b98e4db5a2aceb1acf93531c8e41605ddcdad42 /Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf
parentaed1181dbd8c3dbcc38758e26eecea1bf39b1a22 (diff)
polyglossia (7dec20)
git-svn-id: svn://tug.org/texlive/trunk@57098 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf')
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf50
1 files changed, 49 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf
index 4a698be9fa7..aae310ca027 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf
@@ -12,12 +12,18 @@
% BCP-47 compliant aliases
\setlanguagealias*{croatian}{hr}
+\ifluatex
+ \RequirePackage{luavlna}
+\fi
+
\define@boolkey{croatian}[croatian@]{babelshorthands}[true]{}
\define@boolkey{croatian}[croatian@]{disableligatures}[true]{}
+\define@boolkey{croatian}[croatian@]{splithyphens}[true]{}
+
% Register default options
-\xpg@initialize@gloss@options{croatian}{babelshorthands=false,disableligatures=false}
+\xpg@initialize@gloss@options{croatian}{babelshorthands=false,disableligatures=false,splithyphens=true}
\ifsystem@babelshorthands
\setkeys{croatian}{babelshorthands=true}
@@ -31,6 +37,19 @@
\shorthandoff{"}%
}{}
+\def\croatian@@splhyphen#1{%
+ \ifnum\hyphenchar \font>0%
+ \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
+ \nobreak\hskip\z@%
+ \else%
+ #1%
+ \fi%
+}
+
+\def\croatian@splhyphen{%
+ \croatian@@splhyphen{-}%
+}
+
\def\croatian@shorthands{%
\bbl@activate{"}%
\def\language@group{croatian}%
@@ -60,6 +79,32 @@
\@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}%
}
+\ifxetex
+ % splithyphens
+ \newXeTeXintercharclass\croatian@hyphen % -
+ \newXeTeXintercharclass\croatian@nonsyllabicpreposition%
+\fi
+
+\def\croatian@hyphens{%
+ \ifluatex
+ \AfterPreamble{\enablesplithyphens{croatian}}%
+ \else
+ \XeTeXinterchartokenstate=1
+ \XeTeXcharclass `\- \croatian@hyphen
+ \XeTeXinterchartoks \z@ \croatian@hyphen = {\croatian@@splhyphen}% "-" -> "\croatian@@splhyphen-"
+ % necessary if used together with vlna:
+ \XeTeXinterchartoks \croatian@nonsyllabicpreposition \croatian@hyphen = {\croatian@@splhyphen}% "-" -> "\croatian@@splhyphen-"
+ \fi%
+}
+
+\def\nocroatian@hyphens{%
+ \ifluatex
+ \AfterPreamble{\disablesplithyphens{croatian}}%
+ \else
+ \XeTeXcharclass `\- \z@
+ \fi%
+}
+
\newcommand*\hr@charifavailable[2]{%
\ifcroatian@disableligatures
\bgroup#2\egroup%
@@ -164,14 +209,17 @@
\def\noextras@croatian{%
\ifcroatian@babelshorthands\nocroatian@shorthands\fi%
+ \nocroatian@hyphens%
}
\def\blockextras@croatian{%
\ifcroatian@babelshorthands\croatian@shorthands\fi%
+ \ifcroatian@splithyphens\croatian@hyphens\else\nocroatian@hyphens\fi%
}
\def\inlineextras@croatian{%
\ifcroatian@babelshorthands\croatian@shorthands\fi%
+ \ifcroatian@splithyphens\croatian@hyphens\else\nocroatian@hyphens\fi%
}
\endinput