永井@知能.九工大です.

>>>>> "N" == NAGAI Hidetoshi <nagai / dumbo.ai.kyutech.ac.jp> writes:
N> ごめんなさい!
N> TkFont.rb ですが,惚けていて,Tk4.x ではまともに動かないものに
N> なっていました.
N> 修正を急いでいますが,ちょっと問題が大きくて時間がかかりそうです.
N> 今しばらくお待ちください.

急ぎ修正ということで,美しい修正とはいえませんが,
多分動くという程度には修正しました.
この前の unofficial patch からの差分です.
テストしてみていただけますか?

-- 
                                         永井 秀利 (九工大 知能情報)
                                             nagai / ai.kyutech.ac.jp
--- tktext.rb~	Thu Jul 16 11:59:38 1998
+++ tktext.rb	Fri Jul 17 13:43:20 1998
@@ -58,8 +58,11 @@
     fobj = tagfontobj(tag)
     if ltn.kind_of? TkFont
       conf = {}
-      ltn.latin_configinfo.each{|key,val| conf[key] = val}
-      if keys
+      ltn.latin_configinfo.each{|key,val| conf[key] = val if val != []}
+      if conf == {}
+	fobj.latin_replace(ltn)
+	fobj.latin_configure(keys) if keys
+      elsif keys
 	fobj.latin_configure(conf.update(keys))
       else
 	fobj.latin_configure(conf)
@@ -74,8 +77,11 @@
     fobj = tagfontobj(tag)
     if knj.kind_of? TkFont
       conf = {}
-      knj.kanji_configinfo.each{|key,val| conf[key] = val}
-      if keys
+      knj.kanji_configinfo.each{|key,val| conf[key] = val if val != []}
+      if conf == {}
+	fobj.kanji_replace(knj)
+	fobj.kanji_configure(keys) if keys
+      elsif keys
 	fobj.kanji_configure(conf.update(keys))
       else
 	fobj.kanji_configure(conf)
--- tkcanvas.rb~	Thu Jul 16 11:59:38 1998
+++ tkcanvas.rb	Fri Jul 17 13:44:40 1998
@@ -60,8 +60,11 @@
     fobj = tagfontobj(tagOrId)
     if ltn.kind_of? TkFont
       conf = {}
-      ltn.latin_configinfo.each{|key,val| conf[key] = val}
-      if keys
+      ltn.latin_configinfo.each{|key,val| conf[key] = val if val != []}
+      if conf == {}
+	fobj.latin_replace(ltn)
+	fobj.latin_configure(keys) if keys
+      elsif keys
 	fobj.latin_configure(conf.update(keys))
       else
 	fobj.latin_configure(conf)
@@ -76,8 +79,11 @@
     fobj = tagfontobj(tagOrId)
     if knj.kind_of? TkFont
       conf = {}
-      knj.kanji_configinfo.each{|key,val| conf[key] = val}
-      if keys
+      knj.kanji_configinfo.each{|key,val| conf[key] = val if val != []}
+      if conf == {}
+	fobj.kanji_replace(knj)
+	fobj.kanji_configure(keys) if keys
+      elsif keys
 	fobj.kanji_configure(conf.update(keys))
       else
 	fobj.kanji_configure(conf)
--- tkfont.rb~	Thu Jul 16 15:47:57 1998
+++ tkfont.rb	Fri Jul 17 13:39:01 1998
@@ -65,14 +65,27 @@
     case (Tk::TK_VERSION)
     when /^4\.*/
       conf = tk_split_list(tk_call(*args))
-      ltn = conf.assoc('font')[4]
-      ltn = nil if ltn == []
-      knj = conf.assoc('kanjifont')[4]
-      knj = nil if knj == []
-      TkFont.new(ltn, knj).call_font_configure(path, *args)
+      if font_inf = conf.assoc('-font')
+	ltn = font_inf[4]
+	ltn = nil if ltn == []
+      else 
+	#ltn = nil
+	raise RuntimeError, "unknown option '-font'"
+      end
+      if font_inf = conf.assoc('-kanjifont')
+	knj = font_inf[4]
+	knj = nil if knj == []
+      else
+	knj = nil
+      end
+      TkFont.new(ltn, knj).call_font_configure(path, *(args + [{}]))
 
     when /^8\.*/
-      fnt = tk_split_list(tk_call(*(args + ['-font'])))[4]
+      conf = tk_split_list(tk_call(*args))
+      unless font_inf = conf.assoc('-font')
+	raise RuntimeError, "unknown option '-font'"
+      end
+      fnt = font_inf[4]
       if fnt == []
 	TkFont.new(nil, nil).call_font_configure(path, *(args + [{}]))
       else
@@ -475,9 +488,17 @@
 	  if w.include?(';')
 	    win, tag = w.split(';')
 	    winobj = tk_tcl2ruby(win)
-	    winobj.tagfont_configure(tag, {'font'=>@latinfont})
+#	    winobj.tagfont_configure(tag, {'font'=>@latinfont})
+	    if winobj.kind_of? TkText
+	      tk_call(win, 'tag', 'configure', tag, '-font', @latinfont)
+	    elsif winobj.kind_of? TkCanvas
+	      tk_call(win, 'itemconfigure', tag, '-font', @latinfont)
+	    else
+	      raise RuntimeError, "unknown widget type"
+	    end
 	  else
-	    tk_tcl2ruby(w).configure('font', @latinfont)
+#	    tk_tcl2ruby(w).font_configure('font'=>@latinfont)
+	    tk_call(w, 'configure', '-font', @latinfont)
 	  end
 	rescue
 	  Tk_FontUseTBL[w] = nil
@@ -499,9 +520,17 @@
 	  if w.include?(';')
 	    win, tag = w.split(';')
 	    winobj = tk_tcl2ruby(win)
-	    winobj.tagfont_configure(tag, {'kanjifont'=>@kanjifont})
+#	    winobj.tagfont_configure(tag, {'kanjifont'=>@kanjifont})
+	    if winobj.kind_of? TkText
+	      tk_call(win, 'tag', 'configure', tag, '-kanjifont', @kanjifont)
+	    elsif winobj.kind_of? TkCanvas
+	      tk_call(win, 'itemconfigure', tag, '-kanjifont', @kanjifont)
+	    else
+	      raise RuntimeError, "unknown widget type"
+	    end
 	  else
-	    tk_tcl2ruby(w).configure('kanjifont', @kanjifont)
+#	    tk_tcl2ruby(w).font_configure('kanjifont'=>@kanjifont)
+	    tk_call(w, 'configure', '-kanjifont', @kanjifont)
 	  end
 	rescue
 	  Tk_FontUseTBL[w] = nil