[BUG] Confused about font sizes

David N. Smith (IBM) dnsmith at watson.ibm.com
Sat Feb 3 00:36:25 UTC 2001


I've been looking at font sizes a bit closer rather than considering them magic; guess the right number and you get the size you want.

I wrote this bit of code to put up TextMorphs with font sizes of 10 to 27:

(27 to: 10 by: -1) do: [ :n |
    TextMorph new
        contents: (Text string: 'Font size = ', n printString attributes: {TextEmphasis normal});
        topLeft: 10@(n*20+10);
        fontName: 'NewYork' size: n;
        openInWorld ]

It produces the smallest size for the range 10-14, the next biggest for the range 15-20, the next biggest for the range 21-25, and the largest for values starting at 26:
	10-14, 15-20, 21-25, 26-up

The menu available in virtually all text areas uses the sizes 12, 15, 18, 24. Note that 15 and 18 are in the same range and should be the same size but aren't.

There are four strike fonts for New York:

	a StrikeFont(NewYork10 12) 
	a StrikeFont(NewYork12 15) 
	a StrikeFont(NewYork18 21) 
	a StrikeFont(NewYork24 26)

where the first number seems to be the height of the pixels and the second is the base line spacing. This would suggest using either 10, 12, 18, and 24 for the point sizes, OR using 12, 15, 21 and 26. Comparing them with a different implementation of New York in Apple Works it looks like 10 and 12 are about the same size both places.

The numbers in the menu (12, 15, 18, 24) seem to be the interline spacing for two sizes, and the base font size for two others. Is this right?

I'm confused, though I have figured out how the secret behind the magic numbers I have to use to get TextMorphs to produce the four sizes.

What are the right sizes, and why aren't they the same everywhere?

Dave
-- 
_______________________________
David N. Smith
IBM T J Watson Research Center
Hawthorne, NY
_______________________________
Any opinions or recommendations
herein are those of the author  
and not of his employer.





More information about the Squeak-dev mailing list