newbie looking for fonts

Ian Piumarta ian.piumarta at inria.fr
Sat Oct 26 18:07:44 UTC 2002


Hi Albert,

> Where might I find some additional fonts for Squeak 3.2?

The easiest way is to import your favorite fonts from X11.  You will need
a means to extract fonts as bdf (bitmap distribution format) files.  If
you run a font server then `fstobdf' (ditributed with XF86) might work for
you (mine simply refuses to talk to my font server, ho hum).  Otherwise
there is program called `getbdf' which works just fine.  (Google for the
sources and compile your own -- it's teeny.  Otherwise mail me and I'll
send you the source.)

Step 0.  Unless you already have a favorite font or two, select a font
         to import.  (`xlfonts' gives you the full list, but it's
         huge.  `xfontsel' lets you select fonts by selecting each
         individual attribute [founrdy, name, pixel size, encoding,
         etc.] but it's unweildy to use and you have to have an idea
         what the individual fields mean.  The easiest approach is
         maybe to `xlfonts | fgrep <name>' where <name> is the family
         that you're interested in [e.g. helvetica].  You should probably
         to stick to iso8859-1 [latin1] fonts unless you know
         specifically that you want a different encoding.)

Step 1.  Extract your font (from a Unix command line), e.g:

	$ getbdf -font fixed > fixed.bdf

Step 2.  Import it into Squeak (evaluate this in a Squeak workspace):

	TextConstants
		at: #Fixed
		put: (TextStyle fontArray:
			{ StrikeFont 
				newFromBDFFile: 'fixed.bdf'
				name: 'Fixed13' }).

Step 3.  Delete the .bdf file, which is no longer useful.

Step 4.  Use `bgMenu > appearance ... > system fonts...' to select
         where you want to use your newly-imported font(s).

If you want to import other fonts then be sure to change `#Fixed' and
`Fixed13' (the number is the point size of the font) appropriately to
avoid collisions.

Also, you may have to use full font names to import more interesting
fonts.  (`fixed' and similar names are aliases, and there are many more
fonts available than there are aliases set up for them.  E.g., I use
    -adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1
as my default text and menu font in Squeak.  I think it's very attractive
and that it gives Squeak a _much_ more professional appearance than the
default NewYork font.)

Note also that the new fonts will only take effect in newly-opened
windows.

Regards,

Ian





More information about the Squeak-dev mailing list