Make font sizes more accurate to the vanilla EXE

This is such a nightmare
This commit is contained in:
Clownacy 2020-06-30 16:04:25 +01:00
parent 78da025796
commit 770f3be74e
2 changed files with 13 additions and 5 deletions

View file

@ -653,6 +653,17 @@ void InitTextObject(const char *name)
switch (mag) switch (mag)
{ {
#ifdef JAPANESE
case 1:
height = 12;
width = 12;
break;
case 2:
height = 20;
width = 20;
break;
#else
case 1: case 1:
height = 10; height = 10;
width = 9; width = 9;
@ -660,8 +671,9 @@ void InitTextObject(const char *name)
case 2: case 2:
height = 18; height = 18;
width = 16; width = 17;
break; break;
#endif
} }
font = LoadFont(path.c_str(), width, height); font = LoadFont(path.c_str(), width, height);

View file

@ -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) 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); FT_Set_Pixel_Sizes(font_object->face, cell_width, cell_height);
font_object->glyph_list_head = NULL; font_object->glyph_list_head = NULL;