@ -275,6 +275,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- font: MergeMode: flags to select overwriting or not (this is now very easy with refactored ImFontAtlasBuildWithStbTruetype)
- font: free the Alpha buffer if user only requested RGBA.
!- font: better CalcTextSizeA() API, at least for simple use cases. current one is horrible (perhaps have simple vs extended versions).
- font: for the purpose of RenderTextEllipsis(), it might be useful that CalcTextSizeA() can ignore the trailing padding?
- font: a CalcTextHeight() helper could run faster than CalcTextSize().y
- font: enforce monospace through ImFontConfig (for icons?) + create dual ImFont output from same input, reusing rasterized data but with different glyphs/AdvanceX
- font: finish CustomRectRegister() to allow mapping Unicode codepoint to custom texture data
// Another overly complex function until we reorganize everything into a nice all-in-one helper.
// This is made more complex because we have dissociated the layout rectangle (pos_min..pos_max) which define _where_ the ellipsis is, from actual clipping of text and limit of the ellipsis display.
// This is because in the context of tabs we selectively hide part of the text when the Close Button appears, but we don't want the ellipsis to move.
boolMergeMode;// 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.
unsignedintRasterizerFlags;// 0x00 // Settings for custom font rasterizer (e.g. ImGuiFreeType). Leave as zero if you aren't using one.
floatRasterizerMultiply;// 1.0f // Brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable.
ImWcharEllipsisChar;// -1 // Explicitly specify unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used.
// [Internal]
charName[40];// Name (strictly to ease debugging)
@ -2187,7 +2188,8 @@ struct ImFont
ImFontAtlas*ContainerAtlas;// 4-8 // out // // What we has been loaded into
constImFontConfig*ConfigData;// 4-8 // in // // Pointer within ContainerAtlas->ConfigData
shortConfigDataCount;// 2 // in // ~ 1 // Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont.
ImWcharFallbackChar;// 2 // in // = '?' // Replacement glyph if one isn't found. Only set via SetFallbackChar()
ImWcharFallbackChar;// 2 // in // = '?' // Replacement character if a glyph isn't found. Only set via SetFallbackChar()
ImWcharEllipsisChar;// 2 // out // = -1 // Character used for ellipsis rendering.
floatScale;// 4 // in // = 1.f // Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale()
floatAscent,Descent;// 4+4 // out // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]
intMetricsTotalSurface;// 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)
ImGui::SameLine();HelpMarker("Note than the default embedded font is NOT meant to be scaled.\n\nFont are currently rendered into bitmaps at a given size at the time of building the atlas. You may oversample them to get some flexibility with scaling. You can also render at multiple sizes and select which one to use at runtime.\n\n(Glimmer of hope: the atlas system should hopefully be rewritten in the future to make scaling more natural and automatic.)");