crash due to weird freetype font in gdiplus/sse

Alex Henrie alexhenrie24 at gmail.com
Thu Dec 14 10:59:13 CST 2017


2017-12-14 9:44 GMT-07:00 Marcus Meissner <meissner at suse.de>:
> On Thu, Dec 14, 2017 at 09:41:31AM -0700, Alex Henrie wrote:
>> 2017-11-10 10:10 GMT-07:00 Marcus Meissner <meissner at suse.de>:
>> > long story short, in the loader we get these values:
>> > fixme:font:get_outline_text_metrics L"Goha-Tibeb Zemen" sCapHeight=-32768
>> > fixme:font:get_outline_text_metrics L"Goha-Tibeb Zemen" sxHeight=-32768
>>
>> What version of FreeType do you have (`freetype-config --version`)? I
>> just noticed that on Arch (FreeType 21.0.15), sCapHeight and sxHeight
>> are both 0 for this font. So, either I'm testing it wrong or new
>> versions of FreeType are changing -32768 to 0.
>
> I have 2.7.1 as package version, and freetype-config reports 19.0.13.

OK, I just downgraded to version 2.7.1 of the freetype2 and
lib32-freetype2 packages, and I'm still getting 0 in those fields. I
have no idea why it's behaving differently on your machine than mine.
Here's what I'm doing to test:

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 961f9e5f03..ef3ac16c95 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -7922,6 +7922,7 @@ static BOOL get_outline_text_metrics(GdiFont *font)
     font->potm->otmAscent = SCALE_Y(pOS2->sTypoAscender);
     font->potm->otmDescent = SCALE_Y(pOS2->sTypoDescender);
     font->potm->otmLineGap = SCALE_Y(pOS2->sTypoLineGap);
+    FIXME("sCapHeight=%i\n", pOS2->sCapHeight);
     font->potm->otmsCapEmHeight = SCALE_Y(pOS2->sCapHeight);
     font->potm->otmsXHeight = SCALE_Y(pOS2->sxHeight);
     font->potm->otmrcFontBox.left = SCALE_X(ft_face->bbox.xMin);
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index bd04a8b6b1..59bea17a2c 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -1670,7 +1670,7 @@ static void test_GetKerningPairs(void)
         const KERNINGPAIR kern_pair[26];
     } kd[] =
     {
-        {"Arial", 12, 12, 9, 3,
+        {"Goha-Tibeb Zemen", 12, 12, 9, 3,
                   2048, 7, -2, 1, 5, 2, 8, -2, 0, 9,
                   26,
             {

-Alex



More information about the wine-devel mailing list