• 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
Ligatures with appendBezierPathWithGlyph
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


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

  • Prev by Date: Re: Why the need for the id type?
  • Next by Date: Re: Why the need for the id type?
  • Previous by thread: Re: text to bezier path
  • Next by thread: Re: Ligatures with appendBezierPathWithGlyph
  • Index(es):
    • Date
    • Thread