0

CTFontGetAdvancesForGlyphs returns an array with widths of each text glypth (letter).

How to get real positions for each glyph (letter) in a text string?

If I calculate a sum of all text glyphs a resulting valuer is larger than real text string. This problem is especially actual for certain letters: "To" or "Te".

aleksid1
  • 11
  • 2
  • There is a much better way to learn the width of a string. – matt Dec 09 '20 at 14:25
  • Advances are not widths; glyph boxes can overlap or have space between them. If you want the width of something, you need to get the width. The advance is the "real position." – Rob Napier Dec 09 '20 at 14:39
  • I need to get exact positions of each glypth in a text string. Because I implement a custom text editor with a cursor between letters. – aleksid1 Dec 09 '20 at 15:09

0 Answers0