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
Fix #39431: support notdef=... (introduced in luaotfload v2.98)
[luatex-ja/luatexja.git]
/
src
/
ltj-compat.lua
diff --git
a/src/ltj-compat.lua
b/src/ltj-compat.lua
index
af5da70
..
bd79854
100644
(file)
--- a/
src/ltj-compat.lua
+++ b/
src/ltj-compat.lua
@@
-18,14
+18,15
@@
end
-- \kuten, \jis, \euc, \sjis, \ucs, \kansuji
-- \kuten, \jis, \euc, \sjis, \ucs, \kansuji
+local utfchar=utf.char
local function to_kansuji(num)
if not num then num=0; return
local function to_kansuji(num)
if not num then num=0; return
- elseif num<0 then
+ elseif num<0 then
num = -num; tex.write('-')
end
local s = ""
while num~=0 do
num = -num; tex.write('-')
end
local s = ""
while num~=0 do
- s = utf
.
char(
+ s = utfchar(
ltjs.get_stack_table(luatexja.stack_table_index.KSJ + num%10,
'', tex.getcount('ltj@@stack'))) .. s
num=math.floor(num/10)
ltjs.get_stack_table(luatexja.stack_table_index.KSJ + num%10,
'', tex.getcount('ltj@@stack'))) .. s
num=math.floor(num/10)
@@
-35,34
+36,34
@@
end
-- \ucs: 単なる identity
local function from_ucs(i)
-- \ucs: 単なる identity
local function from_ucs(i)
- if type(i)~='number' then
+ 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.")
ltjb.package_error('luatexja',
"invalid character code (".. tostring(i) .. ")",
"I'm going to use 0 instead of that illegal character code.")
- i=0
+ i=0
end
tex.write(i)
end
-- \kuten: 面区点 (それぞれで16進2桁を使用)=> Unicode 符号位置
local function from_kuten(i)
end
tex.write(i)
end
-- \kuten: 面区点 (それぞれで16進2桁を使用)=> Unicode 符号位置
local function from_kuten(i)
- if type(i)~='number' then
+ 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.")
ltjb.package_error('luatexja',
"invalid character code (".. tostring(i) .. ")",
"I'm going to use 0 instead of that illegal character code.")
- i=0
+ i=0
end
tex.write(tostring(jisx0208.table_jisx0208_uptex[i] or 0))
end
-- \euc: EUC-JP による符号位置 => Unicode 符号位置
local function from_euc(i)
end
tex.write(tostring(jisx0208.table_jisx0208_uptex[i] or 0))
end
-- \euc: EUC-JP による符号位置 => Unicode 符号位置
local function from_euc(i)
- if type(i)~='number' then
+ 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
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
+ elseif i>=0x10000 or i<0xa0a0 then
i=0
end
from_kuten(i-0xa0a0)
i=0
end
from_kuten(i-0xa0a0)
@@
-70,7
+71,7
@@
end
-- \jis: ISO-2022-JP による符号位置 => Unicode 符号位置
local function from_jis(i)
-- \jis: ISO-2022-JP による符号位置 => Unicode 符号位置
local function from_jis(i)
- if (type(i)~='number') 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.")
ltjb.package_error('luatexja',
"invalid character code (".. tostring(i) .. ")",
"I'm going to use 0 instead of that illegal character code.")
@@
-81,19
+82,19
@@
end
-- \sjis: Shift_JIS による符号位置 => Unicode 符号位置
local function from_sjis(i)
-- \sjis: Shift_JIS による符号位置 => Unicode 符号位置
local function from_sjis(i)
- if (type(i)~='number') 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.")
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
+ tex.write('0'); return
end
local c2 = math.floor(i/256)
local c1 = i%256
local shift_jisx0213_s1a3_table = {
end
local c2 = math.floor(i/256)
local c1 = i%256
local shift_jisx0213_s1a3_table = {
- { [false]= 1, [true]= 8},
- { [false]= 3, [true]= 4},
- { [false]= 5, [true]=12},
- { [false]=13, [true]=14},
+ { [false]= 1, [true]= 8},
+ { [false]= 3, [true]= 4},
+ { [false]= 5, [true]=12},
+ { [false]=13, [true]=14},
{ [false]=15 } }
if c2 >= 0x81 then
if c2 >= 0xF0 then -- this if block won't be true
{ [false]=15 } }
if c2 >= 0x81 then
if c2 >= 0xF0 then -- this if block won't be true
@@
-110,7
+111,7
@@
local function from_sjis(i)
if c1>0x7f then i=0x40 else i=0x3f end
c1 = c1 - i
else
if c1>0x7f then i=0x40 else i=0x3f end
c1 = c1 - i
else
- c1 = c1 - 0x
7
e
+ c1 = c1 - 0x
9
e
end
from_kuten(c2*256+c1)
end
end
from_kuten(c2*256+c1)
end