Re: Drawing NSGlyphs
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.