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
14478b8b
Commit
14478b8b
authored
Feb 20, 2007
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Move get_glyph_indices near its caller test_font_charset.
parent
3c981715
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
83 deletions
+83
-83
font.c
dlls/gdi32/tests/font.c
+83
-83
No files found.
dlls/gdi32/tests/font.c
View file @
14478b8b
...
...
@@ -821,89 +821,6 @@ static void test_GetOutlineTextMetrics(void)
ReleaseDC
(
0
,
hdc
);
}
static
BOOL
get_glyph_indices
(
INT
charset
,
UINT
code_page
,
WORD
*
idx
,
UINT
count
,
BOOL
unicode
)
{
HDC
hdc
;
LOGFONTA
lf
;
HFONT
hfont
,
hfont_old
;
CHARSETINFO
csi
;
FONTSIGNATURE
fs
;
INT
cs
;
DWORD
i
,
ret
;
char
name
[
64
];
assert
(
count
<=
128
);
memset
(
&
lf
,
0
,
sizeof
(
lf
));
lf
.
lfCharSet
=
charset
;
lf
.
lfHeight
=
10
;
lstrcpyA
(
lf
.
lfFaceName
,
"Arial"
);
SetLastError
(
0xdeadbeef
);
hfont
=
CreateFontIndirectA
(
&
lf
);
ok
(
hfont
!=
0
,
"CreateFontIndirectA error %u
\n
"
,
GetLastError
());
hdc
=
GetDC
(
0
);
hfont_old
=
SelectObject
(
hdc
,
hfont
);
cs
=
GetTextCharsetInfo
(
hdc
,
&
fs
,
0
);
ok
(
cs
==
charset
,
"expected %d, got %d
\n
"
,
charset
,
cs
);
SetLastError
(
0xdeadbeef
);
ret
=
GetTextFace
(
hdc
,
sizeof
(
name
),
name
);
ok
(
ret
,
"GetTextFace error %u
\n
"
,
GetLastError
());
if
(
charset
==
SYMBOL_CHARSET
)
{
ok
(
strcmp
(
"Arial"
,
name
),
"face name should NOT be Arial
\n
"
);
ok
(
fs
.
fsCsb
[
0
]
&
(
1
<<
31
),
"symbol encoding should be available
\n
"
);
}
else
{
ok
(
!
strcmp
(
"Arial"
,
name
),
"face name should be Arial, not %s
\n
"
,
name
);
ok
(
!
(
fs
.
fsCsb
[
0
]
&
(
1
<<
31
)),
"symbol encoding should NOT be available
\n
"
);
}
if
(
!
TranslateCharsetInfo
((
DWORD
*
)
cs
,
&
csi
,
TCI_SRCCHARSET
))
{
trace
(
"Can't find codepage for charset %d
\n
"
,
cs
);
ReleaseDC
(
0
,
hdc
);
return
FALSE
;
}
ok
(
csi
.
ciACP
==
code_page
,
"expected %d, got %d
\n
"
,
code_page
,
csi
.
ciACP
);
if
(
unicode
)
{
char
ansi_buf
[
128
];
WCHAR
unicode_buf
[
128
];
for
(
i
=
0
;
i
<
count
;
i
++
)
ansi_buf
[
i
]
=
(
BYTE
)(
i
+
128
);
MultiByteToWideChar
(
code_page
,
0
,
ansi_buf
,
count
,
unicode_buf
,
count
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetGlyphIndicesW
(
hdc
,
unicode_buf
,
count
,
idx
,
0
);
ok
(
ret
==
count
,
"GetGlyphIndicesA error %u
\n
"
,
GetLastError
());
}
else
{
char
ansi_buf
[
128
];
for
(
i
=
0
;
i
<
count
;
i
++
)
ansi_buf
[
i
]
=
(
BYTE
)(
i
+
128
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetGlyphIndicesA
(
hdc
,
ansi_buf
,
count
,
idx
,
0
);
ok
(
ret
==
count
,
"GetGlyphIndicesA error %u
\n
"
,
GetLastError
());
}
SelectObject
(
hdc
,
hfont_old
);
DeleteObject
(
hfont
);
ReleaseDC
(
0
,
hdc
);
return
TRUE
;
}
static
void
testJustification
(
HDC
hdc
,
PSTR
str
,
RECT
*
clientArea
)
{
INT
x
,
y
,
...
...
@@ -1033,6 +950,89 @@ static void test_SetTextJustification(void)
DestroyWindow
(
hwnd
);
}
static
BOOL
get_glyph_indices
(
INT
charset
,
UINT
code_page
,
WORD
*
idx
,
UINT
count
,
BOOL
unicode
)
{
HDC
hdc
;
LOGFONTA
lf
;
HFONT
hfont
,
hfont_old
;
CHARSETINFO
csi
;
FONTSIGNATURE
fs
;
INT
cs
;
DWORD
i
,
ret
;
char
name
[
64
];
assert
(
count
<=
128
);
memset
(
&
lf
,
0
,
sizeof
(
lf
));
lf
.
lfCharSet
=
charset
;
lf
.
lfHeight
=
10
;
lstrcpyA
(
lf
.
lfFaceName
,
"Arial"
);
SetLastError
(
0xdeadbeef
);
hfont
=
CreateFontIndirectA
(
&
lf
);
ok
(
hfont
!=
0
,
"CreateFontIndirectA error %u
\n
"
,
GetLastError
());
hdc
=
GetDC
(
0
);
hfont_old
=
SelectObject
(
hdc
,
hfont
);
cs
=
GetTextCharsetInfo
(
hdc
,
&
fs
,
0
);
ok
(
cs
==
charset
,
"expected %d, got %d
\n
"
,
charset
,
cs
);
SetLastError
(
0xdeadbeef
);
ret
=
GetTextFace
(
hdc
,
sizeof
(
name
),
name
);
ok
(
ret
,
"GetTextFace error %u
\n
"
,
GetLastError
());
if
(
charset
==
SYMBOL_CHARSET
)
{
ok
(
strcmp
(
"Arial"
,
name
),
"face name should NOT be Arial
\n
"
);
ok
(
fs
.
fsCsb
[
0
]
&
(
1
<<
31
),
"symbol encoding should be available
\n
"
);
}
else
{
ok
(
!
strcmp
(
"Arial"
,
name
),
"face name should be Arial, not %s
\n
"
,
name
);
ok
(
!
(
fs
.
fsCsb
[
0
]
&
(
1
<<
31
)),
"symbol encoding should NOT be available
\n
"
);
}
if
(
!
TranslateCharsetInfo
((
DWORD
*
)
cs
,
&
csi
,
TCI_SRCCHARSET
))
{
trace
(
"Can't find codepage for charset %d
\n
"
,
cs
);
ReleaseDC
(
0
,
hdc
);
return
FALSE
;
}
ok
(
csi
.
ciACP
==
code_page
,
"expected %d, got %d
\n
"
,
code_page
,
csi
.
ciACP
);
if
(
unicode
)
{
char
ansi_buf
[
128
];
WCHAR
unicode_buf
[
128
];
for
(
i
=
0
;
i
<
count
;
i
++
)
ansi_buf
[
i
]
=
(
BYTE
)(
i
+
128
);
MultiByteToWideChar
(
code_page
,
0
,
ansi_buf
,
count
,
unicode_buf
,
count
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetGlyphIndicesW
(
hdc
,
unicode_buf
,
count
,
idx
,
0
);
ok
(
ret
==
count
,
"GetGlyphIndicesA error %u
\n
"
,
GetLastError
());
}
else
{
char
ansi_buf
[
128
];
for
(
i
=
0
;
i
<
count
;
i
++
)
ansi_buf
[
i
]
=
(
BYTE
)(
i
+
128
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetGlyphIndicesA
(
hdc
,
ansi_buf
,
count
,
idx
,
0
);
ok
(
ret
==
count
,
"GetGlyphIndicesA error %u
\n
"
,
GetLastError
());
}
SelectObject
(
hdc
,
hfont_old
);
DeleteObject
(
hfont
);
ReleaseDC
(
0
,
hdc
);
return
TRUE
;
}
static
void
test_font_charset
(
void
)
{
static
struct
charset_data
...
...
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