summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua27
1 files changed, 20 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua
index e15563a0cef..c360a6e80dd 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua
@@ -24,8 +24,9 @@ local id_kern = node.id('kern')
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 FROM_JFM = 4
+local ITALIC = luatexja.icflag_table.ITALIC
+local FROM_JFM = luatexja.icflag_table.FROM_JFM
+
------------------------------------------------------------------------
-- LOADING JFM
------------------------------------------------------------------------
@@ -74,6 +75,9 @@ function define_jfm(t)
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
@@ -93,9 +97,6 @@ function define_jfm(t)
if type(v.down)~='number' then
v.down = 0.0
end
- if type(v.align)~='string' then
- v.align = 'left'
- end
end
end
v.chars = nil
@@ -105,6 +106,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,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
@@ -139,10 +147,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
- 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
- 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