[DEBUG] List fonts in a font atlas and display its texture
| 13610 | |
| 13611 | // [DEBUG] List fonts in a font atlas and display its texture |
| 13612 | void 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 | |
| 13632 | void ImGui::ShowMetricsWindow(bool* p_open) |
| 13633 | { |