X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Fltj-charrange.lua;h=66bdcbc9d6dcd29d02f25884155af68c27e9d639;hb=0526b27bf88ed7f2adedef267f4d9226f6f5a692;hp=79002cb19297a80ce1052a07a18804fe23f8afc4;hpb=7098bdc2e3608c04ea4142085f3b7feaa04ae452;p=luatex-ja%2Fluatexja.git diff --git a/src/ltj-charrange.lua b/src/ltj-charrange.lua index 79002cb..66bdcbc 100644 --- a/src/ltj-charrange.lua +++ b/src/ltj-charrange.lua @@ -3,7 +3,7 @@ -- luatexbase.provides_module({ name = 'luatexja.charrange', - date = '2014/01/19', + date = '2014/05/08', description = 'Handling the range of Japanese characters', }) module('luatexja.charrange', package.seeall) @@ -18,6 +18,7 @@ local has_attr_node = node.has_attribute local tex_getattr = tex.getattribute ATTR_RANGE = 7 +local jcr_cjk, jcr_noncjk = 0, 1 local floor = math.floor local pow = math.pow local kcat_attr_table = {} @@ -39,7 +40,7 @@ pow_table[31*ATTR_RANGE] = pow(2, 31) -- initialize jcr_table_main = {} local jcr_table_main = jcr_table_main -local jcr_cjk = 0; local jcr_noncjk = 1; local ucs_out = 0x110000 +local ucs_out = 0x110000 for i=0x80 ,0xFF do jcr_table_main[i]=1 end for i=0x100,ucs_out-1 do jcr_table_main[i]=0 end @@ -69,9 +70,9 @@ end function char_to_range(c) -- return the external range number c=ltjb.in_unicode(c, false) if c<0x80 then return -1 - else + else local r = jcr_table_main[c] or 217 - return (r and r~=0) and r or 217 + return (r and r~=0) and r or 217 end end