All your strings needs to use UTF-8 encoding. Specifying literal in your source code using a local code page (such as CP-923 for Japanese CP-1251 for Cyrillic) will not work.
All your strings needs to use UTF-8 encoding. Specifying literal in your source code using a local code page (such as CP-923 for Japanese CP-1251 for Cyrillic) will NOT work!
In C++11 you can encode a string literal in UTF-8 by using the u8"hello" syntax. Otherwise you can convert yourself to UTF-8 or load text data from file already saved as UTF-8.
You can also try to remap your local codepage characters to their Unicode codepoint using font->AddRemapChar(), but international users may have problems reading/editing your source code.
// Helpers to retrieve list of common Unicode ranges (2 value per range, values are inclusive, zero-terminated list)
// NB: Make sure that your string are UTF-8 and NOT in your local code page. In C++11, you can create a UTF-8 string literally using the u8"Hello world" syntax. See FAQ for details.
// NB: Make sure that your string are UTF-8 and NOT in your local code page. In C++11, you can create UTF-8 string literal using the u8"Hello world" syntax. See FAQ for details.
IMGUI_APIconstImWchar*GetGlyphRangesDefault();// Basic Latin, Extended Latin
IMGUI_APIconstImWchar*GetGlyphRangesKorean();// Default + Korean characters
IMGUI_APIconstImWchar*GetGlyphRangesJapanese();// Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
@ -1358,6 +1358,19 @@ struct ImFontAtlas
IMGUI_APIconstImWchar*GetGlyphRangesCyrillic();// Default + about 400 Cyrillic characters
voidSetBit(intn){UsedChars[n>>3]|=1<<(n&7);}// Set bit 'c' in the array
voidAddChar(ImWcharc){SetBit(c);}// Add character
IMGUI_APIvoidAddText(constchar*text,constchar*text_end=NULL);// Add string (each character of the UTF-8 string are added)
IMGUI_APIvoidAddRanges(constImWchar*ranges);// Add ranges, e.g. builder.AddRanges(ImFontAtlas::GetGlyphRangesDefault) to force add all of ASCII/Latin+Ext
IMGUI_APIvoidBuildRanges(ImVector<ImWchar>*out_ranges);// Output new ranges
};
// Members
// (Access texture data via GetTexData*() calls which will setup a default font for you.)
ImTextureIDTexID;// User data to refer to the texture once it has been uploaded to user's graphic systems. It is passed back to you during rendering via the ImDrawCmd structure.