[squeak-dev] Re: Shout & Fonts

Andreas Raab andreas.raab at gmx.de
Thu Oct 22 05:43:28 UTC 2009


Ronald Spengler wrote:
> The default grey italic for an incomplete identifier seems
> horizontally squished to me, making it hard to read.
> 
> Inspecting:
> 
> SHTextStylerST80 styleTable
> 
> ...shows me that the fonts are configured with symbols. Is there a
> symbol I can add like #wider ? And where would I look to see what
> these symbols mean?

The comment in #defaultStyleTable says:

	"color can be a valid argument to Color class>>colorFrom: , or nil to
	use the editor text color.
	Multiple emphases can be specified using an array e.g. #(bold italic).
	If emphasis is not specified, #normal will be used.
	if pixel height is not specified , then the editor font size will be used.
	"

If you get into it (i.e., browse sender chains and read some code[*1]), 
you'll find that it will ultimately do a #perform: of the symbol on 
TextEmphasis so if you look at the class side of TextEmphasis you can 
see that valid symbols would be #bold, #italic, #narrow, #normal, 
#struckOut, #underlined. And if you need additional ones just implement 
the proper method ;-)

[*1] Browse senders of styleTable which gets you into 
#initialTextAttributesForPixelHeight: where you can see that 
#attributeArrayForColor:emphasis:font: is called for the text emphasis 
symbol. Browsing the implementors of 
#attributeArrayForColor:emphasis:font: shows that the actual attribute 
is created via "TextEmphasis perform: each" which leads you straight to 
TextEmphasis and its class methods.

Cheers,
   - Andreas





More information about the Squeak-dev mailing list