Re: Ligatures with appendBezierPathWithGlyph
Re: Ligatures with appendBezierPathWithGlyph
- Subject: Re: Ligatures with appendBezierPathWithGlyph
- From: Douglas Davidson <email@hidden>
- Date: Mon, 18 Jun 2007 15:05:04 -0700
On Jun 18, 2007, at 3:04 PM, Stefan Werner wrote:
When using NSPath's appendBezierPathWithGlyph, I'm noticing a
difference between between using NSLayoutManager/NSTextStorage
objects I created myself and objects obtained from an NSTextView:
Bezier paths created from my own objects don't show any ligatures,
where the ones from NSTextView do. Also, when the Bezier paths from
the NSTextView do contain ligatures, there are also extra squares
(about the size of a glyph bounding box) right next to it in the
path, regardless of what font I use.
I'm sure I'm missing something with the ligatures not showing up in
my own objects - do I need to enable it first for the
NSLayoutManager somehow? The extra squares in the case where I do
get ligatures however are puzzling me, though it's not that
important as I eventually want to use my own objects. I'm not
iterating through the glyphs incorrectly, am I?
The point to keep in mind is that there may be glyphs in the glyph
stream that are not shown. The particular ones you're encountering
in this case are instances of NSNullGlyph that are used for padding
when a ligature is present, to help keep character and glyph indexes
in sync. There will also be instances of NSControlGlyph
corresponding to control characters such as line breaks, tabs,
attachments, etc. Try taking a look at the text->bezier path
conversion code in <http://developer.apple.com/samplecode/
SpeedometerView/index.html>, which takes a different approach.
I don't know why you're not seeing ligatures at all in certain
cases. Their presence or absence depends on the font, ligature
attribute, etc., so it's difficult to say without seeing a detailed
example.
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