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
3068ac9e
Commit
3068ac9e
authored
Jan 08, 2008
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 08, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add more tests for bitmap font metrics scaling.
parent
a88f03e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
font.c
dlls/gdi32/tests/font.c
+13
-6
No files found.
dlls/gdi32/tests/font.c
View file @
3068ac9e
...
...
@@ -158,17 +158,20 @@ static INT CALLBACK font_enum_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DW
static
void
test_font_metrics
(
HDC
hdc
,
HFONT
hfont
,
const
char
*
test_str
,
INT
test_str_len
,
const
TEXTMETRICA
*
tm_orig
,
const
SIZE
*
size_orig
,
INT
width_orig
,
const
SIZE
*
size_orig
,
INT
width_o
f_A_o
rig
,
INT
scale_x
,
INT
scale_y
)
{
HFONT
old_hfont
;
LOGFONTA
lf
;
TEXTMETRICA
tm
;
SIZE
size
;
INT
width
;
INT
width
_of_A
;
if
(
!
hfont
)
return
;
GetObjectA
(
hfont
,
sizeof
(
lf
),
&
lf
);
old_hfont
=
SelectObject
(
hdc
,
hfont
);
GetTextMetricsA
(
hdc
,
&
tm
);
...
...
@@ -177,20 +180,25 @@ static void test_font_metrics(HDC hdc, HFONT hfont, const char *test_str,
ok
(
tm
.
tmAscent
==
tm_orig
->
tmAscent
*
scale_y
,
"%d != %d
\n
"
,
tm
.
tmAscent
,
tm_orig
->
tmAscent
*
scale_y
);
ok
(
tm
.
tmDescent
==
tm_orig
->
tmDescent
*
scale_y
,
"%d != %d
\n
"
,
tm
.
tmDescent
,
tm_orig
->
tmDescent
*
scale_y
);
ok
(
tm
.
tmAveCharWidth
==
tm_orig
->
tmAveCharWidth
*
scale_x
,
"%d != %d
\n
"
,
tm
.
tmAveCharWidth
,
tm_orig
->
tmAveCharWidth
*
scale_x
);
ok
(
tm
.
tmMaxCharWidth
==
tm_orig
->
tmMaxCharWidth
*
scale_x
,
"%d != %d
\n
"
,
tm
.
tmAveCharWidth
,
tm_orig
->
tmMaxCharWidth
*
scale_x
);
ok
(
lf
.
lfHeight
==
tm
.
tmHeight
,
"lf %d != tm %d
\n
"
,
lf
.
lfHeight
,
tm
.
tmHeight
);
if
(
lf
.
lfWidth
)
ok
(
lf
.
lfWidth
==
tm
.
tmAveCharWidth
,
"lf %d != tm %d
\n
"
,
lf
.
lfWidth
,
tm
.
tmAveCharWidth
);
GetTextExtentPoint32A
(
hdc
,
test_str
,
test_str_len
,
&
size
);
ok
(
size
.
cx
==
size_orig
->
cx
*
scale_x
,
"%d != %d
\n
"
,
size
.
cx
,
size_orig
->
cx
*
scale_x
);
ok
(
size
.
cy
==
size_orig
->
cy
*
scale_y
,
"%d != %d
\n
"
,
size
.
cy
,
size_orig
->
cy
*
scale_y
);
GetCharWidthA
(
hdc
,
'A'
,
'A'
,
&
width
);
GetCharWidthA
(
hdc
,
'A'
,
'A'
,
&
width
_of_A
);
ok
(
width
==
width_orig
*
scale_x
,
"%d != %d
\n
"
,
width
,
width
_orig
*
scale_x
);
ok
(
width
_of_A
==
width_of_A_orig
*
scale_x
,
"%d != %d
\n
"
,
width_of_A
,
width_of_A
_orig
*
scale_x
);
SelectObject
(
hdc
,
old_hfont
);
}
/*
see whether
GDI scales bitmap font metrics */
/*
Test how
GDI scales bitmap font metrics */
static
void
test_bitmap_font
(
void
)
{
static
const
char
test_str
[
11
]
=
"Test String"
;
...
...
@@ -246,7 +254,6 @@ todo_wine
bitmap_lf
.
lfHeight
=
height_orig
*
3
;
bitmap_lf
.
lfWidth
=
0
;
hfont
=
create_font
(
"3x3"
,
&
bitmap_lf
);
todo_wine
{
test_font_metrics
(
hdc
,
hfont
,
test_str
,
sizeof
(
test_str
),
&
tm_orig
,
&
size_orig
,
width_orig
,
3
,
3
);
...
...
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