From 20e70f9caa7cb032cf5dd8c803f22c80aeeecf35 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Tue, 20 Jul 2021 19:57:35 +1000 Subject: [PATCH 1/2] (Wii U) Only sample alpha channel when rendering fonts The font backend provides only the alpha channel for a given glyph, but we were sampling that channel for the r, g, b and a. Fix by hard-coding the sampled colour to white - the actually desired colour is multiplied in later. --- gfx/drivers_font/wiiu_font.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/drivers_font/wiiu_font.c b/gfx/drivers_font/wiiu_font.c index b9ba5369bc..0adb22f382 100644 --- a/gfx/drivers_font/wiiu_font.c +++ b/gfx/drivers_font/wiiu_font.c @@ -65,7 +65,7 @@ static void* wiiu_font_init_font(void* data, const char* font_path, font->texture.viewNumSlices = 1; font->texture.surface.format = GX2_SURFACE_FORMAT_UNORM_R8; - font->texture.compMap = GX2_COMP_SEL(_R, _R, _R, _R); + font->texture.compMap = GX2_COMP_SEL(_1, _1, _1, _R); GX2CalcSurfaceSizeAndAlignment(&font->texture.surface); GX2InitTextureRegs(&font->texture); From 60c32fe4945ee5f7434655e85abd8aed8723ec72 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Tue, 20 Jul 2021 20:05:44 +1000 Subject: [PATCH 2/2] (Wii U) Render font lines with correct spacing No idea about this one, borrowed code from the Vita and it makes multi-line rendering look correct again --- gfx/drivers_font/wiiu_font.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/drivers_font/wiiu_font.c b/gfx/drivers_font/wiiu_font.c index 0adb22f382..3bbd111b01 100644 --- a/gfx/drivers_font/wiiu_font.c +++ b/gfx/drivers_font/wiiu_font.c @@ -258,7 +258,7 @@ static void wiiu_font_render_message( return; } - line_height = scale / line_metrics->height; + line_height = line_metrics->height * scale / wiiu->vp.height; for (;;) {