diff --git a/src/Draw.cpp b/src/Draw.cpp index 100cc206..483dff2f 100644 --- a/src/Draw.cpp +++ b/src/Draw.cpp @@ -609,7 +609,7 @@ void InitTextObject(const char *name) size_t size; const unsigned char *data = FindResource("FONT", "FONT", &size); - font = LoadFontFromData(data, size, 5 * magnification, 10 * magnification); + font = LoadFontFromData(data, size, 8 * magnification, 9 * magnification); } void PutText(int x, int y, const char *text, unsigned long color) diff --git a/src/Font.cpp b/src/Font.cpp index 2376c6e0..1ab3c8e9 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -1074,35 +1074,11 @@ FontObject* LoadFontFromData(const unsigned char *data, size_t data_size, unsign return NULL; } - unsigned int best_pixel_width = 0; - unsigned int best_pixel_height = 0; - - for (unsigned int i = 0;; ++i) - { - FT_Set_Pixel_Sizes(font_object->face, i, i); - - const unsigned int current_cell_width = font_object->face->size->metrics.max_advance / 64; - const unsigned int current_cell_height = font_object->face->size->metrics.height / 64; - - if (current_cell_width > cell_width && current_cell_height > cell_height) - { - break; - } - else - { - if (current_cell_width <= cell_width) - best_pixel_width = i; - - if (current_cell_height <= cell_height) - best_pixel_height = i; - } - } - #ifdef JAPANESE - best_pixel_width = 0; // Cheap hack to make the font square + cell_width = 0; // Cheap hack to make the font square #endif - FT_Set_Pixel_Sizes(font_object->face, best_pixel_width, best_pixel_height); + FT_Set_Pixel_Sizes(font_object->face, cell_width, cell_height); font_object->glyph_list_head = NULL;