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
ead6905d
Commit
ead6905d
authored
Dec 28, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 29, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/tests: Some tests for SetUnderline().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8165cba0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
layout.c
dlls/dwrite/tests/layout.c
+55
-0
No files found.
dlls/dwrite/tests/layout.c
View file @
ead6905d
...
...
@@ -4273,6 +4273,60 @@ static void test_SetOpticalAlignment(void)
IDWriteFactory_Release
(
factory
);
}
static
const
struct
drawcall_entry
drawunderline_seq
[]
=
{
{
DRAW_GLYPHRUN
,
{
'a'
,
'e'
,
0x0300
,
0
}
},
/* reported runs can't mix different underline values */
{
DRAW_GLYPHRUN
,
{
'd'
,
0
}
},
{
DRAW_UNDERLINE
},
{
DRAW_LAST_KIND
}
};
static
void
test_SetUnderline
(
void
)
{
static
const
WCHAR
strW
[]
=
{
'a'
,
'e'
,
0x0300
,
'd'
,
0
};
/* accent grave */
DWRITE_CLUSTER_METRICS
clusters
[
4
];
IDWriteTextFormat
*
format
;
IDWriteTextLayout
*
layout
;
DWRITE_TEXT_RANGE
range
;
IDWriteFactory
*
factory
;
UINT32
count
;
HRESULT
hr
;
factory
=
create_factory
();
hr
=
IDWriteFactory_CreateTextFormat
(
factory
,
tahomaW
,
NULL
,
DWRITE_FONT_WEIGHT_NORMAL
,
DWRITE_FONT_STYLE_NORMAL
,
DWRITE_FONT_STRETCH_NORMAL
,
10
.
0
,
enusW
,
&
format
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFactory_CreateTextLayout
(
factory
,
strW
,
4
,
format
,
1000
.
0
,
1000
.
0
,
&
layout
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IDWriteTextFormat_Release
(
format
);
count
=
0
;
hr
=
IDWriteTextLayout_GetClusterMetrics
(
layout
,
clusters
,
sizeof
(
clusters
)
/
sizeof
(
clusters
[
0
]),
&
count
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
count
==
3
,
"got %u
\n
"
,
count
);
range
.
startPosition
=
0
;
range
.
length
=
2
;
hr
=
IDWriteTextLayout_SetUnderline
(
layout
,
TRUE
,
range
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
count
=
0
;
hr
=
IDWriteTextLayout_GetClusterMetrics
(
layout
,
clusters
,
sizeof
(
clusters
)
/
sizeof
(
clusters
[
0
]),
&
count
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
count
==
3
,
"got %u
\n
"
,
count
);
flush_sequence
(
sequences
,
RENDERER_ID
);
hr
=
IDWriteTextLayout_Draw
(
layout
,
NULL
,
&
testrenderer
,
0
.
0
,
0
.
0
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok_sequence
(
sequences
,
RENDERER_ID
,
drawunderline_seq
,
"draw underline test"
,
TRUE
);
IDWriteTextLayout_Release
(
layout
);
IDWriteFactory_Release
(
factory
);
}
START_TEST
(
layout
)
{
static
const
WCHAR
ctrlstrW
[]
=
{
0x202a
,
0
};
...
...
@@ -4323,6 +4377,7 @@ START_TEST(layout)
test_SetTypography
();
test_SetLastLineWrapping
();
test_SetOpticalAlignment
();
test_SetUnderline
();
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