Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9fb9cb2b
Commit
9fb9cb2b
authored
Nov 25, 2015
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus/tests: Check the correct fallback font when Arial is missing.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
023af7c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
font.c
dlls/gdiplus/tests/font.c
+12
-2
No files found.
dlls/gdiplus/tests/font.c
View file @
9fb9cb2b
...
...
@@ -726,6 +726,7 @@ static void test_font_metrics(void)
static
void
test_font_substitution
(
void
)
{
WCHAR
ms_shell_dlg
[
LF_FACESIZE
];
char
fallback_font
[
LF_FACESIZE
];
HDC
hdc
;
HFONT
hfont
;
LOGFONTA
lf
;
...
...
@@ -772,13 +773,22 @@ static void test_font_substitution(void)
status
=
GdipCreateFontFamilyFromName
(
nonexistent
,
NULL
,
&
family
);
ok
(
status
==
FontFamilyNotFound
,
"expected FontFamilyNotFound, got %d
\n
"
,
status
);
/* nonexistent fonts fallback to Arial, or something else if it's missing */
strcpy
(
lf
.
lfFaceName
,
"Arial"
);
status
=
GdipCreateFontFromLogfontA
(
hdc
,
&
lf
,
&
font
);
expect
(
Ok
,
status
);
status
=
GdipGetLogFontA
(
font
,
graphics
,
&
lf
);
expect
(
Ok
,
status
);
strcpy
(
fallback_font
,
lf
.
lfFaceName
);
trace
(
"fallback font %s
\n
"
,
fallback_font
);
lstrcpyA
(
lf
.
lfFaceName
,
"ThisFontShouldNotExist"
);
status
=
GdipCreateFontFromLogfontA
(
hdc
,
&
lf
,
&
font
);
expect
(
Ok
,
status
);
memset
(
&
lf
,
0xfe
,
sizeof
(
lf
));
status
=
GdipGetLogFontA
(
font
,
graphics
,
&
lf
);
expect
(
Ok
,
status
);
ok
(
!
lstrcmpA
(
lf
.
lfFaceName
,
"Arial"
),
"wrong face name %s
\n
"
,
lf
.
lfFaceName
);
ok
(
!
lstrcmpA
(
lf
.
lfFaceName
,
fallback_font
),
"wrong face name %s / %s
\n
"
,
lf
.
lfFaceName
,
fallback_font
);
GdipDeleteFont
(
font
);
/* empty FaceName */
...
...
@@ -788,7 +798,7 @@ static void test_font_substitution(void)
memset
(
&
lf
,
0xfe
,
sizeof
(
lf
));
status
=
GdipGetLogFontA
(
font
,
graphics
,
&
lf
);
expect
(
Ok
,
status
);
ok
(
!
lstrcmpA
(
lf
.
lfFaceName
,
"Arial"
),
"wrong face name %s
\n
"
,
lf
.
lfFaceName
);
ok
(
!
lstrcmpA
(
lf
.
lfFaceName
,
fallback_font
),
"wrong face name %s / %s
\n
"
,
lf
.
lfFaceName
,
fallback_font
);
GdipDeleteFont
(
font
);
/* zeroing out lfWeight and lfCharSet leads to font creation failure */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment