Helvetica in NSQuickDrawView
Helvetica in NSQuickDrawView
- Subject: Helvetica in NSQuickDrawView
- From: Dix Lorenz <email@hidden>
- Date: Fri, 25 Apr 2003 12:04:18 +0200
Hi,
I have ported some old (10 years?) Quickdraw-code into my brandnew
Cocoa-App, using NSQuickDrawView. I am more than amazed how well it
worked and how easy the transition was, but I have one problem: I am
using GetFontInfo and TEGetHeight to find the needed height for a text
without drawing it. This code has worked all these years and continues
to work... Unless I use Helvetica. Using Helvetica 12 pt, I get a
TextHeight of 12, which is obviously to small. It works for other fonts
I tried (Lucida Grande and Arial)...
The code in question:
FontInfo theFontInfo;
::GetFontInfo(&theFontInfo);
(*mTE)->lineHeight = (theFontInfo.descent + theFontInfo.ascent +
theFontInfo.leading);
int theHeight = ::TEGetHeight(32767,1,mTE);
I know the Apple Docs say I shouldn't use TextEdit anymore and use
MLTE, but if there is a way to simply find the height of a text, just
using a Grafport, without actually drawing it, I didn't see it...
Any suggestions or ideas?
Thanks,
Dix
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.