diff --git a/src/font.c b/src/font.c index 6f586acdd..18f4fff0e 100644 --- a/src/font.c +++ b/src/font.c @@ -890,7 +890,8 @@ gdip_get_cairo_font_face (GpFont *font) { if (!font->cairofnt) { FcPattern *pattern = FcPatternBuild ( - FcPatternDuplicate (font->family->pattern), + NULL, + FC_FAMILY, FcTypeString, font->face, FC_SLANT, FcTypeInteger, ((font->style & FontStyleItalic) ? FC_SLANT_ITALIC : FC_SLANT_ROMAN), FC_WEIGHT, FcTypeInteger, ((font->style & FontStyleBold) ? FC_WEIGHT_BOLD : FC_WEIGHT_MEDIUM), NULL); diff --git a/tests/testfont.c b/tests/testfont.c index 43229e3e4..b3578e9de 100644 --- a/tests/testfont.c +++ b/tests/testfont.c @@ -911,7 +911,7 @@ static void test_createFontFamilyFromName () status = GdipCreateFontFamilyFromName (CodeNewRoman, collection, &family); assertEqualInt (status, Ok); - verifyFontFamily (family, "Code New Roman", 1884, 514, 2398, "Code New Roman", 1884, 514, 2398); + verifyFontFamily (family, "Code New Roman", 2059, 430, 2489, "Code New Roman", 1901, 483, 2384); // Negative tests. status = GdipCreateFontFamilyFromName (NULL, collection, &family);