mirror of
https://github.com/ocornut/imgui.git
synced 2026-05-28 03:25:25 +08:00
AddFontDefault(): shallow simplification.
This commit is contained in:
@@ -17160,7 +17160,7 @@ void ImGui::DebugNodeFontGlyph(ImFont* font, const ImFontGlyph* glyph)
|
|||||||
if (glyph->PackId >= 0)
|
if (glyph->PackId >= 0)
|
||||||
{
|
{
|
||||||
ImTextureRect* r = ImFontAtlasPackGetRect(font->ContainerAtlas, glyph->PackId);
|
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);
|
Text("SourceIdx: %d", glyph->SourceIdx);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-3
@@ -3116,9 +3116,7 @@ ImFont* ImFontAtlas::AddFontDefault(const ImFontConfig* font_cfg_template)
|
|||||||
|
|
||||||
int ttf_compressed_size = 0;
|
int ttf_compressed_size = 0;
|
||||||
const char* ttf_compressed = GetDefaultCompressedFontDataTTF(&ttf_compressed_size);
|
const char* ttf_compressed = GetDefaultCompressedFontDataTTF(&ttf_compressed_size);
|
||||||
const ImWchar* glyph_ranges = font_cfg.GlyphRanges != NULL ? font_cfg.GlyphRanges : GetGlyphRangesDefault();
|
return AddFontFromMemoryCompressedTTF(ttf_compressed, ttf_compressed_size, font_cfg.SizePixels, &font_cfg);
|
||||||
ImFont* font = AddFontFromMemoryCompressedTTF(ttf_compressed, ttf_compressed_size, font_cfg.SizePixels, &font_cfg, glyph_ranges);
|
|
||||||
return font;
|
|
||||||
#else
|
#else
|
||||||
IM_ASSERT(0 && "AddFontDefault() disabled in this build.");
|
IM_ASSERT(0 && "AddFontDefault() disabled in this build.");
|
||||||
IM_UNUSED(font_cfg_template);
|
IM_UNUSED(font_cfg_template);
|
||||||
|
|||||||
Reference in New Issue
Block a user