This file contains hidden or 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
| auto conv_utf8_to_sjis = [](string srcUTF8) -> string | |
| { | |
| int lenghtUnicode = MultiByteToWideChar(CP_UTF8, 0, srcUTF8.c_str(), srcUTF8.size() + 1, NULL, 0); | |
| wchar_t* bufUnicode = new wchar_t[lenghtUnicode]; | |
| MultiByteToWideChar(CP_UTF8, 0, srcUTF8.c_str(), srcUTF8.size() + 1, bufUnicode, lenghtUnicode); | |
| int lengthSJis = WideCharToMultiByte(CP_THREAD_ACP, 0, bufUnicode, -1, NULL, 0, NULL, NULL); | |
| char* bufShiftJis = new char[lengthSJis]; | |
| WideCharToMultiByte(CP_THREAD_ACP, 0, bufUnicode, lenghtUnicode + 1, bufShiftJis, lengthSJis, NULL, NULL); | |
| string strSJis(bufShiftJis); | |
| delete bufUnicode; |
This file contains hidden or 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
| #include <codecvt> | |
| #include "ofxTrueTypeFontUL2.h" // https://github.com/kentaroid/ofxTrueTypeFontUL2 | |
| std::wstring text; | |
| ofxTrueTypeFontUL2 typeface; | |
| void ofApp::setup() { | |
| ofXml xml("multilingual_words.xml"); // have to be saved as UTF-8 with BOM | |
| // do something with xml... | |
| std::string text_from_xml = xml.getAttribute("my_chinese_word"); |
This file contains hidden or 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
| // reference : https://gist.github.com/satoruhiga/1687325 | |
| #pragma once | |
| static int WIDTH = 300; | |
| static int HEIGHT = 300; | |
| #include "ofMain.h" | |
| #include "Poco/Base64Encoder.h" |
This file contains hidden or 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
| (function(){ | |
| var _fillText, | |
| __slice = [].slice; | |
| _fillText = CanvasRenderingContext2D.prototype.fillText; | |
| CanvasRenderingContext2D.prototype.fillText = function() { | |
| var args, offset, previousLetter, str, x, y, | |
| _this = this; |
This file contains hidden or 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
| /* | |
| * This work is free. You can redistribute it and/or modify it under the | |
| * terms of the Do What The Fuck You Want To Public License, Version 2, | |
| * as published by Sam Hocevar. See the COPYING file for more details. | |
| */ | |
| /* | |
| * Easing Functions - inspired from http://gizma.com/easing/ | |
| * only considering the t value for the range [0, 1] => [0, 1] | |
| */ | |
| EasingFunctions = { |