--- trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch  2011/08/18 10:21:01
+++ trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch  2011/08/18 13:52:11
@@ -46,6 +46,7 @@
 % (31/12/2010) AK  Bug fix and accent Kanji by Hironori Kitagawa.
 % (19/01/2011) PB  Let \lastkern etc act through disp node.
 % (15/04/2011) PB  pTeX p3.2 Add \ifdbox and \ifddir
+% (2011-08-18) PB  Bug fix by Hironori Kitagawa.
 %
 @x [1.2] l.200 - pTeX:
 @d banner==TeX_banner
@@ -5848,6 +5849,9 @@
 var @!jc:KANJI_code; {temporary register for KANJI}
 @!sp,@!mp,@!ep:pointer;
 begin@/
+if f=null_font then
+  begin get_jfm_pos:=kchar_type(null_font)(0); return;
+  end;
 jc:=toDVI(kcode);
 sp:=1; { start position }
 ep:=font_num_ext[f]-1; { end position }
@@ -6677,11 +6681,13 @@
 goto main_loop_j+3;
 @#
 main_loop_j+1: space_factor:=1000;
-  fast_get_avail(main_p); font(main_p):=main_f; character(main_p):=cur_l;
-  link(tail):=main_p; tail:=main_p; last_jchr:=tail;
-  fast_get_avail(main_p); info(main_p):=KANJI(cur_chr);
-  link(tail):=main_p; tail:=main_p;
-  cx:=cur_chr; @<Insert kinsoku penalty@>;
+  if main_f<>null_font then
+    begin fast_get_avail(main_p); font(main_p):=main_f; character(main_p):=cur_l;
+    link(tail):=main_p; tail:=main_p; last_jchr:=tail;
+    fast_get_avail(main_p); info(main_p):=KANJI(cur_chr);
+    link(tail):=main_p; tail:=main_p;
+    cx:=cur_chr; @<Insert kinsoku penalty@>;
+  end;
   ins_kp:=false;
 again_2:
   get_next;
@@ -6717,7 +6723,10 @@
 @#
 main_loop_j+3:
   if ins_kp=true then @<Insert |pre_break_penalty| of |cur_chr|@>;
-  @<Look ahead for glue or kerning@>;
+  if main_f<>null_font then 
+    begin @<Look ahead for glue or kerning@>;
+    end
+  else inhibit_glue_flag:=false;
   if ins_kp=false then begin { Kanji -> Kanji }
     goto main_loop_j+1;
   end else if ins_kp=true then begin { Kanji -> Ascii }

