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
4b9e1db0
Commit
4b9e1db0
authored
Apr 20, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 23, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Use Tahoma instead of Arial for gdiplus font tests.
parent
44ec1a2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
60 deletions
+36
-60
font.c
dlls/gdiplus/tests/font.c
+36
-60
No files found.
dlls/gdiplus/tests/font.c
View file @
4b9e1db0
...
...
@@ -24,10 +24,9 @@
#include "gdiplus.h"
#include "wine/test.h"
#define expect(expected, got) ok(got == expected, "Expected %
.8x, got %.8x
\n", expected, got)
#define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %
.2f, got %.2
f\n", expected, got)
#define expect(expected, got) ok(got == expected, "Expected %
d, got %d
\n", expected, got)
#define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %
f, got %
f\n", expected, got)
static
const
WCHAR
arial
[]
=
{
'A'
,
'r'
,
'i'
,
'a'
,
'l'
,
'\0'
};
static
const
WCHAR
nonexistent
[]
=
{
'T'
,
'h'
,
'i'
,
's'
,
'F'
,
'o'
,
'n'
,
't'
,
's'
,
'h'
,
'o'
,
'u'
,
'l'
,
'd'
,
'N'
,
'o'
,
't'
,
'E'
,
'x'
,
'i'
,
's'
,
't'
,
'\0'
};
static
const
WCHAR
MSSansSerif
[]
=
{
'M'
,
'S'
,
' '
,
'S'
,
'a'
,
'n'
,
's'
,
' '
,
'S'
,
'e'
,
'r'
,
'i'
,
'f'
,
'\0'
};
static
const
WCHAR
MicrosoftSansSerif
[]
=
{
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
' '
,
'S'
,
'a'
,
'n'
,
's'
,
' '
,
'S'
,
'e'
,
'r'
,
'i'
,
'f'
,
'\0'
};
...
...
@@ -50,12 +49,7 @@ static void test_createfont(void)
expect
(
FontFamilyNotFound
,
stat
);
stat
=
GdipDeleteFont
(
font
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipCreateFontFamilyFromName
(
arial
,
NULL
,
&
fontfamily
);
if
(
stat
==
FontFamilyNotFound
)
{
skip
(
"Arial not installed
\n
"
);
return
;
}
stat
=
GdipCreateFontFamilyFromName
(
Tahoma
,
NULL
,
&
fontfamily
);
expect
(
Ok
,
stat
);
stat
=
GdipCreateFont
(
fontfamily
,
12
,
FontStyleRegular
,
UnitPoint
,
&
font
);
expect
(
Ok
,
stat
);
...
...
@@ -67,7 +61,7 @@ static void test_createfont(void)
expect
(
Ok
,
stat
);
stat
=
GdipGetFamilyName
(
fontfamily2
,
familyname
,
0
);
expect
(
Ok
,
stat
);
ok
(
lstrcmpiW
(
arial
,
familyname
)
==
0
,
"Expected arial
, got %s
\n
"
,
ok
(
lstrcmpiW
(
Tahoma
,
familyname
)
==
0
,
"Expected Tahoma
, got %s
\n
"
,
wine_dbgstr_w
(
familyname
));
stat
=
GdipDeleteFontFamily
(
fontfamily2
);
expect
(
Ok
,
stat
);
...
...
@@ -110,14 +104,9 @@ static void test_logfont(void)
stat
=
GdipCreateFontFromLogfontA
(
hdc
,
&
lfa
,
&
font
);
expect
(
NotTrueTypeFont
,
stat
);
lstrcpyA
(
lfa
.
lfFaceName
,
"
Arial
"
);
lstrcpyA
(
lfa
.
lfFaceName
,
"
Tahoma
"
);
stat
=
GdipCreateFontFromLogfontA
(
hdc
,
&
lfa
,
&
font
);
if
(
stat
==
FileNotFound
)
{
skip
(
"Arial not installed.
\n
"
);
return
;
}
expect
(
Ok
,
stat
);
stat
=
GdipGetLogFontA
(
font
,
graphics
,
&
lfa2
);
expect
(
Ok
,
stat
);
...
...
@@ -146,7 +135,7 @@ static void test_logfont(void)
lfa
.
lfItalic
=
lfa
.
lfUnderline
=
lfa
.
lfStrikeOut
=
TRUE
;
memset
(
&
lfa2
,
0xff
,
sizeof
(
LOGFONTA
));
lstrcpyA
(
lfa
.
lfFaceName
,
"
Arial
"
);
lstrcpyA
(
lfa
.
lfFaceName
,
"
Tahoma
"
);
stat
=
GdipCreateFontFromLogfontA
(
hdc
,
&
lfa
,
&
font
);
expect
(
Ok
,
stat
);
...
...
@@ -186,7 +175,7 @@ static void test_fontfamily (void)
GpStatus
stat
;
/* FontFamily cannot be NULL */
stat
=
GdipCreateFontFamilyFromName
(
arial
,
NULL
,
NULL
);
stat
=
GdipCreateFontFamilyFromName
(
Tahoma
,
NULL
,
NULL
);
expect
(
InvalidParameter
,
stat
);
/* FontFamily must be able to actually find the family.
...
...
@@ -200,17 +189,12 @@ static void test_fontfamily (void)
expect
(
FontFamilyNotFound
,
stat
);
if
(
stat
==
Ok
)
GdipDeleteFontFamily
(
family
);
stat
=
GdipCreateFontFamilyFromName
(
arial
,
NULL
,
&
family
);
if
(
stat
==
FontFamilyNotFound
)
{
skip
(
"Arial not installed
\n
"
);
return
;
}
stat
=
GdipCreateFontFamilyFromName
(
Tahoma
,
NULL
,
&
family
);
expect
(
Ok
,
stat
);
stat
=
GdipGetFamilyName
(
family
,
itsName
,
LANG_NEUTRAL
);
expect
(
Ok
,
stat
);
expect
(
0
,
lstrcmpiW
(
itsName
,
arial
));
expect
(
0
,
lstrcmpiW
(
itsName
,
Tahoma
));
if
(
0
)
{
...
...
@@ -226,7 +210,7 @@ static void test_fontfamily (void)
GdipDeleteFontFamily
(
family
);
stat
=
GdipGetFamilyName
(
clonedFontFamily
,
itsName
,
LANG_NEUTRAL
);
expect
(
Ok
,
stat
);
expect
(
0
,
lstrcmpiW
(
itsName
,
arial
));
expect
(
0
,
lstrcmpiW
(
itsName
,
Tahoma
));
GdipDeleteFontFamily
(
clonedFontFamily
);
}
...
...
@@ -237,28 +221,25 @@ static void test_fontfamily_properties (void)
GpStatus
stat
;
UINT16
result
=
0
;
stat
=
GdipCreateFontFamilyFromName
(
arial
,
NULL
,
&
FontFamily
);
if
(
stat
==
FontFamilyNotFound
)
skip
(
"Arial not installed
\n
"
);
else
{
stat
=
GdipGetLineSpacing
(
FontFamily
,
FontStyleRegular
,
&
result
);
expect
(
Ok
,
stat
);
ok
(
result
==
2355
,
"Expected 2355, got %d
\n
"
,
result
);
result
=
0
;
stat
=
GdipGetEmHeight
(
FontFamily
,
FontStyleRegular
,
&
result
);
expect
(
Ok
,
stat
);
ok
(
result
==
2048
,
"Expected 2048, got %d
\n
"
,
result
);
result
=
0
;
stat
=
GdipGetCellAscent
(
FontFamily
,
FontStyleRegular
,
&
result
);
expect
(
Ok
,
stat
);
ok
(
result
==
1854
,
"Expected 1854, got %d
\n
"
,
result
);
result
=
0
;
stat
=
GdipGetCellDescent
(
FontFamily
,
FontStyleRegular
,
&
result
);
expect
(
Ok
,
stat
);
ok
(
result
==
434
,
"Expected 434, got %d
\n
"
,
result
);
GdipDeleteFontFamily
(
FontFamily
);
}
stat
=
GdipCreateFontFamilyFromName
(
Tahoma
,
NULL
,
&
FontFamily
);
expect
(
Ok
,
stat
);
stat
=
GdipGetLineSpacing
(
FontFamily
,
FontStyleRegular
,
&
result
);
expect
(
Ok
,
stat
);
ok
(
result
==
2472
,
"Expected 2472, got %d
\n
"
,
result
);
result
=
0
;
stat
=
GdipGetEmHeight
(
FontFamily
,
FontStyleRegular
,
&
result
);
expect
(
Ok
,
stat
);
ok
(
result
==
2048
,
"Expected 2048, got %d
\n
"
,
result
);
result
=
0
;
stat
=
GdipGetCellAscent
(
FontFamily
,
FontStyleRegular
,
&
result
);
expect
(
Ok
,
stat
);
ok
(
result
==
2049
,
"Expected 2049, got %d
\n
"
,
result
);
result
=
0
;
stat
=
GdipGetCellDescent
(
FontFamily
,
FontStyleRegular
,
&
result
);
expect
(
Ok
,
stat
);
ok
(
result
==
423
,
"Expected 423, got %d
\n
"
,
result
);
GdipDeleteFontFamily
(
FontFamily
);
stat
=
GdipCreateFontFamilyFromName
(
TimesNewRoman
,
NULL
,
&
FontFamily
);
if
(
stat
==
FontFamilyNotFound
)
...
...
@@ -363,12 +344,7 @@ static void test_heightgivendpi(void)
GpFontFamily
*
fontfamily
=
NULL
;
REAL
height
;
stat
=
GdipCreateFontFamilyFromName
(
arial
,
NULL
,
&
fontfamily
);
if
(
stat
==
FontFamilyNotFound
)
{
skip
(
"Arial not installed
\n
"
);
return
;
}
stat
=
GdipCreateFontFamilyFromName
(
Tahoma
,
NULL
,
&
fontfamily
);
expect
(
Ok
,
stat
);
stat
=
GdipCreateFont
(
fontfamily
,
30
,
FontStyleRegular
,
UnitPixel
,
&
font
);
...
...
@@ -382,7 +358,7 @@ static void test_heightgivendpi(void)
stat
=
GdipGetFontHeightGivenDPI
(
font
,
96
,
&
height
);
expect
(
Ok
,
stat
);
expectf
(
(
REAL
)
34
.
497070
,
height
);
expectf
(
36
.
210938
,
height
);
GdipDeleteFont
(
font
);
height
=
12345
;
...
...
@@ -390,7 +366,7 @@ static void test_heightgivendpi(void)
expect
(
Ok
,
stat
);
stat
=
GdipGetFontHeightGivenDPI
(
font
,
96
,
&
height
);
expect
(
Ok
,
stat
);
expectf
(
(
REAL
)
34
.
497070
,
height
);
expectf
(
36
.
210938
,
height
);
GdipDeleteFont
(
font
);
height
=
12345
;
...
...
@@ -398,7 +374,7 @@ static void test_heightgivendpi(void)
expect
(
Ok
,
stat
);
stat
=
GdipGetFontHeightGivenDPI
(
font
,
96
,
&
height
);
expect
(
Ok
,
stat
);
expectf
(
(
REAL
)
45
.
996094
,
height
);
expectf
(
48
.
281250
,
height
);
GdipDeleteFont
(
font
);
height
=
12345
;
...
...
@@ -406,7 +382,7 @@ static void test_heightgivendpi(void)
expect
(
Ok
,
stat
);
stat
=
GdipGetFontHeightGivenDPI
(
font
,
96
,
&
height
);
expect
(
Ok
,
stat
);
expectf
(
(
REAL
)
3311
.
71875
0
,
height
);
expectf
(
3476
.
25000
0
,
height
);
GdipDeleteFont
(
font
);
height
=
12345
;
...
...
@@ -414,7 +390,7 @@ static void test_heightgivendpi(void)
expect
(
Ok
,
stat
);
stat
=
GdipGetFontHeightGivenDPI
(
font
,
96
,
&
height
);
expect
(
Ok
,
stat
);
expectf
(
(
REAL
)
11
.
03
9062
,
height
);
expectf
(
11
.
587500
,
height
);
GdipDeleteFont
(
font
);
height
=
12345
;
...
...
@@ -422,7 +398,7 @@ static void test_heightgivendpi(void)
expect
(
Ok
,
stat
);
stat
=
GdipGetFontHeightGivenDPI
(
font
,
96
,
&
height
);
expect
(
Ok
,
stat
);
expectf
(
(
REAL
)
130
.
382614
,
height
);
expectf
(
136
.
860245
,
height
);
GdipDeleteFont
(
font
);
GdipDeleteFontFamily
(
fontfamily
);
...
...
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