quick question - fixed width font.

Doug Way dway at mailcan.com
Tue Nov 2 17:49:04 UTC 2004


On Mon, 01 Nov 2004 15:41:41 -0800, "oxe" <sv04er502 at sneakemail.com>
said:
> Howdy,
> i've googled around a bit and been unable to find a
> quick easy solution for a squeak beginner like myself
> to This question:
> 
> is there an easy way to make the default font
> for all my code browsers be fixed width ?

This one is partly covered in the Squeak FAQ:

http://minnow.cc.gatech.edu/squeak/471

See the "How can I change or resize fonts" question.  (Although it
doesn't particularly mention fixed-width fonts.)

Anyway, go to the World menu - 'appearance' - 'system fonts' to set
various fonts in the Squeak UI.  You'll see "code font" as one of the
options, which is what you'll want to set the font in your code
browsers.

After selecting "code font", you'll see the available fonts... you'll
notice that "Atlanta", "Accumon" (a Monaco-like font), and
"BitstreamVeraSansMono" (for Mono-spaced) all look like fixed-width
fonts.

In practice, though, I notice that only Atlanta seems to be truly
fixed-width...

BitstreamVeraSansMono has a consitent width for all characters, but the
tab stops come out to about 2 1/2 characters, so that pretty well messes
things up.  (Actually, I guess that depends on the font size.  If you
pick just the right font size I guess the tab stop length would come out
right.  And the tab stop length is surely adjustable somewhere. :) )

Accumon has a proper tab-stop length of exactly 4 characters, but I
happened to notice some code that was out of alignment with it... turns
out that the bold capital-"I" is wider than other characters.  D'oh! 
That needs some fixin'.

> i'm a big fan of lining-up code like so:
> red   := '1 0 0'.
> green := '0 1 0'.
> blue  := '0 0 1'.
> 
> and with variable width fonts this is pretty much impossible.

True.  It does seem that fixed-width fonts are something of a standard
for editing code in most IDE's & editors.  However, I actually prefer
variable-width fonts because you can fit ~30% more text on the screen
with the same level of readability, and in my experience the situations
where code can be usefully lined up are extremely rare (especially in
Smalltalk).  Your mileage may vary. :)

> i'm in squeak 3.6.

Ooh, my advice above was for Squeak 3.7... I don't think Accumon or
BitstreamVeraSansMono are available in 3.6.  However, Atlanta should be
available.  So, give that a try.

- Doug



More information about the Squeak-dev mailing list