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
1e7116ca
Commit
1e7116ca
authored
Feb 19, 2014
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Feb 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32/tests: Avoid using GetGlyphIndices directly.
parent
efe7a976
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
17 deletions
+28
-17
font.c
dlls/gdi32/tests/font.c
+28
-17
No files found.
dlls/gdi32/tests/font.c
View file @
1e7116ca
...
...
@@ -5303,26 +5303,32 @@ static void check_vertical_metrics(const char *face)
otm
.
otmSize
=
sizeof
(
otm
);
ret
=
GetOutlineTextMetricsA
(
hdc
,
sizeof
(
otm
),
&
otm
);
ok
(
ret
!=
0
,
"GetOutlineTextMetricsA failed
\n
"
);
ret
=
GetGlyphIndicesW
(
hdc
,
(
LPCWSTR
)
&
code
,
1
,
&
idx
,
0
);
ok
(
ret
!=
0
,
"GetGlyphIndicesW failed
\n
"
);
if
(
GetFontData
(
hdc
,
MS_MAKE_TAG
(
'v'
,
'h'
,
'e'
,
'a'
),
sizeof
(
SHORT
)
*
17
,
&
numOfLongVerMetrics
,
sizeof
(
numOfLongVerMetrics
))
!=
GDI_ERROR
)
{
int
offset
;
SHORT
topSideBearing
;
numOfLongVerMetrics
=
GET_BE_WORD
(
numOfLongVerMetrics
);
if
(
numOfLongVerMetrics
>
idx
)
offset
=
idx
*
2
+
1
;
else
offset
=
numOfLongVerMetrics
*
2
+
(
idx
-
numOfLongVerMetrics
);
ret
=
GetFontData
(
hdc
,
MS_MAKE_TAG
(
'v'
,
'm'
,
't'
,
'x'
),
offset
*
sizeof
(
SHORT
),
&
topSideBearing
,
sizeof
(
SHORT
));
ok
(
ret
!=
GDI_ERROR
,
"GetFontData(vmtx) failed
\n
"
);
topSideBearing
=
GET_BE_WORD
(
topSideBearing
);
ok
(
match_off_by_1
(
vgm
.
gmptGlyphOrigin
.
x
,
MulDiv
(
topSideBearing
,
height
,
otm
.
otmEMSquare
),
FALSE
),
"expected %d, got %d
\n
"
,
MulDiv
(
topSideBearing
,
height
,
otm
.
otmEMSquare
),
vgm
.
gmptGlyphOrigin
.
x
);
if
(
!
pGetGlyphIndicesW
)
{
win_skip
(
"GetGlyphIndices is not available on this platform
\n
"
);
}
else
{
ret
=
pGetGlyphIndicesW
(
hdc
,
(
LPCWSTR
)
&
code
,
1
,
&
idx
,
0
);
ok
(
ret
!=
0
,
"GetGlyphIndicesW failed
\n
"
);
numOfLongVerMetrics
=
GET_BE_WORD
(
numOfLongVerMetrics
);
if
(
numOfLongVerMetrics
>
idx
)
offset
=
idx
*
2
+
1
;
else
offset
=
numOfLongVerMetrics
*
2
+
(
idx
-
numOfLongVerMetrics
);
ret
=
GetFontData
(
hdc
,
MS_MAKE_TAG
(
'v'
,
'm'
,
't'
,
'x'
),
offset
*
sizeof
(
SHORT
),
&
topSideBearing
,
sizeof
(
SHORT
));
ok
(
ret
!=
GDI_ERROR
,
"GetFontData(vmtx) failed
\n
"
);
topSideBearing
=
GET_BE_WORD
(
topSideBearing
);
ok
(
match_off_by_1
(
vgm
.
gmptGlyphOrigin
.
x
,
MulDiv
(
topSideBearing
,
height
,
otm
.
otmEMSquare
),
FALSE
),
"expected %d, got %d
\n
"
,
MulDiv
(
topSideBearing
,
height
,
otm
.
otmEMSquare
),
vgm
.
gmptGlyphOrigin
.
x
);
}
}
else
{
...
...
@@ -5879,6 +5885,11 @@ static void test_bitmap_font_glyph_index(void)
CHARSETINFO
ci
;
BYTE
chr
=
'\xA9'
;
if
(
!
pGetGlyphIndicesW
||
!
pGetGlyphIndicesA
)
{
win_skip
(
"GetGlyphIndices is unavailable
\n
"
);
return
;
}
hdc
=
CreateCompatibleDC
(
0
);
ok
(
hdc
!=
NULL
,
"CreateCompatibleDC failed
\n
"
);
...
...
@@ -5923,7 +5934,7 @@ static void test_bitmap_font_glyph_index(void)
{
int
len
=
lstrlenW
(
text
);
LPWORD
indices
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WORD
));
ret
=
GetGlyphIndicesW
(
hdc
,
text
,
len
,
indices
,
0
);
ret
=
p
GetGlyphIndicesW
(
hdc
,
text
,
len
,
indices
,
0
);
ok
(
ret
,
"GetGlyphIndices failed
\n
"
);
ok
(
memcmp
(
indices
,
text
,
sizeof
(
WORD
)
*
len
)
==
0
,
"Glyph indices and text are different for %s:%d
\n
"
,
lf
.
lfFaceName
,
tm
.
tmCharSet
);
...
...
@@ -5959,7 +5970,7 @@ static void test_bitmap_font_glyph_index(void)
ret
=
ExtTextOutA
(
hdc
,
100
,
0
,
0
,
NULL
,
(
LPCSTR
)
&
chr
,
1
,
NULL
);
break
;
case
1
:
ret
=
GetGlyphIndicesA
(
hdc
,
(
LPCSTR
)
&
chr
,
1
,
&
code
,
0
);
ret
=
p
GetGlyphIndicesA
(
hdc
,
(
LPCSTR
)
&
chr
,
1
,
&
code
,
0
);
ok
(
ret
,
"GetGlyphIndices failed
\n
"
);
ok
(
code
==
chr
,
"expected %02x, got %02x (%s:%d)
\n
"
,
chr
,
code
,
lf
.
lfFaceName
,
tm
.
tmCharSet
);
ret
=
ExtTextOutA
(
hdc
,
100
,
0
,
ETO_GLYPH_INDEX
,
NULL
,
(
LPCSTR
)
&
code
,
1
,
NULL
);
...
...
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