From e5d0d8334ffe1406d4a264bb151b322291fa215a Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 11 Jan 2015 21:55:21 +0000 Subject: [PATCH] Tweak default texture width for large amount of characters. --- imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index d09204f2..9a48e19d 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6439,9 +6439,9 @@ bool ImFont::LoadFromMemoryTTF(const void* data, size_t data_size, float size } { - TexWidth = 512; + TexWidth = (glyph_count > 1000) ? 1024 : 512; // Width doesn't really matters. TexHeight = 0; - const int max_tex_height = 1024*16; + const int max_tex_height = 1024*32; stbtt_pack_context spc; int ret = stbtt_PackBegin(&spc, NULL, TexWidth, max_tex_height, 0, 1, NULL); IM_ASSERT(ret);