X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Fltj-jfont.lua;h=3acba6d58bf9f4160854370d9e3b62cd51e4eb05;hb=c35bc9236b8c249d3089a824fe197d0d1cde7e78;hp=e15563a0cef257209affc143d5fb297f989f9359;hpb=4b746683891210cff75916d8afd7c0c60ccfa622;p=luatex-ja%2Fluatexja.git diff --git a/src/ltj-jfont.lua b/src/ltj-jfont.lua index e15563a..3acba6d 100644 --- 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 FROM_JFM = 4 +local FROM_JFM = 6 ------------------------------------------------------------------------ -- LOADING JFM ------------------------------------------------------------------------ @@ -74,6 +74,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 +96,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 +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,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 +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 - 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