Text/Font Size Measurement
Text/Font Size Measurement
- Subject: Text/Font Size Measurement
- From: Dave Smith <email@hidden>
- Date: Tue, 23 May 2006 10:24:05 -0400
I am having a problem properly measuring text in Cocoa. I have a very
simple problem that requires that I render some characters into an
image and then measure how large etc. each of the characters are in
the final image.
In 10.4 I managed to get something workable using:
[chString boundingRectWithSize:NSZeroSize
options:NSStringDrawingUsesDeviceMetrics
attributes: attrs];
That gives me my rect measurements in pixels (at least it appears to
be in pixels) which is what I need for my image manipulation.
Now I have to change the code to support 10.2. That particular call
is not longer available to be used. Can anyone suggest how to
accomplish the same thing in 10.2?
I have tried using the LayoutManager etc. and I can get measurements
on characters/string, but they are not in whole pixels. Any ideas?
Dave Smith
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden