mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-18 06:06:35 +00:00
Update documentation
This commit is contained in:
parent
470200ee5c
commit
96a7873622
@ -14,7 +14,7 @@
|
|||||||
Load .TTF file with:
|
Load .TTF file with:
|
||||||
|
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_pixels);
|
io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels);
|
||||||
|
|
||||||
Detailed options:
|
Detailed options:
|
||||||
|
|
||||||
@ -22,7 +22,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->AddFontFromFileTTF("myfontfile.ttf", size_pixels, &config);
|
io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, &config);
|
||||||
|
|
||||||
Combine two fonts into one:
|
Combine two fonts into one:
|
||||||
|
|
||||||
@ -34,22 +34,22 @@
|
|||||||
ImFontConfig config;
|
ImFontConfig config;
|
||||||
config.MergeMode = true;
|
config.MergeMode = true;
|
||||||
io.Fonts->AddFontFromFileTTF("fontawesome-webfont.ttf", 16.0f, &config, ranges);
|
io.Fonts->AddFontFromFileTTF("fontawesome-webfont.ttf", 16.0f, &config, ranges);
|
||||||
io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_pixels, &config, io.Fonts->GetGlyphRangesJapanese());
|
io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, &config, io.Fonts->GetGlyphRangesJapanese());
|
||||||
|
|
||||||
Add a fourth parameter to bake specific font ranges only:
|
Add a fourth parameter to bake specific font ranges only:
|
||||||
|
|
||||||
// Basic Latin, Extended Latin
|
// Basic Latin, Extended Latin
|
||||||
io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesDefault());
|
io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesDefault());
|
||||||
|
|
||||||
// Include full set of about 21000 CJK Unified Ideographs
|
// Include full set of about 21000 CJK Unified Ideographs
|
||||||
io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesJapanese());
|
io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesJapanese());
|
||||||
|
|
||||||
// Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
|
// Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
|
||||||
io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesChinese());
|
io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, NULL, io.Fonts->GetGlyphRangesChinese());
|
||||||
|
|
||||||
Offset font vertically by altering the io.Font->DisplayOffset value:
|
Offset font vertically by altering the io.Font->DisplayOffset value:
|
||||||
|
|
||||||
ImFont* font = io.Fonts->AddFontFromFileTTF("myfontfile.ttf", size_pixels);
|
ImFont* font = io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels);
|
||||||
font->DisplayOffset.y += 1; // Render 1 pixel down
|
font->DisplayOffset.y += 1; // Render 1 pixel down
|
||||||
|
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user