From 770f3be74eeade974b9c5ccc36b85eaa8f02bf79 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Tue, 30 Jun 2020 16:04:25 +0100 Subject: [PATCH] Make font sizes more accurate to the vanilla EXE This is such a nightmare --- src/Draw.cpp | 14 +++++++++++++- src/Font.cpp | 4 ---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Draw.cpp b/src/Draw.cpp index e70364ff..6dfd6899 100644 --- a/src/Draw.cpp +++ b/src/Draw.cpp @@ -653,6 +653,17 @@ void InitTextObject(const char *name) switch (mag) { +#ifdef JAPANESE + case 1: + height = 12; + width = 12; + break; + + case 2: + height = 20; + width = 20; + break; +#else case 1: height = 10; width = 9; @@ -660,8 +671,9 @@ void InitTextObject(const char *name) case 2: height = 18; - width = 16; + width = 17; break; +#endif } font = LoadFont(path.c_str(), width, height); diff --git a/src/Font.cpp b/src/Font.cpp index d1868a70..beb0c6a3 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -1069,10 +1069,6 @@ FontObject* LoadFontFromData(const unsigned char *data, size_t data_size, unsign if (FT_New_Memory_Face(font_object->library, font_object->data, (FT_Long)data_size, 0, &font_object->face) == 0) { -#ifdef JAPANESE - cell_width = 0; // Cheap hack to make the font square -#endif - FT_Set_Pixel_Sizes(font_object->face, cell_width, cell_height); font_object->glyph_list_head = NULL;