Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b6666014
Commit
b6666014
authored
Oct 17, 2013
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Oct 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32/tests: Add tests for fake bold outline fonts.
parent
ebc7dcc6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
font.c
dlls/gdi32/tests/font.c
+60
-0
No files found.
dlls/gdi32/tests/font.c
View file @
b6666014
...
...
@@ -5645,6 +5645,65 @@ static void test_GetCharWidth32(void)
DeleteObject
(
hfont
);
}
static
void
test_fake_bold_font
(
void
)
{
HDC
hdc
;
HFONT
hfont
,
hfont_old
;
LOGFONTA
lf
;
BOOL
ret
;
TEXTMETRICA
tm
[
2
];
ABC
abc
[
2
];
INT
w
[
2
];
if
(
!
pGetCharWidth32A
||
!
pGetCharABCWidthsA
)
{
win_skip
(
"GetCharWidth32A/GetCharABCWidthA is not available on this platform
\n
"
);
return
;
}
/* Test outline font */
memset
(
&
lf
,
0
,
sizeof
(
lf
));
strcpy
(
lf
.
lfFaceName
,
"Wingdings"
);
lf
.
lfWeight
=
FW_NORMAL
;
lf
.
lfCharSet
=
SYMBOL_CHARSET
;
hfont
=
CreateFontIndirectA
(
&
lf
);
hdc
=
GetDC
(
NULL
);
hfont_old
=
SelectObject
(
hdc
,
hfont
);
/* base metrics */
ret
=
GetTextMetricsA
(
hdc
,
&
tm
[
0
]);
ok
(
ret
,
"got %d
\n
"
,
ret
);
ret
=
pGetCharABCWidthsA
(
hdc
,
0x76
,
0x76
,
&
abc
[
0
]);
ok
(
ret
,
"got %d
\n
"
,
ret
);
lf
.
lfWeight
=
FW_BOLD
;
hfont
=
CreateFontIndirectA
(
&
lf
);
DeleteObject
(
SelectObject
(
hdc
,
hfont
));
/* bold metrics */
ret
=
GetTextMetricsA
(
hdc
,
&
tm
[
1
]);
ok
(
ret
,
"got %d
\n
"
,
ret
);
ret
=
pGetCharABCWidthsA
(
hdc
,
0x76
,
0x76
,
&
abc
[
1
]);
ok
(
ret
,
"got %d
\n
"
,
ret
);
DeleteObject
(
SelectObject
(
hdc
,
hfont_old
));
ReleaseDC
(
NULL
,
hdc
);
/* compare results (outline) */
ok
(
tm
[
0
].
tmHeight
==
tm
[
1
].
tmHeight
,
"expected %d, got %d
\n
"
,
tm
[
0
].
tmHeight
,
tm
[
1
].
tmHeight
);
ok
(
tm
[
0
].
tmAscent
==
tm
[
1
].
tmAscent
,
"expected %d, got %d
\n
"
,
tm
[
0
].
tmAscent
,
tm
[
1
].
tmAscent
);
ok
(
tm
[
0
].
tmDescent
==
tm
[
1
].
tmDescent
,
"expected %d, got %d
\n
"
,
tm
[
0
].
tmDescent
,
tm
[
1
].
tmDescent
);
todo_wine
ok
((
tm
[
0
].
tmAveCharWidth
+
1
)
==
tm
[
1
].
tmAveCharWidth
,
"expected %d, got %d
\n
"
,
tm
[
0
].
tmAveCharWidth
+
1
,
tm
[
1
].
tmAveCharWidth
);
todo_wine
ok
((
tm
[
0
].
tmMaxCharWidth
+
1
)
==
tm
[
1
].
tmMaxCharWidth
,
"expected %d, got %d
\n
"
,
tm
[
0
].
tmMaxCharWidth
+
1
,
tm
[
1
].
tmMaxCharWidth
);
ok
(
tm
[
0
].
tmOverhang
==
tm
[
1
].
tmOverhang
,
"expected %d, got %d
\n
"
,
tm
[
0
].
tmOverhang
,
tm
[
1
].
tmOverhang
);
w
[
0
]
=
abc
[
0
].
abcA
+
abc
[
0
].
abcB
+
abc
[
0
].
abcC
;
w
[
1
]
=
abc
[
1
].
abcA
+
abc
[
1
].
abcB
+
abc
[
1
].
abcC
;
todo_wine
ok
((
w
[
0
]
+
1
)
==
w
[
1
],
"expected %d, got %d
\n
"
,
w
[
0
]
+
1
,
w
[
1
]);
}
START_TEST
(
font
)
{
init
();
...
...
@@ -5704,6 +5763,7 @@ START_TEST(font)
test_max_height
();
test_vertical_order
();
test_GetCharWidth32
();
test_fake_bold_font
();
/* These tests should be last test until RemoveFontResource
* is properly implemented.
...
...
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