Problem with font display
Problem with font display
- Subject: Problem with font display
- From: Gwynne Raskind <email@hidden>
- Date: Fri, 7 May 2010 12:36:21 -0400
I'm working on porting an old application from OS 9 to modern Cocoa (quite a jump). Over and over I've run into an issue where the text just doesn't draw the same way no matter what I do. Until now I've been able to ignore it because the cosmetic change wasn't as obvious, but now it's causing difficulty. I'm a bit of a newbie when it comes to font and text manipulation, so maybe I'm missing something obvious.
In OS 9, a particular string drawn in Geneva 9 with the old DrawString() API was about 60 pixels wide. But when I draw that same string using the NSStringDrawing methods and NSFont, I get much more "squished" text about 50 pixels wide. I've tried playing with kerning and expansion attributes, but those just create very ugly visual distortions. I get the same effects using SimpleText on OS 9 versus TextEdit on OS X.
I understand that CoreText is fundamentally different in every way from QuickDraw's text support, but I'm wondering if there's really *no* way to get back that slightly wider (and better-looking) text. If I have to create layout managers and draw glyphs manually or work at an ATSUI level, I'm willing to delve as deep as needed. I just don't know where to look for what I want.
I should add that ultimately the text is drawn into an OpenGL context, in case there's some shortcut for that sort of rendering.
Any and all help is appreciated. I can provide screenshots of the difference between the two renderings if needed.
-- Gwynne
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden