MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / ImFontAtlasBuildInit

Function ImFontAtlasBuildInit

plugins/Cardinal/src/DearImGui/imgui_draw.cpp:2759–2777  ·  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

2757
2758// Note: this is called / shared by both the stb_truetype and the FreeType builder
2759void ImFontAtlasBuildInit(ImFontAtlas* atlas)
2760{
2761 // Register texture region for mouse cursors or standard white pixels
2762 if (atlas->PackIdMouseCursors < 0)
2763 {
2764 if (!(atlas->Flags & ImFontAtlasFlags_NoMouseCursors))
2765 atlas->PackIdMouseCursors = atlas->AddCustomRectRegular(FONT_ATLAS_DEFAULT_TEX_DATA_W * 2 + 1, FONT_ATLAS_DEFAULT_TEX_DATA_H);
2766 else
2767 atlas->PackIdMouseCursors = atlas->AddCustomRectRegular(2, 2);
2768 }
2769
2770 // Register texture region for thick lines
2771 // 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
2772 if (atlas->PackIdLines < 0)
2773 {
2774 if (!(atlas->Flags & ImFontAtlasFlags_NoBakedLines))
2775 atlas->PackIdLines = atlas->AddCustomRectRegular(IM_DRAWLIST_TEX_LINES_WIDTH_MAX + 2, IM_DRAWLIST_TEX_LINES_WIDTH_MAX + 1);
2776 }
2777}
2778
2779// This is called/shared by both the stb_truetype and the FreeType builder.
2780void ImFontAtlasBuildFinish(ImFontAtlas* atlas)

Callers 1

Calls 1

AddCustomRectRegularMethod · 0.80

Tested by

no test coverage detected