Skip to content

Commit

Permalink
improve text rendering consistency when using fractional DPI scales.
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Jul 9, 2024
1 parent 7a43805 commit af35953
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/modules/font/freetype/TrueTypeRasterizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ TrueTypeRasterizer::TrueTypeRasterizer(FT_Library library, love::Data *data, int
, hinting(settings.hinting)
{
dpiScale = settings.dpiScale.get(defaultdpiscale);
size = floorf(size * dpiScale + 0.5f);

sdf = settings.sdf;

Expand All @@ -55,7 +54,7 @@ TrueTypeRasterizer::TrueTypeRasterizer(FT_Library library, love::Data *data, int
if (err != FT_Err_Ok)
throw love::Exception("TrueType Font loading error: FT_New_Face failed: 0x%x (problem with font file?)", err);

err = FT_Set_Pixel_Sizes(face, size, size);
err = FT_Set_Char_Size(face, size << 6, size << 6, 72 * dpiScale, 72 * dpiScale);

if (err != FT_Err_Ok)
throw love::Exception("TrueType Font loading error: FT_Set_Pixel_Sizes failed: 0x%x (invalid size?)", err);
Expand Down

0 comments on commit af35953

Please sign in to comment.