From e04effec37e407ba6dcc27a2cdd6fc4155d9d618 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Tue, 31 Jan 2023 23:10:53 +0000 Subject: [PATCH] Switched the engine to use SDL2_ttf UTF-8 text capabilities --- src/GameEngine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GameEngine.c b/src/GameEngine.c index 12e4d81..9e3e6ca 100644 --- a/src/GameEngine.c +++ b/src/GameEngine.c @@ -366,7 +366,7 @@ TextSize get_text_size_from_font_asset(AssetID id, const char *text) { return output; } - TTF_SizeText(font, text, &(output.width), &(output.height)); + TTF_SizeUTF8(font, text, &(output.width), &(output.height)); return output; } @@ -382,7 +382,7 @@ void render_text_with_font_asset(AssetID id, const char *text, f32 x, f32 y, return; } - SDL_Surface *surface = TTF_RenderText_Solid(font, text, color); + SDL_Surface *surface = TTF_RenderUTF8_Solid(font, text, color); if (!surface) { return; } @@ -390,7 +390,7 @@ void render_text_with_font_asset(AssetID id, const char *text, f32 x, f32 y, // Get the width and height, in pixels, of the text rendered using the font i32 w = 0; i32 h = 0; - TTF_SizeText(font, text, &w, &h); + TTF_SizeUTF8(font, text, &w, &h); RenderRect rect = {x, y, w, h};