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! :)
Hi Phil,
Attached is a class "PasswordFont" which transparently wraps any font and simply substitutes asterisks in place of the actual characters drawn. This will work with both, "regular" strike fonts and Yoshikis beautiful AA fonts.
Cheers, - Andreas
-----Original Message----- From: squeak-dev-admin@lists.squeakfoundation.org [mailto:squeak-dev-admin@lists.squeakfoundation.org] On Behalf Of Phil Hargett Sent: Sunday, January 05, 2003 4:32 PM To: squeak-dev@lists.squeakfoundation.org Subject: [FIX] Better password font handling when TrueTypeTextStyles installed
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! :)
Phil,
Thank you for trying it that deep. I confess that I have never seen it working on emergency evaluators, although I don't be surprized.
The glyphMap should be honored in TTCFont>>displayString:on:from:to:at:kern:. Then what needed would be to "copy" the font (in the current version, #copy and friends are overridden so it might have to be changed), and set up the characterToGlyphMap method appropriately.
Other than this what I want to have is a way to "add" new size of font easily. The interface I'm thinking is to add a menu item in the "font" halo to add new size.
Thanks for the report. It is helpful,
-- Yoshiki
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! :)
Yoshiki,
Other than this what I want to have is a way to "add" new size of font easily. The interface I'm thinking is to add a menu item in the "font" halo to add new size.
How about just adding an "other point size" menu item to the font selection?! Then you could type in the font size you need the system would render it and be done. Next time you go there you find it in the list just like the other pre-rendered ones.
Cheers, - Andreas
-----Original Message----- From: squeak-dev-admin@lists.squeakfoundation.org [mailto:squeak-dev-admin@lists.squeakfoundation.org] On Behalf Of Yoshiki.Ohshima@acm.org Sent: Monday, January 06, 2003 9:51 PM To: squeak-dev@lists.squeakfoundation.org Cc: Phil Hargett Subject: Re: [FIX] Better password font handling when TrueTypeTextStyles installed
Phil,
Thank you for trying it that deep. I confess that I have never seen it working on emergency evaluators, although I don't be surprized.
The glyphMap should be honored in TTCFont>>displayString:on:from:to:at:kern:. Then what needed would be to "copy" the font (in the current version, #copy and friends are overridden so it might have to be changed), and set up the characterToGlyphMap method appropriately.
Other than this what I want to have is a way to "add" new size of font easily. The interface I'm thinking is to add a menu item in the "font" halo to add new size.
Thanks for the report. It is helpful,
-- Yoshiki
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! :)
Andreas,
How about just adding an "other point size" menu item to the font selection?! Then you could type in the font size you need the system would render it and be done. Next time you go there you find it in the list just like the other pre-rendered ones.
I meant by "font halo" is the light green "change font" halo. And for the sub-menu for a style, there can be a menu item that says "new size" and you can type in. The font size of the selected text can be changed at this moment and when you go there next time, the added one is there. Hmm, it sounds very similar what you wrote:-)
The places where the "index to the fontArray" is used should be fixed. But this doesn't look like a big issue.
And, I wrote the last email before reading your PasswordFont cs. Wrapping TTCFont sounds nicer than copying it.
-- Yoshiki
squeak-dev@lists.squeakfoundation.org