MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / ImFontAtlasBuildInit

Function ImFontAtlasBuildInit

KBotExt/imgui/imgui_draw.cpp:2811–2829  ·  view source on GitHub ↗

Note: this is called / shared by both the stb_truetype and the FreeType builder

Source from the content-addressed store, hash-verified

2809
2810// Note: this is called / shared by both the stb_truetype and the FreeType builder
2811void ImFontAtlasBuildInit(ImFontAtlas* atlas)
2812{
2813 // Register texture region for mouse cursors or standard white pixels
2814 if (atlas->PackIdMouseCursors < 0)
2815 {
2816 if (!(atlas->Flags & ImFontAtlasFlags_NoMouseCursors))
2817 atlas->PackIdMouseCursors = atlas->AddCustomRectRegular(FONT_ATLAS_DEFAULT_TEX_DATA_W * 2 + 1, FONT_ATLAS_DEFAULT_TEX_DATA_H);
2818 else
2819 atlas->PackIdMouseCursors = atlas->AddCustomRectRegular(2, 2);
2820 }
2821
2822 // Register texture region for thick lines
2823 // The +2 here is to give space for the end caps, whilst height +1 is to accommodate the fact we have a zero-width row
2824 if (atlas->PackIdLines < 0)
2825 {
2826 if (!(atlas->Flags & ImFontAtlasFlags_NoBakedLines))
2827 atlas->PackIdLines = atlas->AddCustomRectRegular(IM_DRAWLIST_TEX_LINES_WIDTH_MAX + 2, IM_DRAWLIST_TEX_LINES_WIDTH_MAX + 1);
2828 }
2829}
2830
2831// This is called/shared by both the stb_truetype and the FreeType builder.
2832void ImFontAtlasBuildFinish(ImFontAtlas* atlas)

Callers 2

Calls 1

AddCustomRectRegularMethod · 0.80

Tested by

no test coverage detected