Re: Getting accurate bounds for glyph range
Re: Getting accurate bounds for glyph range
- Subject: Re: Getting accurate bounds for glyph range
- From: Douglas Davidson <email@hidden>
- Date: Tue, 2 Mar 2004 10:39:41 -0800
On Mar 2, 2004, at 9:56 AM, Jeremy Dronfield wrote:
I'm experimenting with Matt Gemmell's Rounded Floating Panel, using it
to display text instead of icons (sort of like the Large Type display
in Address Book). To this end, I've inserted a transparent text view
in place of the image view supplied. The point where I run into
trouble is getting the text view to resize accurately to the bounds of
its text storage. The following code represents my latest desperate
attempt to achieve this:
Two things you should keep in mind: first, the text view's coordinate
system is not the same as the text container's coordinate system, and
the layout manager always works in the container's coordinate system.
The difference is an offset, obtained by querying the text view for its
text container origin. Second, the text container supplies padding on
the left and right for each line fragment; this padding is included in
the used rect, but you may find that it is not appropriate for your
situation--for example, it is not used in string drawing, because it is
not appropriate there. You may wish to set the padding to 0.
Douglas Davidson
_______________________________________________
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.