function luatexja.direction.vsplit()
local n = scan_int();
local p = to_direct(tex_getbox(n))
- split_dir_head = nil
+ if split_dir_head then node_free(split_dir_head); split_dir_head = nil end
+ if split_dir_whatsit then split_dir_watsit = nil end
+ split_dir_head = nil; split_dir_whatsit=nil
if p then
local bh = getlist(p)
if getid(bh)==id_whatsit and getsubtype(bh)==sid_user and getfield(bh, 'user_id')==DIR
if split_dir_whatsit then
-- adjust direction of 'split_keep'
set_attr(split_dir_whatsit, attr_dir, ltjs.list_dir)
+ split_dir_whatsit=nil
end
- split_dir_whatsit=nil
elseif gc=='preamble' then
split_dir_whatsit=nil
else
local attr_yablshift = luatexbase.attributes['ltj@yablshift']
local attr_tablshift = luatexbase.attributes['ltj@tablshift']
local getcount, abs, scan_keyword = tex.getcount, math.abs, token.scan_keyword
+ local tex_nest = tex.nest
local get_current_jfont
do
local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
-- * (X)KANJI_SKIP(_JFM): その場で値が決まっている
-- * PROCESSED_BEGIN_FLAG + (X)KANJI_SKIP: 段落終了時に決める
local function insert_k_skip_common(ind, name, ica, icb)
- if abs(tex.nest[tex.nest.ptr].mode) ~= ltjs.hmode then return end
+ if abs(tex_nest[tex_nest.ptr].mode) ~= ltjs.hmode then return end
local g = node_new(id_glue); set_attr(g, attr_icflag, SPECIAL_JAGLUE)
local is_late = scan_keyword("late")
if not is_late then
local is_ucs_in_japanese_char = ltjc.is_ucs_in_japanese_char_direct
local ensure_tex_attr = ltjb.ensure_tex_attr
local node_write = node.direct.write
- local font = font
+ local fonts, tex_nest = font.fonts, tex.nest
local new_ic_kern = function(g) return node_new(id_kern,3) end
local dir_tate = luatexja.dir_table.dir_tate
-- EXT: italic correction
function luatexja.jfont.append_italic()
- local p = to_direct(tex.nest[tex.nest.ptr].tail)
+ local p = to_direct(tex_nest[tex_nest.ptr].tail)
local TEMP = node_new(id_kern)
if p and getid(p)==id_glyph then
if is_ucs_in_japanese_char(p) then
node_write(g); ensure_tex_attr(attr_icflag, 0)
else
local f = getfont(p)
- local h = font_getfont(f) or font.fonts[f]
+ local h = font_getfont(f) or fonts[f]
if h then
- local g = new_ic_kern()
if h.characters[getchar(p)] and h.characters[getchar(p)].italic then
+ local g = new_ic_kern()
setfield(g, 'kern', h.characters[getchar(p)].italic)
node_write(g); ensure_tex_attr(attr_icflag, 0)
end
local make_dir_whatsit = luatexja.direction.make_dir_whatsit
local get_dir_count = luatexja.direction.get_dir_count
local node_write = node.direct.write
+local tex_nest = tex.nest
local function dir_adjust_append_vlist(b, loc, prev, mirrored)
local old_b = to_direct(b)
local bw = texget('baselineskip', false)
local normal = bw - prev - getfield(new_b, mirrored and 'depth' or 'height')
local lmin, adj = nil, 0
- local tail = to_direct(tex.nest[tex.nest.ptr].tail)
+ local tail = to_direct(tex_nest[tex_nest.ptr].tail)
if p_dummy~=ltj_profiler then
while tail and (id_glue<=getid(tail)) and (getid(tail)<=id_penalty) do
tail = node_prev(tail)