An extension of ofTrueTypeFont class for using UNICODE characters. Tested on OSX, iOS�, and Windows.
No additional library is required.
- Download it ( https://github.com/hironishihara/ofxTrueTypeFontUC/archive/master.zip )
- Extract the zip file, and rename the extracted folder to
ofxTrueTypeFontUC
- Put the
ofxTrueTypeFontUC
folder in theaddons
folder in your openFrameworks root folder
-
Add
ofxTrueTypeFontUC.h
andofxTrueTypeFontUC.cpp
to your project
(Refer to IDE setup guide http://openframeworks.cc/setup/ for detail) -
Put font file (ex.
yourFont.ttf
) inyourProjectFolder/bin/data
folder -
Include
ofxTrueTypeFontUC.h
// ofApp.h #include "ofxTrueTypeFontUC.h"
-
Declare an instance
// ofApp.h class ofApp : public ofBaseApp{ ... ofxTrueTypeFontUC myFont; };
-
Load a� font
// ofApp.cpp void ofApp::setup(){ ... myFont.loadFont("yourFont.ttf", 64�, true, true); }
-
Draw string
// ofApp.cpp void ofApp::draw(){ ... myFont.drawStringAsShapes("こんにちは", 100, 100); myFont.drawString("はじめまして", 100, 200); }
Refer ofxTrueTypeFontUC.h
with regard to other functions.
- Fork it ( http://github.com/hironishihara/ofxTrueTypeFontUC/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Rebase your local changes against the master branch
- Confirm that your feature works just as you intended
- Confirm that your feature properly works together with functions of ofxTrueTypeFontUC
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
- OSX (10.10) + Xcode (6.1) + openFrameworks 0.8.4 (osx)
- iOS (8.1) + Xcode (6.1) + openFrameworks 0.8.4 (ios)
- Windows 8.1 + Visual Studio 2012 Express + openFrameworks 0.8.4 (windows)
ofxTrueTypeFontUC is distributed under the MIT License. This gives everyone the freedoms to use ofxTrueTypeFontUC in any context: commercial or non-commercial, public or private, open or closed source. Please see License.txt for details.