• 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: Drawing NSGlyphs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing NSGlyphs


  • Subject: Re: Drawing NSGlyphs
  • From: Brock Brandenberg <email@hidden>
  • Date: Thu, 19 Sep 2002 14:54:53 -0500

Hi Vladimir.

> That does not seem to me as a correct behavior of the -[NSBezierPath
> appendBezierPathWithGlyphs:count:inFont:] method that all the glyphs
> overlay each other at one point which is not shifted according to
> NSFont metrics for each glyph in the array.
>
> Is this a bug?

Yes, it is a reported bug in 10.2. You can work around it simply by moving
the current point in the bezier path by the amount of the glyph advance for
each font glyph, like the code fragment below:

NSPoint origin = NSMakePoint(0.0,0.0);

[bezierPath moveToPoint:origin];

for( i=0; i<numberOfGlyphs; i++ )
{
[bezierPath appendBezierPathWithGlyph:arrayOfGlyphs[i]
inFont:glyphFont];
origin.x += [glyphFont advancementForGlyph:arrayOfGlyphs[i]].width;
[bezierPath moveToPoint:origin];
}

Brock Brandenberg

----- industrial design @ www.bergdesign.com ------
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: [Q] gprof
  • Next by Date: Re(2): Preferences (was: UI: "Direct manipulation" is in conflict with "Forgiveness")
  • Previous by thread: Re: Drawing NSGlyphs
  • Next by thread: Re: Preferences (was: UI: "Direct manipulation" is in conflict with "Forgiveness")
  • Index(es):
    • Date
    • Thread