diff options
author | Karl Berry <karl@freefriends.org> | 2021-03-03 22:46:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-03-03 22:46:05 +0000 |
commit | 29c5b5b7c8dd7860e928ef000cd58aa5f4090354 (patch) | |
tree | 28fd4d43d9eb863803fa9563d597deee693841a0 /Master/texmf-dist/tex/luatex/luavlna/luavlna.tex | |
parent | 55d12e426ead530a86b799bcf269c50c70e68f9f (diff) |
luavlna (3mar21)
git-svn-id: svn://tug.org/texlive/trunk@58087 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luavlna/luavlna.tex')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luavlna/luavlna.tex | 29 |
1 files changed, 20 insertions, 9 deletions
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 |