OSDN Git Service

altfont
[luatex-ja/luatexja.git] / src / ltj-jfmglue.lua
index 2a726e0..5b864ff 100644 (file)
@@ -3,7 +3,7 @@
 --
 luatexbase.provides_module({
   name = 'luatexja.jfmglue',
-  date = '2018/02/18',
+  date = '2018/08/11',
   description = 'Insertion process of JFM glues, [x]kanjiskip and others',
 })
 luatexja.jfmglue = luatexja.jfmglue or {}
@@ -272,7 +272,8 @@ do
 local traverse = node.direct.traverse
 local function check_next_ickern(lp)
    local lx = Np.nuc
-   while lp and getid(lp) == id_kern and ( getsubtype(lp)==3 or ITALIC == get_attr_icflag(lp)) do
+   while lp and getid(lp) == id_kern and ( getsubtype(lp)==0 or 
+     getsubtype(lp)==3 or ITALIC == get_attr_icflag(lp)) do
      set_attr(lp, attr_icflag, IC_PROCESSED);
      lx, lp = lp, node_next(lp)
    end
@@ -280,7 +281,9 @@ local function check_next_ickern(lp)
 end
 
 local function calc_np_pbox(lp, last)
-   local first, lpa, nc = (not Np.first), get_attr_icflag(lp), nil
+   local first, nc = (not Np.first), nil
+   --local lpa = get_attr_icflag(lp)==PACKED and PACKED or KINSOKU -- KINSOKU: dummy
+   local lpa = get_attr_icflag(lp)
    Np.first = Np.first or lp; Np.id = id_pbox
    set_attr(lp, attr_icflag, get_attr_icflag(lp));
    while lp ~=last and (lpa>=PACKED) and (lpa<BOXBDD) do
@@ -606,9 +609,11 @@ do
         local f = (lig ==1) and nullfunc or node_tail
          local xc, xs = getcomponents(x), getsubtype(x)
         while xc and xs and xs%4>=2 do
-           x = f(xc); xc, xs = getcomponents(x), getsubtype(x)
+           x = f(xc);
+           if getid(x)==id_disc then x, xc, xs = nil, getfield(x,'replace'), 2
+           else xc, xs = getcomponents(x), getsubtype(x) end
         end
-        c = getchar(x)
+        c = x and getchar(x) or c
         Nx.pre  = table_current_stack[PRE + c]  or 0
         Nx.post = table_current_stack[POST + c] or 0
       else
@@ -722,7 +727,7 @@ local function new_jfm_glue(mc, bc, ac)
           return node_copy(g[1]), g.ratio, false, false, false
        else
         local f = node_new(id_glue)
-        set_attr(f, attr_icflag, g.priority)
+         set_attr(f, attr_icflag, g.priority)
         setglue(f, g.width, g.stretch, g.shrink)
         return f, g.ratio, g.kanjiskip_natural, g.kanjiskip_stretch, g.kanjiskip_shrink
       end
@@ -1341,4 +1346,4 @@ do
 end
 
 luatexja.jfmglue.after_hlist = after_hlist
-luatexja.jfmglue.check_box_high = check_box_high
\ No newline at end of file
+luatexja.jfmglue.check_box_high = check_box_high