class TkNamedFont
Public Class Methods
find(name)
click to toggle source
for built-in named fonts
# File lib/tk/font.rb, line 2234 def TkNamedFont.find(name) name = name.to_s unless (obj = Tk_FontNameTBL[name]) obj = self.new(name) if TkFont.is_system_font?(name) end obj end
new(name, keys=nil)
click to toggle source
# File lib/tk/font.rb, line 2242 def TkNamedFont.new(name, keys=nil) name = name.to_s obj = nil Tk_FontNameTBL.mutex.synchronize{ unless (obj = Tk_FontNameTBL[name]) (obj = self.allocate).instance_eval{ @id = @compoundfont = name.to_s @latinfont = nil @kanjifont = nil @descendant = [self, self] # [latin, kanji] : dummy Tk_FontNameTBL[@id] = self } end } obj.instance_eval{ initialize(name, keys) } obj end
new(name, keys=nil)
click to toggle source
# File lib/tk/font.rb, line 2263 def initialize(name, keys=nil) @id = @compoundfont = name.to_s # if not exist named font, create it. begin if keys tk_call('font', 'configure', @compoundfont, keys) else tk_call('font', 'configure', @compoundfont) end rescue # the named font doesn't exist -> create if keys tk_call('font', 'create', @compoundfont, keys) else tk_call('font', 'create', @compoundfont) end end end
Public Instance Methods
kanji_font_id()
click to toggle source
# File lib/tk/font.rb, line 2299 def kanji_font_id @compoundfont end
latin_font_id()
click to toggle source
# File lib/tk/font.rb, line 2296 def latin_font_id @compoundfont end
Private Instance Methods
create_compoundfont(ltn, knj, keys)
click to toggle source
# File lib/tk/font.rb, line 2289 def create_compoundfont(ltn, knj, keys) # ignore end
create_kanjifont(fnt)
click to toggle source
# File lib/tk/font.rb, line 2286 def create_kanjifont(fnt) # ignore end
create_latinfont(fnt)
click to toggle source
# File lib/tk/font.rb, line 2283 def create_latinfont(fnt) # ignore end