Re: Drawing NSGlyphs
Re: Drawing NSGlyphs
- Subject: Re: Drawing NSGlyphs
- From: Douglas Davidson <email@hidden>
- Date: Thu, 19 Sep 2002 09:44:41 -0700
On Thursday, September 19, 2002, at 08:11 AM, Vladimir Pilipyuk wrote:
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?
There is a known bug in this area, although I am not certain of the
details.
Another problem is with foreign encodings, NSLayoutManager does not
return NSGlyphs array good enough for NSBezierPath to draw them with
the same font. Though it works for English language and some special
foreign fonts. However NSTextView can show these foreign glyphs in the
normal fonts as Times or Helvetica for instance. I must be missing
something in glyphs encoding but cannot figure out what it is.
Let me explain how this works. NSTextStorage actually manages the font
substitution during its attribute fixing phase. This is done
automatically, so whenever you ask for the font attribute in an
NSTextStorage, you will get a font that can actually display the
specified character--but you must ask the text storage what the font
is, you cannot simply use the font that you set on it to begin with.
NSGlyphs only have significance with respect to a particular font, so
you cannot use the glyphs from layout manager with an arbitrary font;
you must use a given glyph with the font that the NSTextStorage has
assigned to the relevant character(s). That is how NSTextView does it.
Douglas Davidson
_______________________________________________
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.