diff options
author | chai <chaifix@163.com> | 2018-10-14 09:47:53 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-14 09:47:53 +0800 |
commit | d94f4a50e1e967c5d225720002c439107124bc13 (patch) | |
tree | ae902c9a62c84c28826966abab1aaf07a59e3d34 /test | |
parent | 05e500a0d6df6fdc30e00ca3bd487380d64f6ada (diff) |
*修改文字渲染
Diffstat (limited to 'test')
-rw-r--r-- | test/05Font/main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/05Font/main.cpp b/test/05Font/main.cpp index 44aefac..6eebe04 100644 --- a/test/05Font/main.cpp +++ b/test/05Font/main.cpp @@ -66,8 +66,10 @@ Color frag(Color col, Texture tex, Vertex v) fs->read("font.ttf", &buffer); data = TTFData::createTTFData((const unsigned char*)buffer.data, buffer.size); font = TTF::createTTF(data, 15); - page = font->typeset(Unicode::Iterator(Unicode::Encode::UTF8, u8R"(测试)"), 15, 0); - delete data; + const char* str = u8R"(源氏物语げんじものがたり)"; + int l = strlen(str); + page = font->typeset(unicode::Text(unicode::Encode::UTF8, str, strlen(str)), 15, 0); + delete data; //canvas = Canvas::createCanvas(100, 100); //page = font->typeset("こんにちは世界!", 120, 20); buffer.clear(); |