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
a90d976b
Commit
a90d976b
authored
Apr 05, 2022
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/tests: Add some fallback tests for Segoe UI Symbol.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1765c459
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
0 deletions
+81
-0
layout.c
dlls/dwrite/tests/layout.c
+81
-0
No files found.
dlls/dwrite/tests/layout.c
View file @
a90d976b
...
@@ -4747,6 +4747,86 @@ if (font) {
...
@@ -4747,6 +4747,86 @@ if (font) {
IDWriteFactory2_Release
(
factory2
);
IDWriteFactory2_Release
(
factory2
);
}
}
static
void
get_font_name
(
IDWriteFont
*
font
,
WCHAR
*
name
,
UINT32
size
)
{
IDWriteLocalizedStrings
*
names
;
IDWriteFontFamily
*
family
;
UINT32
index
;
BOOL
exists
;
HRESULT
hr
;
hr
=
IDWriteFont_GetFontFamily
(
font
,
&
family
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDWriteFontFamily_GetFamilyNames
(
family
,
&
names
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDWriteLocalizedStrings_FindLocaleName
(
names
,
L"en-us"
,
&
index
,
&
exists
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
index
!=
UINT_MAX
&&
exists
,
"Name was not found.
\n
"
);
hr
=
IDWriteLocalizedStrings_GetString
(
names
,
index
,
name
,
size
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
IDWriteLocalizedStrings_Release
(
names
);
IDWriteFontFamily_Release
(
family
);
}
static
void
test_system_fallback
(
void
)
{
static
const
struct
fallback_test
{
const
WCHAR
text
[
2
];
const
WCHAR
*
name
;
}
tests
[]
=
{
{
{
0x25d4
,
0
},
L"Segoe UI Symbol"
},
};
IDWriteFontFallback
*
fallback
;
IDWriteFactory2
*
factory
;
IDWriteFont
*
font
;
UINT32
i
,
length
;
WCHAR
name
[
256
];
BOOL
exists
;
float
scale
;
HRESULT
hr
;
if
(
!
(
factory
=
create_factory_iid
(
&
IID_IDWriteFactory2
)))
{
win_skip
(
"System font fallback API is not supported.
\n
"
);
return
;
}
hr
=
IDWriteFactory2_GetSystemFontFallback
(
factory
,
&
fallback
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
);
++
i
)
{
g_source
=
tests
[
i
].
text
;
hr
=
IDWriteFontFallback_MapCharacters
(
fallback
,
&
analysissource
,
0
,
1
,
NULL
,
NULL
,
DWRITE_FONT_WEIGHT_NORMAL
,
DWRITE_FONT_STYLE_NORMAL
,
DWRITE_FONT_STRETCH_NORMAL
,
&
length
,
&
font
,
&
scale
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
continue
;
ok
(
length
==
1
,
"Unexpected length %u
\n
"
,
length
);
ok
(
scale
==
1
.
0
f
,
"got %f
\n
"
,
scale
);
get_font_name
(
font
,
name
,
ARRAY_SIZE
(
name
));
todo_wine
ok
(
!
wcscmp
(
name
,
tests
[
i
].
name
),
"%u: unexpected name %s.
\n
"
,
i
,
wine_dbgstr_w
(
name
));
hr
=
IDWriteFont_HasCharacter
(
font
,
g_source
[
0
],
&
exists
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
exists
,
"%s missing character %#x
\n
"
,
wine_dbgstr_w
(
name
),
g_source
[
0
]);
IDWriteFont_Release
(
font
);
}
IDWriteFontFallback_Release
(
fallback
);
IDWriteFactory2_Release
(
factory
);
}
static
void
test_FontFallbackBuilder
(
void
)
static
void
test_FontFallbackBuilder
(
void
)
{
{
IDWriteFontFallback
*
fallback
,
*
fallback2
;
IDWriteFontFallback
*
fallback
,
*
fallback2
;
...
@@ -6529,6 +6609,7 @@ START_TEST(layout)
...
@@ -6529,6 +6609,7 @@ START_TEST(layout)
test_pixelsnapping
();
test_pixelsnapping
();
test_SetWordWrapping
();
test_SetWordWrapping
();
test_MapCharacters
();
test_MapCharacters
();
test_system_fallback
();
test_FontFallbackBuilder
();
test_FontFallbackBuilder
();
test_SetTypography
();
test_SetTypography
();
test_SetLastLineWrapping
();
test_SetLastLineWrapping
();
...
...
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