[ENH] widths of digits

Hans-Martin Mosner hm.mosner at cityweb.de
Sat Oct 23 20:25:57 UTC 1999


You may have noted that Squeak's default font has different widths for
$1 and all other digits. IMHO, all digits should have the same width so
that they line up nicely when displayed in columns.
Here is a snippet which fixes the situation:

| font |
font _ TextStyle default fontAt: 1.
(font widthOf: $1) < (font widthOf: $0) ifTrue: [
  font alter: $1 formBlock:
  [:charForm | newForm _ Form extent: (font widthOf: $0) @ charForm
height.
  charForm displayOn: newForm at: 1 at 0.
  newForm]].
StrikeFont shutDown

Hans-Martin





More information about the Squeak-dev mailing list