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
cca41207
Commit
cca41207
authored
Jun 04, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jun 04, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Fix parameters of some GDI stock fonts.
parent
1565def7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
0 deletions
+81
-0
gdiobj.c
dlls/gdi32/gdiobj.c
+0
-0
font.c
dlls/gdi32/tests/font.c
+81
-0
No files found.
dlls/gdi32/gdiobj.c
View file @
cca41207
This diff is collapsed.
Click to expand it.
dlls/gdi32/tests/font.c
View file @
cca41207
...
...
@@ -4350,10 +4350,91 @@ static void test_east_asian_font_selection(void)
ReleaseDC
(
NULL
,
hdc
);
}
static
int
get_font_dpi
(
const
LOGFONT
*
lf
)
{
HDC
hdc
=
CreateCompatibleDC
(
0
);
HFONT
hfont
;
TEXTMETRIC
tm
;
int
ret
;
hfont
=
CreateFontIndirect
(
lf
);
ok
(
hfont
!=
0
,
"CreateFontIndirect failed
\n
"
);
SelectObject
(
hdc
,
hfont
);
ret
=
GetTextMetrics
(
hdc
,
&
tm
);
ok
(
ret
,
"GetTextMetrics failed
\n
"
);
ret
=
tm
.
tmDigitizedAspectX
;
DeleteDC
(
hdc
);
DeleteObject
(
hfont
);
return
ret
;
}
static
void
test_stock_fonts
(
void
)
{
static
const
struct
test_data
{
int
id
,
weight
,
height
,
dpi
;
const
char
face_name
[
LF_FACESIZE
];
}
td
[]
=
{
{
ANSI_FIXED_FONT
,
FW_NORMAL
,
12
,
96
,
"Courier"
},
{
ANSI_FIXED_FONT
,
FW_NORMAL
,
12
,
120
,
"Courier"
},
{
ANSI_VAR_FONT
,
FW_NORMAL
,
12
,
96
,
"MS Sans Serif"
},
{
ANSI_VAR_FONT
,
FW_NORMAL
,
12
,
120
,
"MS Sans Serif"
},
{
SYSTEM_FONT
,
FW_BOLD
,
16
,
96
,
"System"
},
{
SYSTEM_FONT
,
FW_BOLD
,
20
,
120
,
"System"
},
{
DEVICE_DEFAULT_FONT
,
FW_BOLD
,
16
,
96
,
"System"
},
{
DEVICE_DEFAULT_FONT
,
FW_BOLD
,
20
,
120
,
"System"
},
{
DEFAULT_GUI_FONT
,
FW_NORMAL
,
-
11
,
96
,
"MS Shell Dlg"
},
{
DEFAULT_GUI_FONT
,
FW_NORMAL
,
-
13
,
120
,
"MS Shell Dlg"
}
/*{ SYSTEM_FIXED_FONT, FW_NORMAL, 15, 96, "Fixedsys" },*/
/*{ SYSTEM_FIXED_FONT, FW_NORMAL, 20, 120, "Fixedsys" },*/
/*{ OEM_FIXED_FONT, FW_NORMAL, 16, 96, "Terminal" },*/
/*{ OEM_FIXED_FONT, FW_NORMAL, 20, 120, "Terminal" },*/
};
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
td
)
/
sizeof
(
td
[
0
]);
i
++
)
{
HFONT
hfont
;
LOGFONT
lf
;
int
ret
;
hfont
=
GetStockObject
(
td
[
i
].
id
);
ok
(
hfont
!=
0
,
"%d: GetStockObject(%d) failed
\n
"
,
i
,
td
[
i
].
id
);
ret
=
GetObject
(
hfont
,
sizeof
(
lf
),
&
lf
);
if
(
ret
!=
sizeof
(
lf
))
{
/* NT4 */
win_skip
(
"%d: GetObject returned %d instead of sizeof(LOGFONT)
\n
"
,
i
,
ret
);
continue
;
}
ret
=
get_font_dpi
(
&
lf
);
if
(
ret
!=
td
[
i
].
dpi
)
{
trace
(
"%d: font %s %d dpi doesn't match test data %d
\n
"
,
i
,
lf
.
lfFaceName
,
ret
,
td
[
i
].
dpi
);
continue
;
}
ok
(
td
[
i
].
weight
==
lf
.
lfWeight
,
"%d: expected lfWeight %d, got %d
\n
"
,
i
,
td
[
i
].
weight
,
lf
.
lfWeight
);
if
(
td
[
i
].
height
<
0
)
/* FIXME: remove once Wine is fixed */
todo_wine
ok
(
td
[
i
].
height
==
lf
.
lfHeight
,
"%d: expected lfHeight %d, got %d
\n
"
,
i
,
td
[
i
].
height
,
lf
.
lfHeight
);
else
ok
(
td
[
i
].
height
==
lf
.
lfHeight
,
"%d: expected lfHeight %d, got %d
\n
"
,
i
,
td
[
i
].
height
,
lf
.
lfHeight
);
ok
(
!
lstrcmp
(
td
[
i
].
face_name
,
lf
.
lfFaceName
),
"%d: expected lfFaceName %s, got %s
\n
"
,
i
,
td
[
i
].
face_name
,
lf
.
lfFaceName
);
}
}
START_TEST
(
font
)
{
init
();
test_stock_fonts
();
test_logfont
();
test_bitmap_font
();
test_outline_font
();
...
...
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