diff options
author | Karl Berry <karl@freefriends.org> | 2014-02-06 23:28:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-02-06 23:28:44 +0000 |
commit | c33fed8d37bc51a8a9ff5a5f1a806dac56765c8d (patch) | |
tree | f95a9e2a7ddf6ffa449a8d74ecaca762ab845c09 /Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua | |
parent | 55bbd0a3dd6e4f70a9cae6283e0e84b2aba02989 (diff) |
luatexja (4feb14)
git-svn-id: svn://tug.org/texlive/trunk@32895 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua index 6fe8e4fd168..af5da70c41c 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua @@ -4,6 +4,7 @@ luatexja.load_module('base'); local ltjb = luatexja.base luatexja.load_module('stack'); local ltjs = luatexja.stack +local stack_table_index = luatexja.stack_table_index -- load jisx0208 table local cache_ver = 2 @@ -25,7 +26,7 @@ local function to_kansuji(num) local s = "" while num~=0 do s = utf.char( - ltjs.get_penalty_table(luatexja.stack_table_index.KSJ + num%10, + ltjs.get_stack_table(luatexja.stack_table_index.KSJ + num%10, '', tex.getcount('ltj@@stack'))) .. s num=math.floor(num/10) end @@ -115,6 +116,18 @@ local function from_sjis(i) end end +luatexja.binary_pars.kansujichar = function(c, t) + if type(c)~='number' or c<0 or c>9 then + ltjb.package_error('luatexja', + 'Invalid KANSUJI number (' .. tostring(c) .. ')', + 'A KANSUJI number should be in the range 0..9.\n'.. + 'So I changed this one to zero.') + c=0 + end + return ltjs.get_stack_table(stack_table_index.KSJ + c, 0, t) +end + + local t = { from_euc = from_euc, from_kuten = from_kuten, |