Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Bugfix/font style issue #629

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/font.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/testfont.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down