Method: TkHTML_File_Viewer#pick_font
- Defined in:
- sample/tkextlib/tkHTML/ss.rb
#pick_font(size, attrs) ⇒ Object
A font chooser routine.
html = pick_font
128 129 130 131 132 133 134 |
# File 'sample/tkextlib/tkHTML/ss.rb', line 128 def pick_font(size, attrs) # puts "FontCmd: #{size} #{attrs}" [ ((attrs =~ /fixed/)? 'courier': 'charter'), (12 * (1.2**(size.to_f - 4.0))).to_i, ((attrs =~ /italic/)? 'italic': 'roman'), ((attrs =~ /bold/)? 'bold': 'normal') ].join(' ') end |