Examples: Extracted gamepad code into ImGui_ImplGlfw_UpdateGamepads(). Renamed matching Win32 function for consistency.

Added more link to nothing's oversample document. Spacing bits.
This commit is contained in:
omar
2019-02-14 18:55:08 +01:00
parent 3c07ec6a61
commit 93d1179805
5 changed files with 53 additions and 44 deletions

View File

@ -25,7 +25,7 @@ If you have other loading/merging/adding fonts, you can post on the Dear ImGui "
- Building Custom Glyph Ranges
- Embedding Fonts in Source Code
- Credits/Licences for fonts included in this folder
- Links, Other fonts
- Fonts Links
---------------------------------------
@ -106,11 +106,14 @@ Load .TTF/.OTF file with:
For advanced options create a ImFontConfig structure and pass it to the AddFont function (it will be copied internally):
ImFontConfig config;
config.OversampleH = 3;
config.OversampleH = 2;
config.OversampleV = 1;
config.GlyphExtraSpacing.x = 1.0f;
ImFont* font = io.Fonts->AddFontFromFileTTF("font.ttf", size_pixels, &config);
Read about oversampling here:
https://github.com/nothings/stb/blob/master/tests/oversample
If you have very large number of glyphs or multiple fonts, the texture may become too big for your graphics API.
The typical result of failing to upload a texture is if every glyphs appears as white rectangles.
In particular, using a large range such as GetGlyphRangesChineseSimplifiedCommon() is not recommended unless you