Telnet and TrueTypeTextStyle
Steve Elkins
sgelkins at nortelnetworks.com
Thu May 8 21:32:47 UTC 2003
<diegogomezdeck at consultar.com> wrote:
[...about a problem he encountered using Connectors and
TrueTypeTextStyle together...]
A few days ago I ran into what seemed to be an incompatibility between
the subject packages.
Telnet's TeletypeWindow>>buildFontMenu sends #monospacedFamilyNames to
StrikeFont and it looks in the TextConstants pool for TextStyles and
sends #isMonospaced to each. StrikeFont implements it but TTCFont
(added to TextConstants by TrueTypeTextStyle (I guess)) doesn't so I got
a walkback when I tried to use the TeletypeWindow window menu. I pasted
StrikeFont>>isMonospaced into TTCFont and moved on.
Looking at #isMonospaced, it isn't surprising that the hack worked since
the only font-specific message in it is #widthOf:, which is a
#subclassResponsibility in AbstractFont; both StrikeFont and TTCFont
implement it. And it does seem like #isMonospaced is a question that
any font should be able to answer. Similarly, it seems like
#monospacedFamilyNames is information any font class should be able to
provide and its implementation doesn't rely on particular font
characteristics. Hence I moved the 2 to AbstractFont and removed them
elsewhere. So far so good, but not really brave since the only path to
the bug in this image is via the previously mentioned menu.
I explain all this because at first it seemed like the TTCFont didn't
implement something it should've, but I no longer think so. Maybe
#maxWidth is another question every font should answer. However, I know
almost nothing about fonts.
Cheers,
Steve
More information about the Squeak-dev
mailing list
|