-- index : internal 0, 1, 2, ..., 216 0: 'other'
-- external 1 2 216, (out of range): 'other'
--- initialize
+-- initialize
local jcr_table_main = {}
local jcr_cjk = 0; local jcr_noncjk = 1; local ucs_out = 0x110000
if not ind or ind<0 or ind>=7*ATTR_RANGE then -- 0 は error にしない(隠し)
ltjb.package_error('luatexja',
"invalid character range number (" .. ind .. ")",
- {"A character range number should be in the range 1.."
- .. 7+ATTR_RANGE-1 .. ",",
- "ignored."})
+ "A character range number should be in the range 1.."
+ .. 7+ATTR_RANGE-1 .. ",\n" ..
+ "ignored.")
return
elseif b<0x80 or e>=ucs_out then
ltjb.package_warning('luatexja',
'I take the intersection with [0x80, 0x10ffff].')
elseif b>e then
local j=b; e=b; b=j
- end
+ end
for i=math.max(0x80,b),math.min(ucs_out-1,e) do
jcr_table_main[i]=ind
end
if not c or c<0 or c>0x10FFFF then
ltjb.package_error('luatexja',
'bad character code (' .. tostring(c) .. ')',
- {'A character number must be between 0 and 0x10ffff.',
- 'So I changed this one to zero.'})
+ 'A character number must be between 0 and 0x10ffff.\n' ..
+ 'So I changed this one to zero.')
c=0
elseif c<0x80 then return -1
else return jcr_table_main[c] or 0 end
-- glyph_node p は和文文字か?
function is_ucs_in_japanese_char(p)
local c = p.char
- if c<0x80 then
- return false
- else
- local i=jcr_table_main[c]
+ if c<0x80 then
+ return false
+ else
+ local i=jcr_table_main[c]
return (floor(
- has_attr(p, kcat_attr_table[i])/pow_table[i])%2 ~= jcr_noncjk)
+ has_attr(p, kcat_attr_table[i])/pow_table[i])%2 ~= jcr_noncjk)
end
end
ltjb.package_error('luatexja',
"invalid character range number (" .. tostring(i).. ")",
"A character range number must be a number, ignored.")
- elseif i==0 then return
+ elseif i==0 then return
else
local kc
if i>0 then kc=0 else kc=1; i=-i end