From c1fddfe3bc5375094fb24b69aaed6c0b1cc8c4fa Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Sat, 6 Jul 2024 15:31:11 -0300 Subject: [PATCH] Fix initial texture atlas size of fonts with high dpi scales --- src/modules/graphics/Font.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/graphics/Font.cpp b/src/modules/graphics/Font.cpp index c5303b6ad..3cda9acbe 100644 --- a/src/modules/graphics/Font.cpp +++ b/src/modules/graphics/Font.cpp @@ -71,7 +71,8 @@ Font::Font(love::font::Rasterizer *r, const SamplerState &s) // largest texture size if no rough match is found. while (true) { - if ((shaper->getHeight() * 0.8) * shaper->getHeight() * 30 <= textureWidth * textureHeight) + float dpiscale = r->getDPIScale(); + if ((shaper->getHeight() * 0.8 * dpiscale) * shaper->getHeight() * 30 * dpiscale <= textureWidth * textureHeight) break; TextureSize nextsize = getNextTextureSize();