|
33 | 33 | // Library Version
|
34 | 34 | // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
|
35 | 35 | #define IMGUI_VERSION "1.91.8 WIP"
|
36 |
| -#define IMGUI_VERSION_NUM 19171 |
| 36 | +#define IMGUI_VERSION_NUM 19172 |
37 | 37 | #define IMGUI_HAS_TABLE
|
38 | 38 | #define IMGUI_HAS_VIEWPORT // Viewport WIP branch
|
39 | 39 | #define IMGUI_HAS_DOCK // Docking WIP branch
|
@@ -3379,26 +3379,27 @@ CIMGUI_API void ImDrawData_ScaleClipRects(ImDrawData* self, ImVec2 fb_scale);
|
3379 | 3379 | // [SECTION] Font API (ImFontConfig, ImFontGlyph, ImFontAtlasFlags, ImFontAtlas, ImFontGlyphRangesBuilder, ImFont)
|
3380 | 3380 | //-----------------------------------------------------------------------------
|
3381 | 3381 |
|
| 3382 | +// A font input/source (we may rename this to ImFontSource in the future) |
3382 | 3383 | struct ImFontConfig_t
|
3383 | 3384 | {
|
3384 | 3385 | void* FontData; // // TTF/OTF data
|
3385 | 3386 | int FontDataSize; // // TTF/OTF data size
|
3386 | 3387 | bool FontDataOwnedByAtlas; // true // TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself).
|
| 3388 | + bool MergeMode; // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights. |
| 3389 | + bool PixelSnapH; // false // Align every glyph AdvanceX to pixel boundaries. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1. |
3387 | 3390 | int FontNo; // 0 // Index of font within TTF/OTF file
|
3388 |
| - float SizePixels; // // Size in pixels for rasterizer (more or less maps to the resulting font height). |
3389 | 3391 | int OversampleH; // 2 // Rasterize at higher quality for sub-pixel positioning. Note the difference between 2 and 3 is minimal. You can reduce this to 1 for large glyphs save memory. Read https://github.com/nothings/stb/blob/master/tests/oversample/README.md for details.
|
3390 | 3392 | int OversampleV; // 1 // Rasterize at higher quality for sub-pixel positioning. This is not really useful as we don't use sub-pixel positions on the Y axis.
|
3391 |
| - bool PixelSnapH; // false // Align every glyph AdvanceX to pixel boundaries. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1. |
| 3393 | + float SizePixels; // // Size in pixels for rasterizer (more or less maps to the resulting font height). |
3392 | 3394 | ImVec2 GlyphExtraSpacing; // 0, 0 // Extra spacing (in pixels) between glyphs when rendered: essentially add to glyph->AdvanceX. Only X axis is supported for now.
|
3393 | 3395 | ImVec2 GlyphOffset; // 0, 0 // Offset all glyphs from this font input.
|
3394 | 3396 | const ImWchar* GlyphRanges; // NULL // THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE. Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list).
|
3395 | 3397 | float GlyphMinAdvanceX; // 0 // Minimum AdvanceX for glyphs, set Min to align font icons, set both Min/Max to enforce mono-space font
|
3396 | 3398 | float GlyphMaxAdvanceX; // FLT_MAX // Maximum AdvanceX for glyphs
|
3397 |
| - bool MergeMode; // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights. |
3398 | 3399 | unsigned int FontBuilderFlags; // 0 // Settings for custom font builder. THIS IS BUILDER IMPLEMENTATION DEPENDENT. Leave as zero if unsure.
|
3399 | 3400 | float RasterizerMultiply; // 1.0f // Linearly brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable. This is a silly thing we may remove in the future.
|
3400 | 3401 | float RasterizerDensity; // 1.0f // DPI scale for rasterization, not altering other font metrics: make it easy to swap between e.g. a 100% and a 400% fonts for a zooming display. IMPORTANT: If you increase this it is expected that you increase font scale accordingly, otherwise quality may look lowered.
|
3401 |
| - ImWchar EllipsisChar; // 0 // Explicitly specify unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used. |
| 3402 | + ImWchar EllipsisChar; // 0 // Explicitly specify Unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used. |
3402 | 3403 |
|
3403 | 3404 | // [Internal]
|
3404 | 3405 | char Name[40]; // Name (strictly to ease debugging)
|
@@ -3591,11 +3592,11 @@ struct ImFont_t
|
3591 | 3592 | ImWchar FallbackChar; // 2-4 // out // = FFFD/'?' // Character used if a glyph isn't found.
|
3592 | 3593 | float EllipsisWidth; // 4 // out // Width
|
3593 | 3594 | float EllipsisCharStep; // 4 // out // Step between characters when EllipsisCount > 0
|
3594 |
| - bool DirtyLookupTables; // 1 // out // |
3595 | 3595 | float Scale; // 4 // in // = 1.f // Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale()
|
3596 | 3596 | float Ascent, Descent; // 4+4 // out // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize] (unscaled)
|
3597 | 3597 | int MetricsTotalSurface; // 4 // out // // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
|
3598 |
| - ImU8 Used4kPagesMap[(IM_UNICODE_CODEPOINT_MAX +1)/4096/8]; // 2 bytes if ImWchar=ImWchar16, 34 bytes if ImWchar==ImWchar32. Store 1-bit for each block of 4K codepoints that has one active glyph. This is mainly used to facilitate iterations across all used codepoints. |
| 3598 | + bool DirtyLookupTables; // 1 // out // |
| 3599 | + ImU8 Used8kPagesMap[(IM_UNICODE_CODEPOINT_MAX +1)/8192/8]; // 1 bytes if ImWchar=ImWchar16, 16 bytes if ImWchar==ImWchar32. Store 1-bit for each block of 4K codepoints that has one active glyph. This is mainly used to facilitate iterations across all used codepoints. |
3599 | 3600 | };
|
3600 | 3601 | CIMGUI_API const ImFontGlyph* ImFont_FindGlyph(ImFont* self, ImWchar c);
|
3601 | 3602 | CIMGUI_API const ImFontGlyph* ImFont_FindGlyphNoFallback(ImFont* self, ImWchar c);
|
|
0 commit comments