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
c683ad72
Commit
c683ad72
authored
Feb 09, 2012
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Feb 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32/tests: Add tests for East Asian font selection.
parent
9ae17687
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
font.c
dlls/gdi32/tests/font.c
+58
-0
No files found.
dlls/gdi32/tests/font.c
View file @
c683ad72
...
...
@@ -4166,6 +4166,63 @@ static void test_vertical_font(void)
DeleteFile
(
ttf_name
);
}
static
INT
CALLBACK
has_vertical_font_proc
(
const
LOGFONT
*
lf
,
const
TEXTMETRIC
*
ntm
,
DWORD
type
,
LPARAM
lParam
)
{
if
(
lf
->
lfFaceName
[
0
]
==
'@'
)
{
return
0
;
}
return
1
;
}
static
void
test_east_asian_font_selection
(
void
)
{
HDC
hdc
;
UINT
charset
[]
=
{
SHIFTJIS_CHARSET
,
HANGEUL_CHARSET
,
JOHAB_CHARSET
,
GB2312_CHARSET
,
CHINESEBIG5_CHARSET
};
size_t
i
;
hdc
=
GetDC
(
NULL
);
for
(
i
=
0
;
i
<
sizeof
(
charset
)
/
sizeof
(
charset
[
0
]);
i
++
)
{
LOGFONTA
lf
;
HFONT
hfont
;
char
face_name
[
LF_FACESIZE
];
int
ret
;
memset
(
&
lf
,
0
,
sizeof
lf
);
lf
.
lfFaceName
[
0
]
=
'\0'
;
lf
.
lfCharSet
=
charset
[
i
];
if
(
EnumFontFamiliesEx
(
hdc
,
&
lf
,
has_vertical_font_proc
,
0
,
0
))
{
skip
(
"Vertical font for charset %u is not installed
\n
"
,
charset
[
i
]);
continue
;
}
hfont
=
CreateFontIndirectA
(
&
lf
);
hfont
=
SelectObject
(
hdc
,
hfont
);
memset
(
face_name
,
0
,
sizeof
face_name
);
ret
=
GetTextFaceA
(
hdc
,
sizeof
face_name
,
face_name
);
todo_wine
ok
(
ret
&&
face_name
[
0
]
!=
'@'
,
"expected non-vertical face for charset %u, got %s
\n
"
,
charset
[
i
],
face_name
);
DeleteObject
(
SelectObject
(
hdc
,
hfont
));
memset
(
&
lf
,
0
,
sizeof
lf
);
strcpy
(
lf
.
lfFaceName
,
"@"
);
lf
.
lfCharSet
=
charset
[
i
];
hfont
=
CreateFontIndirectA
(
&
lf
);
hfont
=
SelectObject
(
hdc
,
hfont
);
memset
(
face_name
,
0
,
sizeof
face_name
);
ret
=
GetTextFaceA
(
hdc
,
sizeof
face_name
,
face_name
);
ok
(
ret
&&
face_name
[
0
]
==
'@'
,
"expected vertical face for charset %u, got %s
\n
"
,
charset
[
i
],
face_name
);
DeleteObject
(
SelectObject
(
hdc
,
hfont
));
}
ReleaseDC
(
NULL
,
hdc
);
}
START_TEST
(
font
)
{
init
();
...
...
@@ -4220,6 +4277,7 @@ START_TEST(font)
test_fullname
();
test_vertical_font
();
test_east_asian_font_selection
();
/* CreateScalableFontResource 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