|
@@ -775,15 +775,15 @@ CODE
|
|
|
config.OversampleV = 1;
|
|
|
config.GlyphOffset.y -= 2.0f; // Move everything by 2 pixels up
|
|
|
config.GlyphExtraSpacing.x = 1.0f; // Increase spacing between characters
|
|
|
- io.Fonts->LoadFromFileTTF("myfontfile.ttf", size_pixels, &config);
|
|
|
+ io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_pixels, &config);
|
|
|
|
|
|
// Combine multiple fonts into one (e.g. for icon fonts)
|
|
|
static ImWchar ranges[] = { 0xf000, 0xf3ff, 0 };
|
|
|
ImFontConfig config;
|
|
|
config.MergeMode = true;
|
|
|
io.Fonts->AddFontDefault();
|
|
|
- io.Fonts->LoadFromFileTTF("fontawesome-webfont.ttf", 16.0f, &config, ranges); // Merge icon font
|
|
|
- io.Fonts->LoadFromFileTTF("myfontfile.ttf", size_pixels, NULL, &config, io.Fonts->GetGlyphRangesJapanese()); // Merge japanese glyphs
|
|
|
+ io.Fonts->AddFontFromFileTTF("fontawesome-webfont.ttf", 16.0f, &config, ranges); // Merge icon font
|
|
|
+ io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_pixels, NULL, &config, io.Fonts->GetGlyphRangesJapanese()); // Merge japanese glyphs
|
|
|
|
|
|
Q: How can I display and input non-Latin characters such as Chinese, Japanese, Korean, Cyrillic?
|
|
|
A: When loading a font, pass custom Unicode ranges to specify the glyphs to load.
|