Skip to content

Akira-Hayasaka/ofxTrueTypeFontUC

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

The ofxTrueTypeFontUC is an extension of ofTrueTypeFont class for UNICODE characters.

This addon is under the MIT Licence.


SYNOPSIS:

// ex.) testApp.h

#include "ofxTrueTypeFontUC.h"

class testApp : public ofBaseApp {
    ...
    ofxTrueTypeFontUC myFont;
}

// ex.) testApp.cpp

void testApp::setup() {
    ...
    myFont.loadFont("barfooFont.oft", 64, true, true);
}

void testApp::draw() {
    ...
    std::wstring wide_str = L"こんにちは";
    myFont.drawString(wide_str, 100, 100);  // std::wstring is available.

    std::string str = "はじめまして";
    myFont.drawString(str, 100, 200);  // std::string is available.
}

// Note: The functions that take std::string execute conversion to std::wstring each time they are called. Use the following function, if necessary.

// ex.) testApp.cpp

void testApp::setup() {
    ...
    std::string src_string = "お久しぶりです";
    std::wstring dst_string = util::ofxTrueTypeFontUC::convToWString(src_string);  // conversion to std::wstring
}

About

An extension of ofTrueTypeFont class for UNICODE characters

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 89.7%
  • C 10.3%