Re: text to bezier path
Re: text to bezier path
- Subject: Re: text to bezier path
- From: Douglas Davidson <email@hidden>
- Date: Mon, 4 Jun 2007 14:12:26 -0700
On Jun 4, 2007, at 2:00 PM, Paul Bruneau wrote:
I think what he means is that stroke width alone will not cut it.
If you don't want the stroke to encroach on the interior of the
letter forms, you have to sort of mask the stroke from the inside
of the letter form, and let it only "grow outward" from the center
of the stroke.
In Illustrator, you would do just as he says, you would have one
copy of the text with the stroke on it, then a second copy opaque
over the top with no stroke, which would then hide the "interior"
part of the stroke.
Otherwise once your stroke gets larger, it will make the letters
unreadable or at least ugly.
You could do the same thing with Cocoa text, simply draw twice with
two different sets of attributes. If you need to do this in editable
text in an NSTextView, you could subclass NSLayoutManager and
override one of the drawing methods. Or, you could just not use the
problematic combinations of stroke width and font size--from your
examples it seems that the specified stroke width isn't what is
actually wanted as the width of the outline.
As for obtaining text as a bezier path--I'm not sure that it's
actually the best approach to this particular issue, but it
definitely can be useful in a number of cases. Perhaps someone on
the list has some sample code? I'm afraid I can't produce any on
short notice so soon before WWDC.
Douglas Davidson
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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