1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-19 01:24:20 +00:00

Merge branch 'master' into docking

# Conflicts:
#	backends/imgui_impl_sdlgpu3.cpp
#	backends/imgui_impl_vulkan.cpp
#	backends/imgui_impl_win32.cpp
This commit is contained in:
ocornut 2025-05-07 15:24:46 +02:00
commit 1c8fad73f8
19 changed files with 223 additions and 47 deletions

View file

@ -21146,6 +21146,18 @@ static void MetricsHelpMarker(const char* desc)
// [DEBUG] List fonts in a font atlas and display its texture
void ImGui::ShowFontAtlas(ImFontAtlas* atlas)
{
ImGuiContext& g = *GImGui;
Text("Read ");
SameLine(0, 0);
TextLinkOpenURL("https://www.dearimgui.com/faq/");
SameLine(0, 0);
Text(" for details on font loading.");
ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig;
Checkbox("Show font preview", &cfg->ShowFontPreview);
// Font list
for (ImFont* font : atlas->Fonts)
{
PushID(font);
@ -21154,7 +21166,6 @@ void ImGui::ShowFontAtlas(ImFontAtlas* atlas)
}
if (TreeNode("Font Atlas", "Font Atlas (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight))
{
ImGuiContext& g = *GImGui;
PushStyleVar(ImGuiStyleVar_ImageBorderSize, ImMax(1.0f, g.Style.ImageBorderSize));
ImageWithBg(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
PopStyleVar();
@ -22125,6 +22136,8 @@ void ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list, co
// [DEBUG] Display details for a single font, called by ShowStyleEditor().
void ImGui::DebugNodeFont(ImFont* font)
{
ImGuiContext& g = *GImGui;
ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig;
bool opened = TreeNode(font, "Font: \"%s\": %.2f px, %d glyphs, %d sources(s)",
font->Sources ? font->Sources[0].Name : "", font->FontSize, font->Glyphs.Size, font->SourcesCount);
@ -22132,9 +22145,12 @@ void ImGui::DebugNodeFont(ImFont* font)
if (!opened)
Indent();
Indent();
PushFont(font);
Text("The quick brown fox jumps over the lazy dog");
PopFont();
if (cfg->ShowFontPreview)
{
PushFont(font);
Text("The quick brown fox jumps over the lazy dog");
PopFont();
}
if (!opened)
{
Unindent();