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
6fea399a
Commit
6fea399a
authored
Mar 15, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/tests: Extend tests for synthesized axis values.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d871f04b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
1 deletion
+65
-1
font.c
dlls/dwrite/tests/font.c
+65
-1
No files found.
dlls/dwrite/tests/font.c
View file @
6fea399a
...
...
@@ -7822,10 +7822,31 @@ static void test_HasCharacter(void)
ok
(
ref
==
0
,
"factory not released, %u
\n
"
,
ref
);
}
static
BOOL
has_main_axis_values
(
const
DWRITE_FONT_AXIS_VALUE
*
values
,
unsigned
int
count
)
{
BOOL
has_wght
=
FALSE
,
has_wdth
=
FALSE
,
has_ital
=
FALSE
,
has_slnt
=
FALSE
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
count
;
++
i
)
{
if
(
values
[
i
].
axisTag
==
DWRITE_FONT_AXIS_TAG_WEIGHT
)
has_wght
=
TRUE
;
else
if
(
values
[
i
].
axisTag
==
DWRITE_FONT_AXIS_TAG_WIDTH
)
has_wdth
=
TRUE
;
else
if
(
values
[
i
].
axisTag
==
DWRITE_FONT_AXIS_TAG_ITALIC
)
has_ital
=
TRUE
;
else
if
(
values
[
i
].
axisTag
==
DWRITE_FONT_AXIS_TAG_SLANT
)
has_slnt
=
TRUE
;
}
return
has_wght
&&
has_wdth
&&
has_ital
&&
has_slnt
;
}
static
void
test_CreateFontFaceReference
(
void
)
{
IDWriteFontFaceReference
*
ref
,
*
ref1
,
*
ref3
;
IDWriteFontFace3
*
fontface
,
*
fontface1
;
DWRITE_FONT_AXIS_VALUE
axis_values
[
16
];
IDWriteFontCollection1
*
collection
;
IDWriteFontFile
*
file
,
*
file1
;
IDWriteFactory3
*
factory
;
...
...
@@ -7978,7 +7999,15 @@ todo_wine
(
void
**
)
&
ref2
)))
{
UINT32
axis_count
=
IDWriteFontFaceReference1_GetFontAxisValueCount
(
ref2
);
ok
(
axis_count
>
0
,
"Unexpected axis value count.
\n
"
);
todo_wine
ok
(
axis_count
>=
4
,
"Unexpected axis value count.
\n
"
);
hr
=
IDWriteFontFaceReference1_GetFontAxisValues
(
ref2
,
axis_values
,
ARRAY_SIZE
(
axis_values
));
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
has_main_axis_values
(
axis_values
,
axis_count
),
"Unexpected axis returned.
\n
"
);
IDWriteFontFaceReference1_Release
(
ref2
);
}
...
...
@@ -9394,9 +9423,11 @@ static void test_AnalyzeContainerType(void)
static
void
test_fontsetbuilder
(
void
)
{
IDWriteFontFaceReference
*
ref
,
*
ref2
,
*
ref3
;
IDWriteFontFaceReference1
*
ref1
;
IDWriteFontCollection1
*
collection
;
IDWriteFontSetBuilder1
*
builder1
;
IDWriteFontSetBuilder
*
builder
;
DWRITE_FONT_AXIS_VALUE
axis_values
[
4
];
IDWriteFactory3
*
factory
;
UINT32
count
,
i
,
refcount
;
IDWriteFontSet
*
fontset
;
...
...
@@ -9436,6 +9467,39 @@ static void test_fontsetbuilder(void)
count
=
IDWriteFontSet_GetFontCount
(
fontset
);
ok
(
count
==
2
,
"Unexpected font count %u.
\n
"
,
count
);
hr
=
IDWriteFontSet_GetFontFaceReference
(
fontset
,
0
,
&
ref
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDWriteFontFaceReference_QueryInterface
(
ref
,
&
IID_IDWriteFontFaceReference1
,
(
void
**
)
&
ref1
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
count
=
IDWriteFontFaceReference1_GetFontAxisValueCount
(
ref1
);
todo_wine
ok
(
count
==
4
,
"Unexpected axis count %u.
\n
"
,
count
);
if
(
count
==
4
)
{
hr
=
IDWriteFontFaceReference1_GetFontAxisValues
(
ref1
,
axis_values
,
ARRAY_SIZE
(
axis_values
));
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
axis_values
[
0
].
axisTag
==
DWRITE_FONT_AXIS_TAG_WEIGHT
,
"Unexpected tag[0] %s.
\n
"
,
wine_dbgstr_an
((
char
*
)
&
axis_values
[
0
].
axisTag
,
4
));
ok
(
axis_values
[
0
].
value
==
500
.
0
f
,
"Unexpected value[0] %f.
\n
"
,
axis_values
[
0
].
value
);
ok
(
axis_values
[
1
].
axisTag
==
DWRITE_FONT_AXIS_TAG_WIDTH
,
"Unexpected tag[1] %s.
\n
"
,
wine_dbgstr_an
((
char
*
)
&
axis_values
[
1
].
axisTag
,
4
));
ok
(
axis_values
[
1
].
value
==
100
.
0
f
,
"Unexpected value[1] %f.
\n
"
,
axis_values
[
1
].
value
);
ok
(
axis_values
[
2
].
axisTag
==
DWRITE_FONT_AXIS_TAG_ITALIC
,
"Unexpected tag[2] %s.
\n
"
,
wine_dbgstr_an
((
char
*
)
&
axis_values
[
2
].
axisTag
,
4
));
ok
(
axis_values
[
2
].
value
==
0
.
0
f
,
"Unexpected value[2] %f.
\n
"
,
axis_values
[
2
].
value
);
ok
(
axis_values
[
3
].
axisTag
==
DWRITE_FONT_AXIS_TAG_SLANT
,
"Unexpected tag[3] %s.
\n
"
,
wine_dbgstr_an
((
char
*
)
&
axis_values
[
3
].
axisTag
,
4
));
ok
(
axis_values
[
3
].
value
==
0
.
0
f
,
"Unexpected value[3] %f.
\n
"
,
axis_values
[
3
].
value
);
}
IDWriteFontFaceReference1_Release
(
ref1
);
IDWriteFontFaceReference_Release
(
ref
);
IDWriteFontSet_Release
(
fontset
);
IDWriteFontFile_Release
(
file
);
...
...
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