-local function suppress_hyphenate_ja(head)
- local non_math = true
- for p in node_traverse(head) do
- if p.id == id_glyph and non_math then
- if (has_attr(p, attr_icflag) or 0)==0 and ltjc_is_ucs_in_japanese_char(p) then
- p.font = has_attr(p, attr_curjfnt) or p.font
- set_attr(p, attr_jchar_class, p.char)
- set_attr(p, attr_yablshift, has_attr(p, attr_ykblshift) or 0)
- p.subtype = floor(p.subtype/2)*2
- end
- elseif p.id == id_math then
- non_math = (p.subtype ~= 0)
+ local suppress_hyphenate_ja_aux = {}
+ suppress_hyphenate_ja_aux[id_glyph] = function(p)
+ if (has_attr(p, attr_icflag) or 0)<=0 and is_ucs_in_japanese_char(p) then
+ local pc = getchar(p)
+ local pf = ltjf_replace_altfont(has_attr(p, attr_curjfnt) or getfont(p), pc)
+ setfield(p, 'font', pf); set_attr(p, attr_curjfnt, pf)
+ setfield(p, 'subtype', floor(getsubtype(p)*0.5)*2)
+ set_attr(p, attr_orig_char, pc)