중국어 , 한국어 완벽지원 addon , ofxFontStash
ofxFontStash
https://github.com/armadillu/ofxFontStash
예제를 보면 직접 코드에 중국어 등을 입력 하여 출력 하였지만,
Visual C++ 2015 에서의 cpp 안에 직접 작성한 문자열이 UTF8을 정확히 읽지 못하는것으로 예상, 그래서 외부의 Txt을 불러와 랜더링을 하였다.
#include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup() { //ofEnableAlphaBlending(); ofSetVerticalSync(true); ofSetFrameRate(60); ofBackground(22, 22, 22, 255); unicodeFont.setup("Arial Unicode.ttf", //font file, ttf only 1.0, //lineheight percent 1024, //texture atlas dimension true, //create mipmaps of the font, useful to scale down the font at smaller sizes 8, //texture atlas element padding, shouldbe >0 if using mipmaps otherwise 4.0f //dpi scaleup, render textures @2x the reso ); //lower res mipmaps wil bleed into each other unicodeFont.setLodBias(-1); ofFile f("text.txt" , ofFile::Mode::ReadOnly); ofBuffer buf = f.readToBuffer().getText(); f.close(); str = buf.getText(); } void ofApp::update() { } //-------------------------------------------------------------- void ofApp::draw() { ofSetColor(255); unicodeFont.drawMultiLine(str, 30, 0, 30); }
ㄴ
Hello.
한글테스트.
首先要拥有一个优酷帐号,
并申请加入视频云,点击这里注册优酷帐号
一个开发者帐号可以申请多个应用
(client_id),点击这里申请
应用自动生效,可作为开发和测试使用。
应用分为四个等级,普通、中级、
高级和合作级。升级后不同等级应用可
调用不同API。
영어, 한글, 중국어 모두 정상적으로 출력된다.
'C++(oF)' 카테고리의 다른 글
비연결형 소켓 OF (C++) 편 (0) | 2017.02.24 |
---|---|
Generic Singleton Base Class (0) | 2017.02.24 |
중국어 , 한국어 완벽지원 addon , ofxFontStash (0) | 2016.09.01 |
Visual Studio 2015 에서 Icon 바꾸기 (0) | 2016.08.27 |
libVLC 를 이용한 캡처장치 수신 (0) | 2016.07.31 |
보다 높은 퍼포먼스를 위한 LIBVLC 사용 (0) | 2016.07.29 |
C++(oF)
2016. 9. 1. 22:13
댓글을 달아 주세요