From f7a443b4e9a7a47e53e85aa028c71f18cd1e5f47 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 17 Jul 2015 11:03:15 +0200 Subject: [PATCH] (Android) (Nvidia Shield Portable) Some kind of edge case happens on Shield Portable that causes it to keep allocating for a long time until it simply fails and falls back to the bitmap font renderer. Currently seems to be happening on character 160. Quick hack until we fix the real underlying issue. --- gfx/drivers_font_renderer/stb.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/gfx/drivers_font_renderer/stb.c b/gfx/drivers_font_renderer/stb.c index dd86b5b1c5..61f2f11034 100644 --- a/gfx/drivers_font_renderer/stb.c +++ b/gfx/drivers_font_renderer/stb.c @@ -94,13 +94,16 @@ alloc_atlas: /* make sure important characters fit */ if (isprint(i) && !isspace(i) && (!g->width || !g->height)) { - /* increase atlas by 20% in all directions */ - self->atlas.width *= 1.2; - self->atlas.height *= 1.2; + if (i != 160) + { + /* increase atlas by 20% in all directions */ + self->atlas.width *= 1.2; + self->atlas.height *= 1.2; - free(self->atlas.buffer); - goto alloc_atlas; - break; + free(self->atlas.buffer); + goto alloc_atlas; + break; + } } }