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

Method ShowFontAtlas

KBotExt/imgui/imgui.cpp:13612–13630  ·  view source on GitHub ↗

[DEBUG] List fonts in a font atlas and display its texture

Source from the content-addressed store, hash-verified

13610
13611// [DEBUG] List fonts in a font atlas and display its texture
13612void ImGui::ShowFontAtlas(ImFontAtlas* atlas)
13613{
13614 for (ImFont* font : atlas->Fonts)
13615 {
13616 PushID(font);
13617 DebugNodeFont(font);
13618 PopID();
13619 }
13620 if (TreeNode("Font Atlas", "Font Atlas (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight))
13621 {
13622 ImGuiContext& g = *GImGui;
13623 ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig;
13624 Checkbox("Tint with Text Color", &cfg->ShowAtlasTintedWithTextColor); // Using text color ensure visibility of core atlas data, but will alter custom colored icons
13625 ImVec4 tint_col = cfg->ShowAtlasTintedWithTextColor ? GetStyleColorVec4(ImGuiCol_Text) : ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
13626 ImVec4 border_col = GetStyleColorVec4(ImGuiCol_Border);
13627 Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), tint_col, border_col);
13628 TreePop();
13629 }
13630}
13631
13632void ImGui::ShowMetricsWindow(bool* p_open)
13633{

Callers

nothing calls this directly

Calls 2

ImVec4Class · 0.85
ImVec2Function · 0.85

Tested by

no test coverage detected