OSDN Git Service

Releases 20150906.0
[luatex-ja/luatexja.git] / src / ltj-jfmglue.lua
index 6f83853..3a7101e 100644 (file)
@@ -3,7 +3,7 @@
 --
 luatexbase.provides_module({
   name = 'luatexja.jfmglue',
-  date = '2015/02/07',
+  date = '2015/05/03',
   description = 'Insertion process of JFM glues and kanjiskip',
 })
 module('luatexja.jfmglue', package.seeall)
@@ -66,7 +66,7 @@ local id_box_like  = 256 -- vbox, shifted hbox
 local id_pbox      = 257 -- already processed nodes (by \unhbox)
 local id_pbox_w    = 258 -- cluster which consists of a whatsit
 local sid_user = node.subtype('user_defined')
-local lang_ja = token.create('ltj@@japanese')[2]
+local lang_ja = luatexja.lang_ja
 
 local sid_start_link = node.subtype('pdf_start_link')
 local sid_start_thread = node.subtype('pdf_start_thread')
@@ -353,8 +353,8 @@ local function calc_np_aux_glyph_common(lp)
               local ls = getsubtype(lx)
               if ls==2 then -- アクセント用の kern
                  set_attr(lx, attr_icflag, PROCESSED)
-                 lx = node_next(lx) -- lp: アクセント本体
-                 setfield(lx, 'yoffset', getfield(lp, 'yoffset') - (has_attr(lx,attr_ablshift) or 0))
+                 lx = node_next(lx) -- lx: アクセント本体
+                 setfield(lx, 'yoffset', getfield(lx, 'yoffset') - (has_attr(lx,attr_ablshift) or 0))
                  lx = node_next(node_next(lx))
               elseif ls==0  then
                  Np.last = lx
@@ -384,7 +384,9 @@ local function calc_np_aux_glyph_common(lp)
         if r then
            local nf, nc = getfont(npn), getchar(npn)
            local ct = (font.getfont(nf) or font.fonts[nf] ).characters[nc]
-           if (ct.left_protruding or 0) == 0 then
+           if not ct then -- variation selector
+              node_free(r)
+           elseif (ct.left_protruding or 0) == 0 then
               head = insert_before(head, npn, r)
               Np.first = (Np.first==npn) and r or npn
            elseif (ct.right_protruding or 0) == 0 then