How to convert a text string to a set of polylines in iOS?

I have a string, for example. "Hello world" and the font name, for example. "Courier". I need to get an array of polylines that represent this line. These polylines will be displayed in the OpenGL scene.

I mean, I need to convert each letter to one or more two-dimensional polylines.

How to do it in iOS (Objective-C or C ++)

+3
source share
2 answers

You can get the path from text and font using Core Text. There is a Core Text method called CTFontCreatePathForGlyphthat will give you the path for a given glyph of a given character. Using this, you can get a path for all your glyphs.

" " . , , ( Core Animation).

( , - )

+5

FreeType (TrueType, PostScript ..). FreeType , .

FT_Outline_Decompose, FT_Outline , . FT_Outline_Funcs, . , , (, ).

API:

, , , . , .

OpenGL , FreeType. :

+1

All Articles