@ -69,7 +69,7 @@
config.OversampleH = 3;
config.OversampleH = 3;
config.OversampleV = 3;
config.OversampleV = 3;
config.GlyphExtraSpacing.x = 1.0f;
config.GlyphExtraSpacing.x = 1.0f;
io.Fonts->Load FromFileTTF("myfontfile.ttf", size_pixels, &config);
io.Fonts->AddFont FromFileTTF("myfontfile.ttf", size_pixels, &config);
Merge two fonts:
Merge two fonts:
@ -80,14 +80,14 @@
ImWchar ranges[] = { 0xf000, 0xf3ff, 0 };
ImWchar ranges[] = { 0xf000, 0xf3ff, 0 };
ImFontConfig config;
ImFontConfig config;
config.MergeMode = true;
config.MergeMode = true;
io.Fonts->Load FromFileTTF("fontawesome-webfont.ttf", 16.0f, &config, ranges);
io.Fonts->AddFont FromFileTTF("fontawesome-webfont.ttf", 16.0f, &config, ranges);
io.Fonts->Load FromFileTTF("myfontfile.ttf", size_pixels, NULL, &config, io.Fonts->GetGlyphRangesJapanese());
io.Fonts->AddFont FromFileTTF("myfontfile.ttf", size_pixels, NULL, &config, io.Fonts->GetGlyphRangesJapanese());
Add a fourth parameter to bake specific font ranges only:
Add a fourth parameter to bake specific font ranges only:
io.Fonts->Load FromFileTTF("myfontfile.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesDefault()); // Basic Latin, Extended Latin
io.Fonts->AddFont FromFileTTF("myfontfile.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesDefault()); // Basic Latin, Extended Latin
io.Fonts->Load FromFileTTF("myfontfile.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesJapanese()); // Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
io.Fonts->AddFont FromFileTTF("myfontfile.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesJapanese()); // Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
io.Fonts->Load FromFileTTF("myfontfile.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesChinese()); // Include full set of about 21000 CJK Unified Ideographs
io.Fonts->AddFont FromFileTTF("myfontfile.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesChinese()); // Include full set of about 21000 CJK Unified Ideographs
Offset font vertically by altering the io.Font->DisplayOffset value:
Offset font vertically by altering the io.Font->DisplayOffset value: