OSDN Git Service
(root)
/
luatex-ja
/
luatexja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
優先度付き調整処理のテスト (test17-priority.tex)
[luatex-ja/luatexja.git]
/
src
/
ltj-compat.lua
diff --git
a/src/ltj-compat.lua
b/src/ltj-compat.lua
index
d72cce3
..
6e1da77
100644
(file)
--- a/
src/ltj-compat.lua
+++ b/
src/ltj-compat.lua
@@
-31,35
+31,56
@@
end
-- \ucs: 単なる identity
function from_ucs(i)
-- \ucs: 単なる identity
function from_ucs(i)
+ if type(i)~='number' then
+ ltjb.package_error('luatexja',
+ "invalid character code (".. tostring(i) .. ")",
+ "I'm going to use 0 instead of that illegal character code.")
+ i=0
+ end
tex.write(i)
end
tex.write(i)
end
--- \kuten: 面区点 (それぞれで16進2桁を使用)=> Unicode 符号位置
+-- \kuten: 面区点 (それぞれで16進2桁を使用)=> Unic
haracter c
ode 符号位置
function from_kuten(i)
function from_kuten(i)
- if not i then i=0 end
+ if type(i)~='number' then
+ ltjb.package_error('luatexja',
+ "invalid character code (".. tostring(i) .. ")",
+ "I'm going to use 0 instead of that illegal character code.")
+ i=0
+ end
tex.write(tostring(luatexja.jisx0208.table_jisx0208_uptex[i] or 0))
end
tex.write(tostring(luatexja.jisx0208.table_jisx0208_uptex[i] or 0))
end
--- \euc: EUC-JP による符号位置 => Unicode 符号位置
+-- \euc: EUC-JP による符号位置 => Unic
haracter c
ode 符号位置
function from_euc(i)
function from_euc(i)
- if not i then i=0
+ if type(i)~='number' then
+ ltjb.package_error('luatexja',
+ "invalid character code (".. tostring(i) .. ")",
+ "I'm going to use 0 instead of that illegal character code.")
+ i=0
elseif i>=0x10000 or i<0xa0a0 then
i=0
end
from_kuten(i-0xa0a0)
end
elseif i>=0x10000 or i<0xa0a0 then
i=0
end
from_kuten(i-0xa0a0)
end
--- \jis: ISO-2022-JP による符号位置 => Unicode 符号位置
+-- \jis: ISO-2022-JP による符号位置 => Unic
haracter c
ode 符号位置
function from_jis(i)
function from_jis(i)
- if (not i) or i>=0x10000 or i<0 then
+ if (type(i)~='number') or i>=0x10000 or i<0 then
+ ltjb.package_error('luatexja',
+ "invalid character code (".. tostring(i) .. ")",
+ "I'm going to use 0 instead of that illegal character code.")
i=0
end
from_kuten(i-0x2020)
end
i=0
end
from_kuten(i-0x2020)
end
--- \sjis: Shift_JIS による符号位置 => Unicode 符号位置
+-- \sjis: Shift_JIS による符号位置 => Unic
haracter c
ode 符号位置
function from_sjis(i)
function from_sjis(i)
- if (not i) or i>=0x10000 or i<0 then
+ if (type(i)~='number') or i>=0x10000 or i<0 then
+ ltjb.package_error('luatexja',
+ "invalid character code (".. tostring(i) .. ")",
+ "I'm going to use 0 instead of that illegal character code.")
tex.write('0'); return
end
local c2 = math.floor(i/256)
tex.write('0'); return
end
local c2 = math.floor(i/256)