Hello, i am really grateful for the work you are putting into SDL3_ttf, i was trying SDL3_ttf, i downloaded freetype from the linked tag, and compiled with it with SDL3_ttf (so no harfbaz), and i noticed TTF_MeasureString was returning 1 more character than could fit, an example below
I am using latest version, so commit 2554dd7 (3 days ago), also using the same version of freetype that is linked to this repository
what is printed is width = 0 and length = 1 , for 1 pixel i expected 0 characters to be possible, i tried different fonts and got the same result.
i am using windows with MSVC verion 19.39.33523 (though i think the issue doesn't seem compiler specific)
i tried tracking down what may have caused this and this commit 40e606f seems to remove a comment with // The last character didn't fit along with the line that subtracts 1 from the result in that function, so ... maybe that's causing this issue ? i can't tell for sure.
using SDL3_TTF with harfbaz correctly produces width = 0 and length = 0 , so the issue is specific to using freetype implementation, i will use harfbaz for now so this is not a blocking issue for me.
using Roboto-Regular.ttf font also gives the same result if you want a lightweight font to test with.
Hello, i am really grateful for the work you are putting into SDL3_ttf, i was trying SDL3_ttf, i downloaded freetype from the linked tag, and compiled with it with SDL3_ttf (so no harfbaz), and i noticed
TTF_MeasureString
was returning 1 more character than could fit, an example belowI am using latest version, so commit 2554dd7 (3 days ago), also using the same version of freetype that is linked to this repository
what is printed is
width = 0
andlength = 1
, for 1 pixel i expected 0 characters to be possible, i tried different fonts and got the same result.i am using windows with MSVC verion 19.39.33523 (though i think the issue doesn't seem compiler specific)
i tried tracking down what may have caused this and this commit 40e606f seems to remove a comment with
// The last character didn't fit
along with the line that subtracts 1 from the result in that function, so ... maybe that's causing this issue ? i can't tell for sure.using SDL3_TTF with harfbaz correctly produces
width = 0
andlength = 0
, so the issue is specific to using freetype implementation, i will use harfbaz for now so this is not a blocking issue for me.using
Roboto-Regular.ttf
font also gives the same result if you want a lightweight font to test with.