Created
October 25, 2013 16:35
-
-
Save bakercp/7157643 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in your .h file | |
ofTrueTypeFont font; | |
/// in your cpp file | |
// we load our font with contours (see the docs for more info on the args) | |
font.loadFont("verdana.ttf", 50, true, true, true); | |
vector<ofPath> paths = font.getStringAsPoints("hello"); | |
for(int i = 0; i < paths.size(); i++) | |
{ | |
ofPath path = paths[i]; | |
vector<ofPolyline> polylines = path.getOutline(); | |
for(int j = 0; j < polylines.size(); j++) | |
{ | |
ofPolyline polyline = polylines[i]; | |
for(int k = 0; k < polyline.size(); k++) | |
{ | |
ofVec2f point = polyline[k]; | |
// your point paths live here! | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment