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
bcd793bf
Commit
bcd793bf
authored
Sep 13, 2011
by
Francois Gouget
Committed by
Alexandre Julliard
Sep 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus/tests: Don't check for hardcoded family font names.
Only check that each font family is different and that we can create fonts from them.
parent
8973c20f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
43 deletions
+46
-43
font.c
dlls/gdiplus/tests/font.c
+46
-43
No files found.
dlls/gdiplus/tests/font.c
View file @
bcd793bf
...
...
@@ -34,6 +34,7 @@ static const WCHAR MicrosoftSansSerif[] = {'M','i','c','r','o','s','o','f','t','
static
const
WCHAR
TimesNewRoman
[]
=
{
'T'
,
'i'
,
'm'
,
'e'
,
's'
,
' '
,
'N'
,
'e'
,
'w'
,
' '
,
'R'
,
'o'
,
'm'
,
'a'
,
'n'
,
'\0'
};
static
const
WCHAR
CourierNew
[]
=
{
'C'
,
'o'
,
'u'
,
'r'
,
'i'
,
'e'
,
'r'
,
' '
,
'N'
,
'e'
,
'w'
,
'\0'
};
static
const
WCHAR
Tahoma
[]
=
{
'T'
,
'a'
,
'h'
,
'o'
,
'm'
,
'a'
,
0
};
static
const
WCHAR
LiberationSerif
[]
=
{
'L'
,
'i'
,
'b'
,
'e'
,
'r'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
' '
,
'S'
,
'e'
,
'r'
,
'i'
,
'f'
,
0
};
static
void
test_createfont
(
void
)
{
...
...
@@ -284,60 +285,62 @@ static void test_fontfamily_properties (void)
}
}
static
void
test_getgenerics
(
void
)
static
void
check_family
(
const
char
*
context
,
GpFontFamily
*
family
,
WCHAR
*
name
)
{
GpStatus
stat
;
GpFontFamily
*
family
;
WCHAR
familyName
[
LF_FACESIZE
];
ZeroMemory
(
familyName
,
sizeof
(
familyName
)
/
sizeof
(
WCHAR
));
GpFont
*
font
;
stat
=
GdipGetGenericFontFamilySansSerif
(
&
family
);
if
(
stat
==
FontFamilyNotFound
)
*
name
=
0
;
stat
=
GdipGetFamilyName
(
family
,
name
,
LANG_NEUTRAL
);
ok
(
stat
==
Ok
,
"could not get the %s family name: %.8x
\n
"
,
context
,
stat
);
stat
=
GdipCreateFont
(
family
,
12
,
FontStyleRegular
,
UnitPixel
,
&
font
);
ok
(
stat
==
Ok
,
"could not create a font for the %s family: %.8x
\n
"
,
context
,
stat
);
if
(
stat
==
Ok
)
{
s
kip
(
"Microsoft Sans Serif not installed
\n
"
);
goto
serif
;
s
tat
=
GdipDeleteFont
(
font
);
ok
(
stat
==
Ok
,
"could not delete the %s family font: %.8x
\n
"
,
context
,
stat
)
;
}
stat
=
GdipDeleteFontFamily
(
family
);
ok
(
stat
==
Ok
,
"could not delete the %s family: %.8x
\n
"
,
context
,
stat
);
}
static
void
test_getgenerics
(
void
)
{
GpStatus
stat
;
GpFontFamily
*
family
;
WCHAR
sansname
[
LF_FACESIZE
],
serifname
[
LF_FACESIZE
],
mononame
[
LF_FACESIZE
];
int
missingfonts
=
0
;
stat
=
GdipGetGenericFontFamilySansSerif
(
&
family
);
expect
(
Ok
,
stat
);
stat
=
GdipGetFamilyName
(
family
,
familyName
,
LANG_NEUTRAL
);
expect
(
Ok
,
stat
);
if
(
!
lstrcmpiW
(
familyName
,
Tahoma
))
todo_wine
ok
((
lstrcmpiW
(
familyName
,
MicrosoftSansSerif
)
==
0
),
"Expected Microsoft Sans Serif, got Tahoma
\n
"
);
if
(
stat
==
FontFamilyNotFound
)
missingfonts
=
1
;
else
ok
((
lstrcmpiW
(
familyName
,
MicrosoftSansSerif
)
==
0
),
"Expected Microsoft Sans Serif, got %s
\n
"
,
wine_dbgstr_w
(
familyName
));
stat
=
GdipDeleteFontFamily
(
family
);
expect
(
Ok
,
stat
);
check_family
(
"Sans Serif"
,
family
,
sansname
);
serif:
stat
=
GdipGetGenericFontFamilySerif
(
&
family
);
if
(
stat
==
FontFamilyNotFound
)
{
skip
(
"Times New Roman not installed
\n
"
);
goto
monospace
;
}
expect
(
Ok
,
stat
);
stat
=
GdipGetFamilyName
(
family
,
familyName
,
LANG_NEUTRAL
);
stat
=
GdipGetGenericFontFamilySerif
(
&
family
);
expect
(
Ok
,
stat
);
ok
(
lstrcmpiW
(
familyName
,
TimesNewRoman
)
==
0
,
"Expected Times New Roman, got %s
\n
"
,
wine_dbgstr_w
(
familyName
));
stat
=
GdipDeleteFontFamily
(
family
);
expect
(
Ok
,
stat
);
monospace:
stat
=
GdipGetGenericFontFamilyMonospace
(
&
family
);
if
(
stat
==
FontFamilyNotFound
)
{
skip
(
"Courier New not installed
\n
"
);
return
;
}
expect
(
Ok
,
stat
);
stat
=
GdipGetFamilyName
(
family
,
familyName
,
LANG_NEUTRAL
);
expect
(
Ok
,
stat
);
ok
(
lstrcmpiW
(
familyName
,
CourierNew
)
==
0
,
"Expected Courier New, got %s
\n
"
,
wine_dbgstr_w
(
familyName
));
stat
=
GdipDeleteFontFamily
(
family
);
missingfonts
=
1
;
else
check_family
(
"Serif"
,
family
,
serifname
);
stat
=
GdipGetGenericFontFamilyMonospace
(
&
family
);
expect
(
Ok
,
stat
);
if
(
stat
==
FontFamilyNotFound
)
missingfonts
=
1
;
else
check_family
(
"Monospace"
,
family
,
mononame
);
if
(
missingfonts
&&
strcmp
(
winetest_platform
,
"wine"
)
==
0
)
trace
(
"You may need to install either the Microsoft Web Fonts or the Liberation Fonts
\n
"
);
/* Check that the family names are all different */
ok
(
lstrcmpiW
(
sansname
,
serifname
)
!=
0
,
"Sans Serif and Serif families should be different: %s
\n
"
,
wine_dbgstr_w
(
sansname
));
ok
(
lstrcmpiW
(
sansname
,
mononame
)
!=
0
,
"Sans Serif and Monospace families should be different: %s
\n
"
,
wine_dbgstr_w
(
sansname
));
ok
(
lstrcmpiW
(
serifname
,
mononame
)
!=
0
,
"Serif and Monospace families should be different: %s
\n
"
,
wine_dbgstr_w
(
serifname
));
}
static
void
test_installedfonts
(
void
)
...
...
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