OSDN Git Service

Fix a crash by "\ruby{Weierstraß}{ワイエルシュトラス}"
[luatex-ja/luatexja.git] / src / ltj-pretreat.lua
index 3186ca6..1729c9e 100644 (file)
@@ -103,7 +103,9 @@ do
            while pid==id_glyph do
               local pc = getchar(p)
               if has_attr(p, attr_icflag, 0) and is_ucs_in_japanese_char(p, pc) then
-                 setfont(p, ltjf_replace_altfont(has_attr(p, attr_curjfnt) or getfont(p), pc))
+                  local pf = has_attr(p, attr_curjfnt)
+                  pf = (pf and pf>0 and pf) or getfont(p)
+                 setfont(p, ltjf_replace_altfont(pf, pc))
                  setlang(p, lang_ja)
                  ltjs_orig_char_table[p] = pc
               end
@@ -149,7 +151,7 @@ local function set_box_stack_level(head, mode)
            if ltjf_font_metric_table[nf].vert_activated then
               local pc = getchar(p)
               pc = ltjf_font_metric_table[nf].vform[pc]
-               if pc then print('Replace ', getchar(p) , pc); setchar(p,  pc) end
+               if pc then setchar(p,  pc) end
            end
         end
       end