Pregunta

The documentation for FreeType2 says that the default character map used is the Unicode map... However, when I attempt to retrieve character code for Unicode 'T', it gives me Unicode 'Z' using:

glyph_index = FT_Get_Char_Index(face, text[n]);

What I really need is a way to find out how many glyphs are in the font face and what their Unicode value maps to per each one. Is there any way to do this. I've tried almost every FreeType function and can't get good results.

Thanks

¿Fue útil?

Solución

I know this is old but...

What you ask is not possible. There are glyphs that don't match to any Unicode codepoint, and there are Unicode codepoints that map to multiple glyphs, depending on the neighboring glyph. For example, the "ff" in many fonts is a special glyph to make typesetting work better. There is no "ff" codepoint in Unicode. It's up to your layout system to decide to use an "ff" glyph or not.

However, if you're asking for the 'T' character and getting a 'Z' glyph index, then there are probably issues with your font.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top