end
end
-local setfield = node.direct.setfield
-luatexja.setglue = node.direct.setglue or
+do
+ local setfield = node.direct.setfield
+ luatexja.setglue = node.direct.setglue or
function(g,w,st,sh,sto,sho)
- setfield(g,'width', w or 0)
- setfield(g,'stretch',st or 0)
- setfield(g,'shrink', sh or 0)
- setfield(g,'stretch_order',sto or 0)
- setfield(g,'shrink_order', sho or 0)
+ setfield(g,'width', w or 0)
+ setfield(g,'stretch',st or 0)
+ setfield(g,'shrink', sh or 0)
+ setfield(g,'stretch_order',sto or 0)
+ setfield(g,'shrink_order', sho or 0)
end
-
--- check token library
-if newtoken then
- luatexja.token = newtoken
-else
- local luatex_version = status.list().luatex_version
- if luatex_version >80 then
- luatexja.token = token
- end
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..'
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
.. 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