Method: TkTreatFont#kanjifont_copy

Defined in:
lib/tk.rb

#kanjifont_copy(win, wintag = nil, winkey = nil, targetkey = nil) ⇒ Object



3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
# File 'lib/tk.rb', line 3703

def kanjifont_copy(win, wintag=nil, winkey=nil, targetkey=nil)
  if targetkey
    fontobj(targetkey).dup.call_font_configure([__pathname, targetkey],
                                               *(__config_cmd << {}))
  else
      fontobj.dup.call_font_configure(__pathname, *(__config_cmd << {}))
  end

  if wintag
    if winkey
      fontobj.kanji_replace(win.tagfontobj(wintag, winkey).kanji_font_id)
    else
      fontobj.kanji_replace(win.tagfontobj(wintag).kanji_font_id)
    end
  else
    if winkey
      fontobj.kanji_replace(win.fontobj(winkey).kanji_font_id)
    else
      fontobj.kanji_replace(win.fontobj.kanji_font_id)
    end
  end
  self
end