Small Font Troubles
Small Font Troubles
- Subject: Small Font Troubles
- From: Greg Scown <email@hidden>
- Date: Mon, 7 Jan 2002 19:47:05 +0800
I'm having great difficulty in drawing small fonts (sizes less than 9
point) under Mac OS X. When I try to draw small fonts in my application,
they look terrible on the screen, but when I print preview at actual
size, they look quite nice - exactly as I wish they'd look in my
application.
I'm looking for advice on how to render small fonts on screen in a
visually appealing manner if any of you have already solved this problem.
Here's a fun experiment you can try at home to see both what I want and
what's going wrong:
0. I'm running Mac OS X 10.1.2 (Build 5P48) and the December 2001
Developer Tools. If you're using something different, your mileage may
vary.
1. Download "SmallFonts.nib.sit" from the following URL:
http://www.smilesoftware.com/temp/SmallFonts.nib.sit
2. Double-click the expanded "SmallFonts.nib" (which launches Interface
Builder)
3. Note that the text looks jagged and is nearly impossible to read
(it's 7 point Lucida Grande)
4. Open "~/Library/Preferences/com.apple.InterfaceBuilder.plist" in your
favorite text editor and add the following lines:
<key>AppleAntiAliasingThreshold</key>
<integer>4</integer>
5. Quit Interface Builder and re-launch "SmallFonts.nib"
6. This time, the text is smooth and readable. Obviously, this is what I
want 7 point Lucida Grande text to look like in my application.
7. Lest you think that all I need to do is place the magic lines in my
project's plist (don't I wish it were that simple?), select "Test
Interface" from the "File" menu and you'll see that the text becomes
jagged again.
I used SmallFonts.nib as the nib file for an unmodified template Cocoa
application, and got the jaggies. I added AppleAntiAliasingThreshold=4
to the .plist and still got the jaggies. I confirmed with Joy that
indeed AppleAntiAliasingThreshold is set to 4 in my modified app.
Why on earth does Interface Builder render small fonts properly when
AppleAntiAliasingThreshold is set low yet nothing else I try does? How
do I mimic Interface Builder's behavior when drawing small fonts?
I would really appreciate any help/hints folks have to offer.
Thanks!
==> Greg