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
c8d57306
Commit
c8d57306
authored
Oct 06, 2008
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 06, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a test for a font being selected into 2 DCs with different transformations.
parent
0467d4e4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
font.c
dlls/gdi32/tests/font.c
+24
-2
No files found.
dlls/gdi32/tests/font.c
View file @
c8d57306
...
...
@@ -362,9 +362,9 @@ static void test_bitmap_font(void)
static
void
test_outline_font
(
void
)
{
static
const
char
test_str
[
11
]
=
"Test String"
;
HDC
hdc
;
HDC
hdc
,
hdc_2
;
LOGFONTA
lf
;
HFONT
hfont
,
old_hfont
;
HFONT
hfont
,
old_hfont
,
old_hfont_2
;
OUTLINETEXTMETRICA
otm
;
SIZE
size_orig
;
INT
width_orig
,
height_orig
,
lfWidth
;
...
...
@@ -463,7 +463,19 @@ static void test_outline_font(void)
ok
(
gm
.
gmCellIncX
==
width_orig
/
2
,
"incX %d != %d
\n
"
,
gm
.
gmCellIncX
,
width_orig
/
2
);
ok
(
gm
.
gmCellIncY
==
0
,
"incY %d != 0
\n
"
,
gm
.
gmCellIncY
);
/* Test that changing the DC transformation affects only the font
* selected on this DC and doesn't affect the same font selected on
* another DC.
*/
hdc_2
=
CreateCompatibleDC
(
0
);
old_hfont_2
=
SelectObject
(
hdc_2
,
hfont
);
test_font_metrics
(
hdc_2
,
hfont
,
lf
.
lfHeight
,
lf
.
lfWidth
,
test_str
,
sizeof
(
test_str
),
&
otm
.
otmTextMetrics
,
&
size_orig
,
width_orig
,
1
,
1
);
SetMapMode
(
hdc
,
MM_ANISOTROPIC
);
/* font metrics on another DC should be unchanged */
test_font_metrics
(
hdc_2
,
hfont
,
lf
.
lfHeight
,
lf
.
lfWidth
,
test_str
,
sizeof
(
test_str
),
&
otm
.
otmTextMetrics
,
&
size_orig
,
width_orig
,
1
,
1
);
/* test restrictions of compatibility mode GM_COMPATIBLE */
/* part 1: rescaling only X should not change font scaling on screen.
So compressing the X axis by 2 is not done, and this
...
...
@@ -471,6 +483,8 @@ static void test_outline_font(void)
SetWindowExtEx
(
hdc
,
100
,
100
,
NULL
);
SetViewportExtEx
(
hdc
,
50
,
100
,
NULL
);
test_font_metrics
(
hdc
,
hfont
,
lf
.
lfHeight
,
lf
.
lfWidth
,
test_str
,
sizeof
(
test_str
),
&
otm
.
otmTextMetrics
,
&
size_orig
,
width_orig
,
2
,
1
);
/* font metrics on another DC should be unchanged */
test_font_metrics
(
hdc_2
,
hfont
,
lf
.
lfHeight
,
lf
.
lfWidth
,
test_str
,
sizeof
(
test_str
),
&
otm
.
otmTextMetrics
,
&
size_orig
,
width_orig
,
1
,
1
);
/* part 2: rescaling only Y should change font scaling.
As also X is scaled by a factor of 2, but this is not
...
...
@@ -478,10 +492,18 @@ static void test_outline_font(void)
of 2 in the X coordinate. */
SetViewportExtEx
(
hdc
,
100
,
200
,
NULL
);
test_font_metrics
(
hdc
,
hfont
,
lf
.
lfHeight
,
lf
.
lfWidth
,
test_str
,
sizeof
(
test_str
),
&
otm
.
otmTextMetrics
,
&
size_orig
,
width_orig
,
2
,
1
);
/* font metrics on another DC should be unchanged */
test_font_metrics
(
hdc_2
,
hfont
,
lf
.
lfHeight
,
lf
.
lfWidth
,
test_str
,
sizeof
(
test_str
),
&
otm
.
otmTextMetrics
,
&
size_orig
,
width_orig
,
1
,
1
);
/* restore scaling */
SetMapMode
(
hdc
,
MM_TEXT
);
/* font metrics on another DC should be unchanged */
test_font_metrics
(
hdc_2
,
hfont
,
lf
.
lfHeight
,
lf
.
lfWidth
,
test_str
,
sizeof
(
test_str
),
&
otm
.
otmTextMetrics
,
&
size_orig
,
width_orig
,
1
,
1
);
SelectObject
(
hdc_2
,
old_hfont_2
);
DeleteDC
(
hdc_2
);
if
(
!
SetGraphicsMode
(
hdc
,
GM_ADVANCED
))
{
SelectObject
(
hdc
,
old_hfont
);
...
...
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