diff --git a/lib/font_renderer/font_renderer.cpp b/lib/font_renderer/font_renderer.cpp index d060839f..c30c8f57 100644 --- a/lib/font_renderer/font_renderer.cpp +++ b/lib/font_renderer/font_renderer.cpp @@ -244,7 +244,8 @@ FR_Bitmap *FR_Bake_Font_Bitmap(FR_Renderer *font_renderer, int font_height, i = i + 1; } - const int pixels_width = glyph_count > 0 ? (x_size_sum / glyph_count) * 16 : 12; + const int glyph_avg_width = glyph_count > 0 ? x_size_sum / (glyph_count * subpixel_scale) : font_height; + const int pixels_width = glyph_avg_width * 20; // dry run simulating pixel position to estimate required image's height int x = x_start, y = 0, y_bottom = y;