diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luavlna/luavlna.sty | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/luavlna/luavlna.tex | 29 |
2 files changed, 22 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty b/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty index 89e6d475435..31fb0ba4380 100644 --- a/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty +++ b/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty @@ -1,4 +1,4 @@ -\ProvidesPackage{luavlna}[2021-01-08 luavlna] +\ProvidesPackage{luavlna}[2021-03-02 luavlna] \RequirePackage{kvoptions} @@ -23,7 +23,7 @@ \def\enablesplithyphens#1{% \ifcsname l@#1\endcsname% - \typeout{set lang #1, \the\csname l@#1\endcsname} + \typeout{set lang #1, \the\csname l@#1\endcsname}% \directlua{enable_split_hyphens("\the\csname l@#1\endcsname")}% \fi% } diff --git a/Master/texmf-dist/tex/luatex/luavlna/luavlna.tex b/Master/texmf-dist/tex/luatex/luavlna/luavlna.tex index ab47b8d6fcf..dd7415534d8 100644 --- a/Master/texmf-dist/tex/luatex/luavlna/luavlna.tex +++ b/Master/texmf-dist/tex/luatex/luavlna/luavlna.tex @@ -51,7 +51,7 @@ set_compounds = function(lang, compounds) end set_main_language = function(lang) - local langid = languages:get_number(lang) + local langid = get_lang_id(lang) if not langid then return nil, "Cannot find language number for: "..lang end luavlna.set_main_language(langid) end @@ -69,22 +69,33 @@ disable_split_hyphens = function(lang) end } +% the langno library supports both numeric and literal names +% we can try to find the language ID from macros first, if it fails +% we pass the language name to Lua. it will try to find ID in luanguage.dat and other sources +\def\singlecharsgetlang#1{% + \ifcsname lang@#1\endcsname% + \the\csname lang@#1\endcsname% + \else% unknown language macro, let langno library to find it + #1% + \fi% +} + % Set letters which are prevented from breaking \def\singlechars#1#2{% -\directlua{set_singlechars("#1","#2")} + \directlua{set_singlechars("\singlecharsgetlang{#1}","#2")}% } % Define compound initials \def\compoundinitials#1#2{% -\directlua{set_compounds("#1","#2")} + \directlua{set_compounds("\singlecharsgetlang{#1}","#2")}% } % Enable inserting of visual marks for debugging \def\preventsingledebugon{% -\directlua{luavlna.debug(true)} +\directlua{luavlna.debug(true)}% } \def\preventsinglelang#1{% - \directlua{set_main_language("#1")} + \directlua{set_main_language("\singlecharsgetlang{#1}")}% } %\newluatexattribute\preventsinglestatus @@ -94,18 +105,18 @@ end \preventsinglestatus=2 } -\def\preventsingleoff{ +\def\preventsingleoff{% \preventsinglestatus=1 } % Disable inserting of visual marks for dewbugging \def\preventsingledebugoff{% -\directlua{luavlna.debug(false)} +\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")}} +\def\enablesplithyphens#1{\directlua{enable_split_hyphens("\singlecharsgetlang{#1}")}} +\def\disablesplithyphens#1{\directlua{disable_split_hyphens("\singlecharsgetlang{#1}")}} % disable processing of units or degrees |