Ligatures with appendBezierPathWithGlyph
Ligatures with appendBezierPathWithGlyph
- Subject: Ligatures with appendBezierPathWithGlyph
- From: Stefan Werner <email@hidden>
- Date: Tue, 19 Jun 2007 00:04:33 +0200
Hi,
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?
My code:
NSFont *font = [NSFont fontWithName:@"Times New Roman" size:23];
NSTextStorage* storage = [[[NSTextStorage alloc] @"fine"] autorelease];
NSLayoutManager* layout = [[[NSLayoutManager alloc] init] autorelease];
[storage setFont: font];
[storage addLayoutManager: layout];
unsigned i = 0;
for (i = 0; i < [layout numberOfGlyphs]; ++i)
{
NSGlyph glyph = [layout glyphAtIndex:i];
NSBezierPath* path = [NSBezierPath bezierPath];
[path moveToPoint: [layout locationForGlyphAtIndex:i]];
[path appendBezierPathWithGlyph: glyph inFont: font];
[path fill];
}
Thanks in advance,
Stefan
_______________________________________________
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