OSDN Git Service

proportional vertical fonts
[luatex-ja/luatexja.git] / src / ltj-setwidth.lua
index aed10da..2b0c29b 100644 (file)
@@ -107,7 +107,7 @@ local function capsule_glyph_yoko(p, met, char_data, head, dir)
         setfield(box, 'depth', fdepth + kbl)
         setfield(box, 'dir', dir)
         set_attr(box, attr_icflag, PACKED)
-        --set_attr(p, attr_icflag, PACKED)
+        set_attr(p, attr_icflag, PROCESSED)
         head = p and node_insert_before(head, p, box)
            or node_insert_after(head, node_tail(head), box)
         return node_next(p), head, p, box
@@ -173,8 +173,8 @@ local function capsule_glyph_tate(p, met, char_data, head, dir)
    local wm = node_new(id_whatsit, sid_matrix)
    setfield(wm, 'data', '0 1 -1 0')
    local pwnh = -round(0.5*getfield(p, 'width'))
-   local k2 = node_new(id_kern); setfield(k2, 'kern', pwnh)
-   local k3 = node_new(id_kern); setfield(k3, 'kern', -getfield(p, 'width')-pwnh)
+   local k2 = node_new(id_kern, 1); setfield(k2, 'kern', pwnh)
+   local k3 = node_new(id_kern, 1); setfield(k3, 'kern', -getfield(p, 'width')-pwnh)
    local wr = node_new(id_whatsit, sid_restore)
    setfield(box, 'head', ws)
    setfield(ws, 'next', wm);  setfield(wm, 'next', k2);
@@ -191,7 +191,7 @@ luatexja.setwidth.capsule_glyph_tate = capsule_glyph_tate
 local function capsule_glyph_math(p, met, char_data)
    if not char_data then return nil end
    local fwidth, pwidth = char_data.width, getfield(p, 'width')
-   fwidth = (fwidth ~= 'prop') and fwidth or pwidth
+   fwidth = fwidth or pwidth
    fshift.down = char_data.down; fshift.left = char_data.left
    fshift = call_callback("luatexja.set_width", fshift, met, char_data)
    local fheight, fdepth = char_data.height, char_data.depth
@@ -219,7 +219,7 @@ function luatexja.setwidth.apply_ashift_math(head, last, attr_ablshift)
         return
       elseif (has_attr(p, attr_icflag) or 0) ~= PROCESSED then
         if pid==id_hlist or pid==id_vlist then
-           setfield(p, 'shift', getfield(p, 'shift') +  (has_attr(p,attr_ablshift) or 0))
+           setfield(p, 'shift', getfield(p, 'shift') +  (has_attr(p,attr_ablshift) or 0)) 
         elseif pid==id_rule then
            local v = has_attr(p,attr_ablshift) or 0
            setfield(p, 'height', getfield(p, 'height')-v)
@@ -231,6 +231,7 @@ function luatexja.setwidth.apply_ashift_math(head, last, attr_ablshift)
            setfield(p, 'yoffset',
                     getfield(p, 'yoffset') - (has_attr(p,attr_ablshift) or 0))
         end
+         set_attr(p, attr_icflag, PROCESSED)
       end
    end
 end