OSDN Git Service

ltjsclasses: sync with jsclasses (\topskip=1.38\zh)
[luatex-ja/luatexja.git] / src / luatexja.lua
index 67a9e9b..2cf0075 100644 (file)
@@ -230,8 +230,8 @@ end
 do
    luatexja.binary_pars = {
       jacharrange = function(c, t)
-        if type(c)~='number' or c<0 or c>31*ltjc.ATTR_RANGE then
-           -- 0 はエラーにしない(隠し)
+        if type(c)~='number' or c<-1 or c>31*ltjc.ATTR_RANGE then
+           -- 0, -1 はエラーにしない(隠し)
            ltjb.package_error('luatexja',
                               'invalid character range number (' .. tostring(c) .. ')',
                               'A character range number should be in the range 1..'
@@ -344,6 +344,24 @@ function luatexja.ext_cleanup()
 end
 
 
+-- lastnodechar
+do
+   local id_glyph = node.id('glyph')
+   function luatexja.pltx_composite_last_node_char()
+      local n = tex.nest[tex.nest.ptr].tail
+      local r = '-1'
+      if n then
+        if n.id==id_glyph then
+           while n.componetns and  n.subtype and n.subtype%4 >= 2 do
+              n = node.tail(n)
+           end
+           r = tostring(n.char)
+        end
+      end
+      tex.sprint(r)
+   end
+end
+
 -- debug
 
 do
@@ -380,6 +398,7 @@ local function debug_show_node_X(p,print_fn, limit)
          .. tostring(p.font)
          .. ' (' .. print_scaled(p.height) .. '+'
          .. print_scaled(p.depth) .. ')x' .. print_scaled(p.width)
+         .. ' xoff: ' .. print_scaled(p.xoffset)
       print_fn(s)
    elseif pt=='hlist' or pt=='vlist' or pt=='unset'or pt=='ins' then
       if pt=='ins' then