[BUG] AccuFonts, Browser and class comments

Boris Gaertner Boris.Gaertner at gmx.net
Sat Apr 26 19:50:09 UTC 2003

Mike Roberts <mike at mjr104.co.uk> told us about a problem with fonts
and stylished class comments:

> Hi,
> Install AccuFonts in a fresh image and change the default system font to
> something big like 14pt.
> View the class comments for a class with hypertext.  For example
> "View the class comment for Date"
> |br view|
> br _ Browser new.
> br setClass: Date selector: nil.
> view _ br openEditString:nil.
> Browser openBrowserView: view label: 'System Browser'.
> view model plusButtonHit
> The font remains at the original (Accuny09?) font that is first setup
after the installation.
> If you view a class comment without hypertext then the font is correct.
Note that a class comment that contains a  hyperlink (or other text style
features) is stored in a special format that keeps text styles. Other
comments are stored as strings (that is, without text style information).
The stored style information takes precedence over default style settings.

This is an explanation in a nutshell. Now some additional remarks for
the curious ones:

The style information of the class comment for class Date is the following
string that follows the comment as a separate chunk:

]style[(323 58 1 65

The methods that create this style description string are named
writeScanOn: You find these methods in RunArray and in all classes
that represent text style features.

RunArray class>>scanFrom:  is executed to read such a style description and
to reconstruct the text style information. Reading this method is really
helpful to understand how to interpret a style description string.

The method  PositionableStream>>nextChunkText is used to read a method
definition or a class comment from either the changes file or the sources

You find that a definition without text style is read into a string that is
then converted into an instance of Text by  String>>asText.

String>>asText is defined as

^Text fromString: self

and Text class>>fromString:  reads:

 ^ self string: aString attribute: (TextFontChange fontNumber: TextStyle
default defaultFontIndex)

Here the default text style is used.

For a definition that is stored with style, the both the string and the
styles are read and put together as a Text by

Text basicNew setString: string setRunsChecking: runs

Here we do not use the default system font. (runs is an instance of
RunArray that contains the various text attributes)

> I have started to hunt around TextAttribute and friends but I'm a bit
lost.  Does anyone have the answer or a direction for me to look in?
Well, I hope my remarks are helpful. They are certainly not complete.
My apologies if they areunhelpful or confusing.

Greetings, Boris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030426/f541f476/attachment.htm

More information about the Squeak-dev mailing list