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 errors: ltjb.package_error() is called with a table argument in ltj-charrange...
[luatex-ja/luatexja.git]
/
src
/
ltj-jfont.lua
diff --git
a/src/ltj-jfont.lua
b/src/ltj-jfont.lua
index
9b791a6
..
3acba6d
100644
(file)
--- a/
src/ltj-jfont.lua
+++ b/
src/ltj-jfont.lua
@@
-25,7
+25,7
@@
local id_glue_spec = node.id('glue_spec')
local id_glue = node.id('glue')
local cat_lp = luatexbase.catcodetables['latex-package']
local ITALIC = 1
local id_glue = node.id('glue')
local cat_lp = luatexbase.catcodetables['latex-package']
local ITALIC = 1
-local FROM_JFM =
4
+local FROM_JFM =
6
------------------------------------------------------------------------
-- LOADING JFM
------------------------------------------------------------------------
------------------------------------------------------------------------
-- LOADING JFM
------------------------------------------------------------------------
@@
-61,7
+61,12
@@
function define_jfm(t)
elseif type(w) == 'string' and utf.len(w)==1 then
real_char = true; w = utf.byte(w)
elseif type(w) == 'string' and utf.len(w)==2 and utf.sub(w,2) == '*' then
elseif type(w) == 'string' and utf.len(w)==1 then
real_char = true; w = utf.byte(w)
elseif type(w) == 'string' and utf.len(w)==2 and utf.sub(w,2) == '*' then
- real_char = true; w = -utf.byte(utf.sub(w,1,1))
+ real_char = true; w = utf.byte(utf.sub(w,1,1))
+ if not t.chars[-w] then
+ t.chars[-w] = i
+ else
+ defjfm_res= nil; return
+ end
end
if not t.chars[w] then
t.chars[w] = i
end
if not t.chars[w] then
t.chars[w] = i
@@
-69,6
+74,9
@@
function define_jfm(t)
defjfm_res= nil; return
end
end
defjfm_res= nil; return
end
end
+ if type(v.align)~='string' then
+ v.align = 'left' -- left
+ end
if real_char then
if not (type(v.width)=='number' or v.width~='prop') then
defjfm_res= nil; return
if real_char then
if not (type(v.width)=='number' or v.width~='prop') then
defjfm_res= nil; return
@@
-88,9
+96,6
@@
function define_jfm(t)
if type(v.down)~='number' then
v.down = 0.0
end
if type(v.down)~='number' then
v.down = 0.0
end
- if type(v.align)=='nil' then
- v.align = 'left'
- end
end
end
v.chars = nil
end
end
v.chars = nil
@@
-100,6
+105,13
@@
function define_jfm(t)
for j in pairs(v.glue) do
if v.kern[j] then defjfm_res= nil; return end
end
for j in pairs(v.glue) do
if v.kern[j] then defjfm_res= nil; return end
end
+ for j,x in pairs(v.kern) do
+ if type(x)=='number' then
+ v.kern[j] = {x, 0}
+ elseif type(x)=='table' then
+ v.kern[j] = {x[1], x[2] or 0}
+ end
+ end
t.char_type[i] = v
t[i] = nil
end
t.char_type[i] = v
t[i] = nil
end
@@
-134,10
+146,15
@@
local function update_jfm_cache(j,sz)
for i,v in pairs(t.char_type) do
if type(i) == 'number' then -- char_type
for k,w in pairs(v.glue) do
for i,v in pairs(t.char_type) do
if type(i) == 'number' then -- char_type
for k,w in pairs(v.glue) do
- local g, h = node.new(id_glue), node_new(id_glue_spec); v.glue[k] = g
+ local g, h = node.new(id_glue), node_new(id_glue_spec)
+ v.glue[k] = {g, (w[5] and w[5]/sz or 0)}
h.width, h.stretch, h.shrink = w[1], w[2], w[3]
h.stretch_order, h.shrink_order = 0, 0
h.width, h.stretch, h.shrink = w[1], w[2], w[3]
h.stretch_order, h.shrink_order = 0, 0
- g.subtype = 0; g.spec = h; set_attr(g, attr_icflag, FROM_JFM);
+ g.subtype = 0; g.spec = h; set_attr(g, attr_icflag, FROM_JFM +
+ (w[4] and w[4]/sz or 0));
+ end
+ for k,w in pairs(v.kern) do
+ w[2] = w[2]/sz
end
end
end
end
end
end