Re: NSGlyph is still a puzzle
Re: NSGlyph is still a puzzle
- Subject: Re: NSGlyph is still a puzzle
- From: "Anabelle Masour" <email@hidden>
- Date: Mon, 21 Jan 2002 23:46:56 +0000
A single NSGlyph corresponds to a single glyph in the font. Exactly how
this works in practice depends on the font. If a font contains a single
glyph for a composed form like an accented a, then that glyph will probably
be used. If a font does not contain a single glyph for that composed form,
but instead contains separate glyphs for the a and the accent, then two
NSGlyphs will be generated, one for the a and one for the accent, and
typesetting will position them properly with respect to each other. You
will notice that there are many, many combining characters in Unicode, so
it is impossible that composed glyphs should be available for all possible
combinations, or even all relevant and useful combinations. This is one of
the reasons why conversion between characters and glyphs is many-to-many.
That was an eye opener!! I see now that if I use NSLayoutManager
getGlyphs:range: it is insufficient when I deal with composed glyphs.
Because I can not distinguish between a' and a.
I shall use
- (unsigned)getGlyphsInRange:(NSRange)glyphsRange glyphs:(NSGlyph
*)glyphBuffer characterIndexes:(unsigned *)charIndexBuffer
glyphInscriptions:(NSGlyphInscription *)inscribeBuffer elasticBits:(BOOL
*)elasticBuffer
and look for the NSGlyphInscription inscribeBuffer and the charIndexBuffer.
This method has some undocumented other variables.... I must ask this :)
What are elasticBits ?
<Anabelle
.........
Rien ne sert de courir si on n'est pas pressi
et rien ne sert de marcher si on n'est pas foutu de tenir debout.
_________________________________________________________________
Join the worlds largest e-mail service with MSN Hotmail.
http://www.hotmail.com