From 295dea89cbd3e7f34cbe40a26a61e6cf9137b26c Mon Sep 17 00:00:00 2001 From: Matt Mullins Date: Tue, 29 May 2012 22:10:46 -0700 Subject: [PATCH] Render all text with the UTF-8 encoding. This fixes issues where Japanese characters are showing up as boxes. --- Level.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Level.cpp b/Level.cpp index 588439b..d16b65e 100644 --- a/Level.cpp +++ b/Level.cpp @@ -55,10 +55,8 @@ void SDL_GL_RenderText(string s, TTF_Font *font, SDL_Color color, SDL_Rect *loca int w,h; Texture texture; - Uint16 t[] = {'日','本','語'}; - /* Use SDL_TTF to render our text */ - initial = unicode?TTF_RenderUNICODE_Blended(font, t, color):TTF_RenderText_Blended(font, text, color); + initial = TTF_RenderUTF8_Blended(font, s.c_str(), color); /* Convert the rendered text to a known format */ w = initial->w; -- 2.11.0