first_char = p; find_first_char = false
end
last_char = p; found_visible_node = true; p=node_next(p)
- if (not p) or p==box_end then return found_visible_node end
+ if (not p) or p==box_end then
+ return found_visible_node
+ end
until p.id~=id_glyph
pid = p.id -- p must be non-nil
end
if check_box(box_ptr, box_end) then
local first_char = first_char
if first_char then
- if first_char.id==glyph_node then
+ if first_char.id==id_glyph then
if first_char.font == (has_attr(first_char, attr_curjfnt) or -1) then
set_np_xspc_jachar(Nx, first_char)
else
local calc_np_auxtable = {
- [id_glyph] = function (lp)
+ [id_glyph] = function (lp)
Np.first, Np.nuc = (Np.first or lp), lp;
Np.id = (lp.font == (has_attr(lp, attr_curjfnt) or -1)) and id_jglyph or id_glyph
--set_attr_icflag_processed(lp) treated in ltj-setwidth.lua
if lp.subtype==2 then
set_attr(lp, attr_icflag, PROCESSED); lp = node_next(lp)
set_attr(lp, attr_icflag, PROCESSED); lp = node_next(lp)
- set_attr(lp, attr_icflag, PROCESSED); Np = node_next(lp)
+ set_attr(lp, attr_icflag, PROCESSED); lp = node_next(lp)
set_attr(lp, attr_icflag, PROCESSED); Np.nuc = lp
Np.id = (lp.font == (has_attr(lp, attr_curjfnt) or -1)) and id_jglyph or id_glyph
return true, check_next_ickern(node_next(lp));
for k = 1,#Bp do Bp[k] = nil end
while lp ~= last do
local lpa = has_attr(lp, attr_icflag) or 0
- -- unbox 由来ノードの検出
+ -- unbox 由来ノードの検出
if lpa>=PACKED then
if lpa == BOXBDD then
local lq = node_next(lp)
function set_np_xspc_alchar(Nx, c,x, lig)
if c~=-1 then
local xc, xs = x.components, x.subtype
- if lig == ligature_head then
+ if lig == 1 then
while xc and xs and xs%4>=2 do
x = xc; xc, xs = x.components, x.subtype
end
function after_hlist(Nx)
local s = Nx.last_char
if s then
- if s.id==glyph_node then
+ if s.id==id_glyph then
if s.font == (has_attr(s, attr_curjfnt) or -1) then
set_np_xspc_jachar(Nx, s)
else
end
lp = calc_np(lp, last)
while Np do
- extract_np(); adjust_nq()
+ extract_np();
+ adjust_nq();
local pid, pm = Np.id, Np.met
-- 挿入部
if pid == id_jglyph then
luatexbase.add_to_callback("luatexja.jfmglue.whatsit_after", whatsit_after_callback,
"luatexja.beginpar.np_info_after", 1)
-end
\ No newline at end of file
+end
local node_new = node.new
local id_whatsit = node.id('whatsit')
local sid_user = node.subtype('user_defined')
-local hmode = 118 -- in luatexref-t.pdf, this must be 127
+hmode = 0 -- dummy
charprop_stack_table={};
local charprop_stack_table = charprop_stack_table
charprop_stack_table[0]={}
--- modified from table.fastcopy
-local next = next
-local function stack_table_copy_aux(old)
- local new = {}
- for i,v in next, old do
- new[i] = v
- end
- return new
-end
-local function stack_table_copy(old)
- if old then
- local new = {}
- for i,v in next, old do
- new[i] = stack_table_copy_aux(v)
- end
- return new
- else
- return {}
- end
-end
function get_stack_level()
local i = tex.getcount('ltj@@stack')
for k,v in pairs(charprop_stack_table) do -- clear the stack above i
if k>=i then charprop_stack_table[k]=nil end
end
- charprop_stack_table[i] = stack_table_copy(charprop_stack_table[i-1])
+ charprop_stack_table[i] = table.fastcopy(charprop_stack_table[i-1])
tex.setcount('ltj@@stack', i)
if gd>0 then tex.globaldefs = gd end
if tex.nest[tex.nest.ptr].mode == hmode or
-- EXT
function set_stack_table(g,m,c,p,lb,ub)
- print(g,m,c)
local i = get_stack_level()
if type(p)~='number' or p<lb or p>ub then
ltjb.package_error('luatexja',