From 319c481abb380fcc0c37d6310f3f083ecff22c63 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 26 Aug 2025 17:57:51 +0200 Subject: [PATCH] AddFontDefault(): shallow simplification. --- imgui.cpp | 2 +- imgui_draw.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 16ae8d123..18e67eab2 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -17160,7 +17160,7 @@ void ImGui::DebugNodeFontGlyph(ImFont* font, const ImFontGlyph* glyph) if (glyph->PackId >= 0) { ImTextureRect* r = ImFontAtlasPackGetRect(font->ContainerAtlas, glyph->PackId); - Text("PackId: %d (%dx%d rect at %d,%d)", glyph->PackId, r->w, r->h, r->x, r->y); + Text("PackId: 0x%X (%dx%d rect at %d,%d)", glyph->PackId, r->w, r->h, r->x, r->y); } Text("SourceIdx: %d", glyph->SourceIdx); } diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 31beb4133..c4dd43a52 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -3116,9 +3116,7 @@ ImFont* ImFontAtlas::AddFontDefault(const ImFontConfig* font_cfg_template) int ttf_compressed_size = 0; const char* ttf_compressed = GetDefaultCompressedFontDataTTF(&ttf_compressed_size); - const ImWchar* glyph_ranges = font_cfg.GlyphRanges != NULL ? font_cfg.GlyphRanges : GetGlyphRangesDefault(); - ImFont* font = AddFontFromMemoryCompressedTTF(ttf_compressed, ttf_compressed_size, font_cfg.SizePixels, &font_cfg, glyph_ranges); - return font; + return AddFontFromMemoryCompressedTTF(ttf_compressed, ttf_compressed_size, font_cfg.SizePixels, &font_cfg); #else IM_ASSERT(0 && "AddFontDefault() disabled in this build."); IM_UNUSED(font_cfg_template);