3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
|
# File 'lib/tk.rb', line 3596
def kanjifont_configure(knj, keys=nil)
if knj.kind_of?(Array)
key = knj[1]
knj = knj[0]
else
key = nil
end
optkeys = __font_optkeys
if key && !optkeys.find{|opt| opt.to_s == key.to_s}
fail ArgumentError, "unknown font option name `#{key}'"
end
win, tag = __pathname.split(':')
optkeys = [key] if key
optkeys.each{|optkey|
optkey = optkey.to_s
pathname = [win, tag, optkey].join(';')
if (fobj = TkFont.used_on(pathname))
fobj = TkFont.new(fobj) elsif Tk::JAPANIZED_TK
fobj = fontobj else
knj = hash_kv(knj) if knj.kind_of?(Hash)
unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
tk_call(*(__config_cmd << "-#{optkey}" << knj))
else
begin
tk_call(*(__config_cmd << "-#{optkey}" << knj))
rescue => e
end
end
next
end
if fobj.kind_of?(TkFont)
if knj.kind_of?(TkFont)
conf = {}
knj.kanji_configinfo.each{|k,val| conf[k] = val}
if keys
fobj.kanji_configure(conf.update(keys))
else
fobj.kanji_configure(conf)
end
else
fobj.kanji_replace(knj)
end
end
fobj.call_font_configure([pathname, optkey], *(__config_cmd << {}))
}
self
end
|