From 9cbdc836058e71083c2f956d632bf765e4dbc01d Mon Sep 17 00:00:00 2001 From: Chris Speciale Date: Mon, 28 Oct 2024 23:02:28 -0400 Subject: [PATCH] SetSize should use 96 dpi for now I think it should probably use 96 dpi instead of 72.... In the next minor version of Lime I think we should change the function sig to allow a dpi argument. --- project/src/text/Font.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/project/src/text/Font.cpp b/project/src/text/Font.cpp index 8992132567..021b112c13 100644 --- a/project/src/text/Font.cpp +++ b/project/src/text/Font.cpp @@ -1040,14 +1040,22 @@ namespace lime { } - void Font::SetSize (size_t size) { - - size_t hdpi = 72; - size_t vdpi = 72; - - FT_Set_Char_Size ((FT_Face)face, (int)(size*64), (int)(size*64), hdpi, vdpi); + void Font::SetSize(size_t size) + { + //We changed this from 72? I think in the next version of lime we should probably + //change the function signature from both the native and haxe side to expect an optional + //dpi argument + size_t hdpi = 96; + size_t vdpi = 96; + + FT_Set_Char_Size( + (FT_Face)face, //Handle to the target face object + 0, //Char width in 1/64th of points (0 means same as height) + static_cast(size * 64), //Char height in 1/64th of points + hdpi, //Horizontal DPI + vdpi //Vertical DPI + ); mSize = size; - }