• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: text to bezier path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: text to bezier path


  • Subject: Re: text to bezier path
  • From: Paul Bruneau <email@hidden>
  • Date: Mon, 4 Jun 2007 17:00:47 -0400

On Jun 4, 2007, at 4:08 PM, Douglas Davidson wrote:

On Jun 4, 2007, at 12:45 PM, Chase wrote:

I'm trying to draw text with outline of a user-specified thickness (in pixels). I had to do something similar in a REALbasic app once, and the effect was achieved by drawing once with a stroke thickness twice that of the user-specified "text outline thickness" and then drawing the original text again, directly over the top (with no outline this time).

It's not clear to me exactly what kind of effect you want, but with simple attributes you can specify independent stroke and fill colors as well as the stroke width. Use NSForegroundColorAttributeName, NSStrokeColorAttributeName, and NSStrokeWidthAttributeName. The stroke width is not in pixels, but is relative to the font size, so you would need to set it in your text on a per-font-size basis. See the comments in AppKit/ NSAttributedString.h for the exact interpretation of the values.

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.

Here is an example of what I think he means:

http://ethicalpaul.com/share/outline example.png
_______________________________________________

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


  • Follow-Ups:
    • Re: text to bezier path
      • From: Douglas Davidson <email@hidden>
References: 
 >text to bezier path (From: "Chase" <email@hidden>)
 >Re: text to bezier path (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: NSTextField value changes after tab-through
  • Next by Date: Re: text to bezier path
  • Previous by thread: Re: text to bezier path
  • Next by thread: Re: text to bezier path
  • Index(es):
    • Date
    • Thread