|FIX][ENH] Underline and Struck out for TrueType

Boris Gaertner Boris.Gaertner at gmx.net
Thu Jun 3 13:29:22 UTC 2004


"Yoshiki Ohshima" <Yoshiki.Ohshima at acm.org> wrote: (at May 07)

>   Hello,
>
>   Here is a change set to make it possible to put 'underlined' and
> 'struckOut' emphasis to the TrueType font.
>
>   It works fine with 3.6, and sort of works with 3.7b.  The problem
> with 3.7b is that the handling of multiple text attributes is broken.
>

"Martin Drautzburg" <martin.drautzburg at web.de> wrote (at May 21)
> squeak 3.7beta
> 
> Is there are way to change the font/size/emphasis in Class comments to
> make them look nicer and more structured. I remember I used to do this
> but either forgot or it no longer works in 3.7. Could also be a
> problem of "shout".
> 

Regrettably I was unable to immediately look into this problem,
but now I think that I understand what happens.
Here are my findings (for Squeak 3.7 beta #5923) :

1. In the Morphic environment, you cannot change the size of 
a piece of text when you work in the code view of the browser.
In the MVC environment, you can change the size of a selected
piece of text (with alt+1 .. alt+ 5).

2. When you explore the PluggableTextMorph that holds
the method text, you find, that its textMorph (an instance
of TextMorphForEditView) has a text style with a font array
of size 1. This explains why it is not possible to change the
text size: To display glyphs of various size, we need the
full text style (the fontArray of such a TextStyle contains
StrikeFonts for all available glyph sizes), not one that is
restricted to one font size.

As a general rule, TextStyles with exactly one font
should be created only for use with visual elements that
are not designed to display glyphs of different height.
(PopUpMenu is such a visual element)

Attached you find:
1. Additions to Preferences class that give you the
  possibility to select a font family and a default font size.
  (I left the #chooseCodeFont  as it is and added a new
  method #chooseCodeStyle)

2. A change in Text class>>fromString:  that I proposed
earlier: I really think that we should create instances of
Text not with attribute
  (TextFontChange fontNumber: TextStyle default defaultFontIndex)
but with
  TextEmphasis normal.
TextEmphasis normal  is no emphasis at all, and the display
machinery uses the default font size of a text style when it has
to display a piece of text that has no TextFontChange attribute
and no TextFontReference attribute.

I remember that I was told some time ago that Texts
without a TextFontChange attribute may cause problems
but I do not know why or where. Anyway, I will try
to identify and to fix problems that will berported
on this list.

Greetings, Boris



-------------- next part --------------
A non-text attachment was scrubbed...
Name: CodeStyleFix.1.cs
Type: application/octet-stream
Size: 8374 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040603/4c03e53c/CodeStyleFix.1.obj


More information about the Squeak-dev mailing list