[FIX] Better password font handling when TrueTypeTextStyles installed

Phil Hargett hargettp at mindspring.com
Sun Jan 5 15:31:45 UTC 2003


I use Yoshiki's excellent TrueType Text Styles throughout my image;
however, when using TrueType fonts, anytime squeak needs to ask me for a
password (e.g., when storing a changeset on an FTP server, when Scamper
accesses a web site with a user ID / password field, etc.), I would
receive a walkback on the StrikeFont class>>passwordFontSize: method.

After reviewing the method and it's intent, I concluded that this line

	aFont := (StrikeFont familyName: #NewYork10 size: aSize) copy.

was the culprit.  It would appear that the method is asking for a font
with family name #NewYork10, and finds none, so the font on the default
text style is used instead.  Because I use TrueType Text Styles everywhere
(including as my default font, which works fine--even on emergency
evaluators), a TTCFont is used.  However, the next several lines make
assumptions about the font object retrieved, none of which are true for
instances of TTCFont.

If I ever have the time, I might try to understand why a special password
font is used to display passwords rather than translate every character
to $* before display, which this effectively achieves as well, but at
seemingly high cost for such a conceptually simple operation.  Instead,
I've chosen a simpler fix: change #NewYork10 to just #NewYork.  After
that, everything works fine.  A non-TTCFont is found (at least in my
image, but I suspect this will be true in others as well), passwords can
be entered where necessary.

Hope this is helpful! :)



More information about the Squeak-dev mailing list