Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (28 sloc) 1.24 KB

Shoes::FONTS and External Fonts

Shoes::FONTS is a complete list of the fonts you can use.
Loading from external fonts, such as TrueType and OTF files.

References are
New Today: External Fonts
http://newwws.shoooes.net/2008/10/06/new-external-fonts.html

Shoes Manual: font
http://help.shoooes.net/Built-in.html#font

# sample43.rb
font "phonetica.ttf"

Shoes.app :width => 350, :height => 500 do
  background peachpuff
  font = 'Phonetica'
  slot = stack{para 'abcdefg ABCDEFG : ' + font, :font => font}
  font = list_box :items => (Shoes::FONTS << "Phonetica"), :height => 30
  button 'change' do
    slot.append{para 'abcdefg ABCDEFG : ' + font.text, :font => font.text}
  end
end

sample43.png

sample43.png

Policeman

The sample42.rb works with Shoes-0.r1263. But seems to have a small bug so far.

sample43-1.png

sample43-1.png

The button still remains until next refresh event happen.