[#3234] sample of TkFont class — NAGAI Hidetoshi <nagai@...>

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

52 messages 1998/07/08
[#3241] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/09

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

[#3290] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/15

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

[#3291] Re: sample of TkFont class — matz@... (Yukihiro Matsumoto) 1998/07/15

まつもと ゆきひろです

[#3307] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/16

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

[#3309] Re: sample of TkFont class — matz@... (Yukihiro Matsumoto) 1998/07/16

まつもと ゆきひろです

[#3319] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/16

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

[#3321] Re: sample of TkFont class — matz@... (Yukihiro Matsumoto) 1998/07/16

まつもと ゆきひろです

[#3324] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/16

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

[#3367] Re: sample of TkFont class — Tadayoshi Funaba <tadf@...> 1998/07/22

ふなばです。

[#3369] Re: sample of TkFont class — ttate@... 1998/07/22

立石@JAISTです。

[#3370] Re: sample of TkFont class — Tadayoshi Funaba <tadf@...> 1998/07/22

ふなばです。

[#3371] Re: sample of TkFont class — ttate@... 1998/07/23

立石@JAISTです。

[#3292] exprimental release 1.1b9_31 (hopefully final) — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

20 messages 1998/07/15
[#3293] Re: exprimental release 1.1b9_31 (hopefully final) — Takahiro Maebashi <maebashi@...> 1998/07/15

前橋です。

[#3294] Re: exprimental release 1.1b9_31 (hopefully final) — matz@... (Yukihiro Matsumoto) 1998/07/15

まつもと ゆきひろです

[#3295] Re: exprimental release 1.1b9_31 (hopefully final) — Takahiro Maebashi <maebashi@...> 1998/07/15

前橋です。

[ruby-dev:3404] Re: tk.rb patch

From: NAGAI Hidetoshi <nagai@...>
Date: 1998-07-24 08:45:07 UTC
List: ruby-dev #3404
永井@知能.九工大です.

>>>>> "t" == ttate  <ttate@jaist.ac.jp> writes:
t> 今日試しに自宅のLinux(kernel-2.0.35)+Tcl/Tk8.1で
t> やってみましたが、以下のようなエラーです。
t> で同様に以前は動いたはずのtcolorでためしても
t> 同じエラーになりました。

う゛.このパッチを当てるとどうでしょうか?

# 他にも menu.rb が tk8.0 専用になってたことに気付きました.;;;^_^;;;

-- 
                                         永井 秀利 (九工大 知能情報)
                                             nagai@ai.kyutech.ac.jp

--- /usr/src/ruby-1.1c1/lib/tkfont.rb	Fri Jul 17 23:43:28 1998
+++ ./tkfont.rb	Fri Jul 24 17:46:22 1998
@@ -42,7 +42,7 @@
       r | []
 
     when /^8\.*/
-      list(tk_call('font', 'names'))
+      tk_split_simplelist(tk_call('font', 'names'))
 
     end
   end
@@ -89,10 +89,14 @@
       if fnt == []
 	TkFont.new(nil, nil).call_font_configure(path, *(args + [{}]))
       else
-	compound = Hash[*list(tk_call('font', 'configure', 
-				      fnt))].collect{|key,value|
-	  [key[1..-1], value]
-	}.assoc('compound')[1]
+	begin
+	  compound = Hash[*list(tk_call('font', 'configure', 
+					fnt))].collect{|key,value|
+	    [key[1..-1], value]
+	  }.assoc('compound')[1]
+	rescue
+	  compound = []
+	end
 	if compound == []
 	  TkFont.new(fnt, DEFAULT_KANJI_FONT_NAME) \
 	  .call_font_configure(path, *(args + [{}]))
@@ -156,14 +160,19 @@
     elsif font.kind_of? Array
       finfo = {}
       finfo['family'] = font[0].to_s
-      if font[1] && font[1] != '0' && font[1] =~ /^(|\+|-)([0-9]+)$/
-	if $1 == '-'
-	  finfo['pixels'] = font[1].to_s
+      if font[1]
+	fsize = font[1].to_s
+	if fsize != '0' && fsize =~ /^(|\+|-)([0-9]+)$/
+	  if $1 == '-'
+	    finfo['pixels'] = $2
+	  else
+	    finfo['points'] = $2
+	  end
 	else
-	  finfo['points'] = font[1].to_s
+	  finfo['points'] = '13'
 	end
       end
-      finfo[2..-1].each{|style|
+      font[2..-1].each{|style|
 	case (style)
 	when 'normal'
 	  finfo['weight'] = style
@@ -199,16 +208,19 @@
     elsif font.kind_of? Array
       finfo = {}
       finfo['family'] = font[0].to_s
-      if font[1] && font[1] != '0' && font[1] =~ /^(|\+|-)([0-9]+)$/
-	if $1 == '-'
-	  finfo['pixels'] = $2
+      if font[1]
+	fsize = font[1].to_s
+	if fsize != '0' && fsize =~ /^(|\+|-)([0-9]+)$/
+	  if $1 == '-'
+	    finfo['pixels'] = $2
+	  else
+	    finfo['points'] = $2
+	  end
 	else
-	  finfo['points'] = $2
+	  finfo['points'] = '13'
 	end
-      else
-	finfo['points'] = '13'
       end
-      finfo[2..-1].each{|style|
+      font[2..-1].each{|style|
 	case (style)
 	when 'normal'
 	  finfo['weight'] = style

In This Thread