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
cfe0f33a
Commit
cfe0f33a
authored
Mar 17, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/tests: Initial test for HasKerningPairs().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a3d78064
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
0 deletions
+76
-0
font.c
dlls/dwrite/tests/font.c
+76
-0
No files found.
dlls/dwrite/tests/font.c
View file @
cfe0f33a
...
...
@@ -41,6 +41,7 @@
#define MS_HHEA_TAG DWRITE_MAKE_OPENTYPE_TAG('h','h','e','a')
#define MS_POST_TAG DWRITE_MAKE_OPENTYPE_TAG('p','o','s','t')
#define MS_GSUB_TAG DWRITE_MAKE_OPENTYPE_TAG('G','S','U','B')
#define MS_KERN_TAG DWRITE_MAKE_OPENTYPE_TAG('k','e','r','n')
#ifdef WORDS_BIGENDIAN
#define GET_BE_WORD(x) (x)
...
...
@@ -6783,6 +6784,80 @@ static void test_HasVerticalGlyphVariants(void)
IDWriteFactory_Release
(
factory
);
}
static
void
test_HasKerningPairs
(
void
)
{
IDWriteFontCollection
*
syscollection
;
IDWriteFontFace1
*
fontface1
;
IDWriteFontFace
*
fontface
;
IDWriteFactory
*
factory
;
UINT32
count
,
i
;
HRESULT
hr
;
factory
=
create_factory
();
fontface
=
create_fontface
(
factory
);
hr
=
IDWriteFontFace_QueryInterface
(
fontface
,
&
IID_IDWriteFontFace1
,
(
void
**
)
&
fontface1
);
IDWriteFontFace_Release
(
fontface
);
if
(
hr
!=
S_OK
)
{
win_skip
(
"HasKerningPairs() is not supported.
\n
"
);
IDWriteFactory_Release
(
factory
);
return
;
}
IDWriteFontFace1_Release
(
fontface1
);
hr
=
IDWriteFactory_GetSystemFontCollection
(
factory
,
&
syscollection
,
FALSE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
count
=
IDWriteFontCollection_GetFontFamilyCount
(
syscollection
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
IDWriteLocalizedStrings
*
names
;
BOOL
exists
,
has_kerningpairs
;
IDWriteFontFamily
*
family
;
IDWriteFont
*
font
;
WCHAR
nameW
[
256
];
const
void
*
data
;
void
*
context
;
UINT32
size
;
hr
=
IDWriteFontCollection_GetFontFamily
(
syscollection
,
i
,
&
family
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFontFamily_GetFirstMatchingFont
(
family
,
DWRITE_FONT_WEIGHT_NORMAL
,
DWRITE_FONT_STRETCH_NORMAL
,
DWRITE_FONT_STYLE_NORMAL
,
&
font
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFont_CreateFontFace
(
font
,
&
fontface
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFontFace_QueryInterface
(
fontface
,
&
IID_IDWriteFontFace1
,
(
void
**
)
&
fontface1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFontFamily_GetFamilyNames
(
family
,
&
names
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
get_enus_string
(
names
,
nameW
,
sizeof
(
nameW
)
/
sizeof
(
nameW
[
0
]));
exists
=
FALSE
;
hr
=
IDWriteFontFace1_TryGetFontTable
(
fontface1
,
MS_KERN_TAG
,
&
data
,
&
size
,
&
context
,
&
exists
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IDWriteFontFace1_ReleaseFontTable
(
fontface1
,
context
);
has_kerningpairs
=
IDWriteFontFace1_HasKerningPairs
(
fontface1
);
if
(
!
exists
)
ok
(
!
has_kerningpairs
,
"%s: expected %d, got %d
\n
"
,
wine_dbgstr_w
(
nameW
),
exists
,
has_kerningpairs
);
IDWriteLocalizedStrings_Release
(
names
);
IDWriteFont_Release
(
font
);
IDWriteFontFace1_Release
(
fontface1
);
IDWriteFontFace_Release
(
fontface
);
IDWriteFontFamily_Release
(
family
);
}
IDWriteFontCollection_Release
(
syscollection
);
IDWriteFactory_Release
(
factory
);
}
START_TEST
(
font
)
{
IDWriteFactory
*
factory
;
...
...
@@ -6841,6 +6916,7 @@ START_TEST(font)
test_GetFontSignature
();
test_font_properties
();
test_HasVerticalGlyphVariants
();
test_HasKerningPairs
();
IDWriteFactory_Release
(
factory
);
}
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