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
691be74f
Commit
691be74f
authored
Sep 27, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Take into account font substitution in GdipCreateFontFromLogfont.
parent
65a966de
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
font.c
dlls/gdiplus/font.c
+3
-1
font.c
dlls/gdiplus/tests/font.c
+2
-4
No files found.
dlls/gdiplus/font.c
View file @
691be74f
...
...
@@ -205,6 +205,7 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc,
{
HFONT
hfont
,
oldfont
;
OUTLINETEXTMETRICW
otm
;
WCHAR
facename
[
LF_FACESIZE
];
GpStatus
stat
;
int
ret
;
...
...
@@ -217,6 +218,7 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc,
oldfont
=
SelectObject
(
hdc
,
hfont
);
otm
.
otmSize
=
sizeof
(
otm
);
ret
=
GetOutlineTextMetricsW
(
hdc
,
otm
.
otmSize
,
&
otm
);
GetTextFaceW
(
hdc
,
LF_FACESIZE
,
facename
);
SelectObject
(
hdc
,
oldfont
);
DeleteObject
(
hfont
);
...
...
@@ -229,7 +231,7 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc,
(
*
font
)
->
emSize
=
otm
.
otmTextMetrics
.
tmAscent
;
(
*
font
)
->
otm
=
otm
;
stat
=
GdipCreateFontFamilyFromName
(
logfont
->
lfFaceN
ame
,
NULL
,
&
(
*
font
)
->
family
);
stat
=
GdipCreateFontFamilyFromName
(
facen
ame
,
NULL
,
&
(
*
font
)
->
family
);
if
(
stat
!=
Ok
)
{
GdipFree
(
*
font
);
...
...
dlls/gdiplus/tests/font.c
View file @
691be74f
...
...
@@ -767,24 +767,20 @@ static void test_font_substitution(void)
lstrcpy
(
lf
.
lfFaceName
,
"ThisFontShouldNotExist"
);
status
=
GdipCreateFontFromLogfontA
(
hdc
,
&
lf
,
&
font
);
todo_wine
expect
(
Ok
,
status
);
memset
(
&
lf
,
0xfe
,
sizeof
(
lf
));
status
=
GdipGetLogFontA
(
font
,
graphics
,
&
lf
);
expect
(
Ok
,
status
);
todo_wine
ok
(
!
lstrcmp
(
lf
.
lfFaceName
,
"Arial"
),
"wrong face name %s
\n
"
,
lf
.
lfFaceName
);
GdipDeleteFont
(
font
);
/* empty FaceName */
lf
.
lfFaceName
[
0
]
=
0
;
status
=
GdipCreateFontFromLogfontA
(
hdc
,
&
lf
,
&
font
);
todo_wine
expect
(
Ok
,
status
);
memset
(
&
lf
,
0xfe
,
sizeof
(
lf
));
status
=
GdipGetLogFontA
(
font
,
graphics
,
&
lf
);
expect
(
Ok
,
status
);
todo_wine
ok
(
!
lstrcmp
(
lf
.
lfFaceName
,
"Arial"
),
"wrong face name %s
\n
"
,
lf
.
lfFaceName
);
GdipDeleteFont
(
font
);
...
...
@@ -793,12 +789,14 @@ todo_wine
lf
.
lfCharSet
=
0
;
lstrcpy
(
lf
.
lfFaceName
,
"ThisFontShouldNotExist"
);
status
=
GdipCreateFontFromLogfontA
(
hdc
,
&
lf
,
&
font
);
todo_wine
ok
(
status
==
NotTrueTypeFont
||
broken
(
status
==
FileNotFound
),
/* before XP */
"expected NotTrueTypeFont, got %d
\n
"
,
status
);
/* empty FaceName */
lf
.
lfFaceName
[
0
]
=
0
;
status
=
GdipCreateFontFromLogfontA
(
hdc
,
&
lf
,
&
font
);
todo_wine
ok
(
status
==
NotTrueTypeFont
||
broken
(
status
==
FileNotFound
),
/* before XP */
"expected NotTrueTypeFont, got %d
\n
"
,
status
);
...
...
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