Method: TkTreatFont#latinfont_copy

Defined in:
lib/tk.rb

#latinfont_copy(win, wintag = nil, winkey = nil, targetkey = nil) ⇒ Object Also known as: asciifont_copy



3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
# File 'lib/tk.rb', line 3678

def latinfont_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.latin_replace(win.tagfontobj(wintag, winkey).latin_font_id)
    else
      fontobj.latin_replace(win.tagfontobj(wintag).latin_font_id)
    end
  else
    if winkey
      fontobj.latin_replace(win.fontobj(winkey).latin_font_id)
    else
      fontobj.latin_replace(win.fontobj.latin_font_id)
    end
  end
  self
end