summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/luavlna/luavlna.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-10-23 03:00:42 +0000
committerNorbert Preining <norbert@preining.info>2019-10-23 03:00:42 +0000
commit43e60b98142683b95336b9086ee52f4daefff93e (patch)
treec435859ab7275b2cb9f3c2f5ca83dafe20968ad6 /macros/luatex/generic/luavlna/luavlna.tex
parent7bf461efa5036b361e9500c4ed5c675cc819652c (diff)
CTAN sync 201910230300
Diffstat (limited to 'macros/luatex/generic/luavlna/luavlna.tex')
-rw-r--r--macros/luatex/generic/luavlna/luavlna.tex19
1 files changed, 19 insertions, 0 deletions
diff --git a/macros/luatex/generic/luavlna/luavlna.tex b/macros/luatex/generic/luavlna/luavlna.tex
index f3c44f1b69..a0fb9e515e 100644
--- a/macros/luatex/generic/luavlna/luavlna.tex
+++ b/macros/luatex/generic/luavlna/luavlna.tex
@@ -5,6 +5,7 @@ langno = require "luavlna-langno"
require "ltluatex"
luatexbase.add_to_callback("pre_linebreak_filter", luavlna.preventsingle,"LuaVlna")
+luatexbase.add_to_callback("hyphenate", luavlna.split_hyphens, "allow hyphen breaks")
% -- define the attribute number
luavlna.preventsingleid = math.random(2^16)
@@ -54,6 +55,18 @@ set_main_language = function(lang)
if not langid then return nil, "Cannot find language number for: "..lang end
luavlna.set_main_language(langid)
end
+
+enable_split_hyphens = function(lang)
+ local langid = languages:get_number(lang)
+ if not langid then return nil, "Cannot find language number for: "..lang end
+ luavlna.split_hyphen_langs[langid] = true
+end
+
+disable_split_hyphens = function(lang)
+ local langid = languages:get_number(lang)
+ if not langid then return nil, "Cannot find language number for: "..lang end
+ luavlna.split_hyphen_langs[langid] = nil
+end
}
% Set letters which are prevented from breaking
@@ -89,6 +102,11 @@ end
\directlua{luavlna.debug(false)}
}
+% enable/disable split hyphens for a language
+
+\def\enablesplithyphens#1{\directlua{enable_split_hyphens("#1")}}
+\def\disablesplithyphens#1{\directlua{disable_split_hyphens("#1")}}
+
% disable processing of units or degrees
\def\nopredegrees{\directlua{luavlna.no_predegrees = true}}
@@ -99,5 +117,6 @@ end
\singlechars{czech}{AIiVvOoUuSsZzKk}
\singlechars{slovak}{AIiVvOoUuSsZzKk}
\compoundinitials{czech}{Ch,CH}
+ \enablesplithyphens{czech}
\fi