Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
de2ae5e1
Commit
de2ae5e1
authored
Jun 15, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Fix splitted range length, initial test for GetMetrics().
parent
4addd20a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
3 deletions
+78
-3
layout.c
dlls/dwrite/layout.c
+1
-1
analyzer.c
dlls/dwrite/tests/analyzer.c
+2
-2
layout.c
dlls/dwrite/tests/layout.c
+75
-0
No files found.
dlls/dwrite/layout.c
View file @
de2ae5e1
...
...
@@ -3084,7 +3084,7 @@ static HRESULT WINAPI dwritetextlayout_sink_SetBidiLevel(IDWriteTextAnalysisSink
/* reduce existing run */
cur
->
run
.
bidiLevel
=
resolvedLevel
;
cur
->
descr
.
stringLength
-
=
length
;
cur
->
descr
.
stringLength
=
length
;
list_add_after
(
&
cur_run
->
entry
,
&
run
->
entry
);
break
;
...
...
dlls/dwrite/tests/analyzer.c
View file @
de2ae5e1
...
...
@@ -523,8 +523,8 @@ static struct sa_test sa_tests[] = {
},
{
/* Arabic */
{
0x064a
,
0x064f
,
0x0633
,
0x0627
,
0x0648
,
0x0650
,
0x064a
,
0
},
1
,
{
{
0
,
7
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
{
0x064a
,
0x064f
,
0x0633
,
0x0627
,
0x0648
,
0x0650
,
0x064a
,
0
x0661
,
0
},
1
,
{
{
0
,
8
,
DWRITE_SCRIPT_SHAPES_DEFAULT
}}
},
{
/* Arabic */
...
...
dlls/dwrite/tests/layout.c
View file @
de2ae5e1
...
...
@@ -1380,6 +1380,7 @@ static void test_typography(void)
static
void
test_GetClusterMetrics
(
void
)
{
static
const
WCHAR
str3W
[]
=
{
0x2066
,
')'
,
')'
,
0x661
,
'('
,
0x627
,
')'
,
0
};
static
const
WCHAR
str2W
[]
=
{
0x202a
,
0x202c
,
'a'
,
0
};
static
const
WCHAR
strW
[]
=
{
'a'
,
'b'
,
'c'
,
'd'
,
0
};
DWRITE_INLINE_OBJECT_METRICS
inline_metrics
;
...
...
@@ -1399,6 +1400,13 @@ static void test_GetClusterMetrics(void)
DWRITE_FONT_STRETCH_NORMAL
,
10
.
0
,
enusW
,
&
format
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFactory_CreateTextLayout
(
factory
,
str3W
,
7
,
format
,
1000
.
0
,
1000
.
0
,
&
layout
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteTextLayout_GetClusterMetrics
(
layout
,
NULL
,
0
,
&
count
);
ok
(
hr
==
E_NOT_SUFFICIENT_BUFFER
,
"got 0x%08x
\n
"
,
hr
);
ok
(
count
==
7
,
"got %u
\n
"
,
count
);
IDWriteTextLayout_Release
(
layout
);
hr
=
IDWriteFactory_CreateTextLayout
(
factory
,
strW
,
4
,
format
,
1000
.
0
,
1000
.
0
,
&
layout
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
...
...
@@ -1873,6 +1881,7 @@ static void test_DetermineMinWidth(void)
IDWriteTextLayout_Release
(
layout
);
IDWriteTextFormat_Release
(
format
);
IDWriteFactory_Release
(
factory
);
}
static
void
test_SetFontSize
(
void
)
...
...
@@ -1964,6 +1973,7 @@ static void test_SetFontSize(void)
IDWriteTextLayout_Release
(
layout
);
IDWriteTextFormat_Release
(
format
);
IDWriteFactory_Release
(
factory
);
}
static
void
test_SetFontFamilyName
(
void
)
...
...
@@ -2044,6 +2054,7 @@ static void test_SetFontFamilyName(void)
IDWriteTextLayout_Release
(
layout
);
IDWriteTextFormat_Release
(
format
);
IDWriteFactory_Release
(
factory
);
}
static
void
test_SetFontStyle
(
void
)
...
...
@@ -2131,6 +2142,7 @@ static void test_SetFontStyle(void)
IDWriteTextLayout_Release
(
layout
);
IDWriteTextFormat_Release
(
format
);
IDWriteFactory_Release
(
factory
);
}
static
void
test_SetFontStretch
(
void
)
...
...
@@ -2225,6 +2237,7 @@ static void test_SetFontStretch(void)
IDWriteTextLayout_Release
(
layout
);
IDWriteTextFormat_Release
(
format
);
IDWriteFactory_Release
(
factory
);
}
static
void
test_SetStrikethrough
(
void
)
...
...
@@ -2286,6 +2299,67 @@ static void test_SetStrikethrough(void)
IDWriteTextLayout_Release
(
layout
);
IDWriteTextFormat_Release
(
format
);
IDWriteFactory_Release
(
factory
);
}
static
void
test_GetMetrics
(
void
)
{
static
const
WCHAR
str2W
[]
=
{
0x2066
,
')'
,
')'
,
0x661
,
'('
,
0x627
,
')'
,
0
};
static
const
WCHAR
strW
[]
=
{
'a'
,
'b'
,
'c'
,
'd'
,
0
};
DWRITE_TEXT_METRICS
metrics
;
IDWriteTextFormat
*
format
;
IDWriteTextLayout
*
layout
;
IDWriteFactory
*
factory
;
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
,
500
.
0
,
1000
.
0
,
&
layout
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
memset
(
&
metrics
,
0xcc
,
sizeof
(
metrics
));
hr
=
IDWriteTextLayout_GetMetrics
(
layout
,
&
metrics
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
metrics
.
left
==
0
.
0
,
"got %.2f
\n
"
,
metrics
.
left
);
ok
(
metrics
.
top
==
0
.
0
,
"got %.2f
\n
"
,
metrics
.
top
);
ok
(
metrics
.
width
>
0
.
0
,
"got %.2f
\n
"
,
metrics
.
width
);
ok
(
metrics
.
widthIncludingTrailingWhitespace
>
0
.
0
,
"got %.2f
\n
"
,
metrics
.
widthIncludingTrailingWhitespace
);
ok
(
metrics
.
height
>
0
.
0
,
"got %.2f
\n
"
,
metrics
.
height
);
ok
(
metrics
.
layoutWidth
==
500
.
0
,
"got %.2f
\n
"
,
metrics
.
layoutWidth
);
ok
(
metrics
.
layoutHeight
==
1000
.
0
,
"got %.2f
\n
"
,
metrics
.
layoutHeight
);
ok
(
metrics
.
maxBidiReorderingDepth
==
1
,
"got %u
\n
"
,
metrics
.
maxBidiReorderingDepth
);
ok
(
metrics
.
lineCount
==
1
,
"got %u
\n
"
,
metrics
.
lineCount
);
}
IDWriteTextLayout_Release
(
layout
);
/* a string with more complex bidi sequence */
hr
=
IDWriteFactory_CreateTextLayout
(
factory
,
str2W
,
7
,
format
,
500
.
0
,
1000
.
0
,
&
layout
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
memset
(
&
metrics
,
0xcc
,
sizeof
(
metrics
));
metrics
.
maxBidiReorderingDepth
=
0
;
hr
=
IDWriteTextLayout_GetMetrics
(
layout
,
&
metrics
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
metrics
.
left
==
0
.
0
,
"got %.2f
\n
"
,
metrics
.
left
);
ok
(
metrics
.
top
==
0
.
0
,
"got %.2f
\n
"
,
metrics
.
top
);
ok
(
metrics
.
width
>
0
.
0
,
"got %.2f
\n
"
,
metrics
.
width
);
ok
(
metrics
.
widthIncludingTrailingWhitespace
>
0
.
0
,
"got %.2f
\n
"
,
metrics
.
widthIncludingTrailingWhitespace
);
ok
(
metrics
.
height
>
0
.
0
,
"got %.2f
\n
"
,
metrics
.
height
);
ok
(
metrics
.
layoutWidth
==
500
.
0
,
"got %.2f
\n
"
,
metrics
.
layoutWidth
);
ok
(
metrics
.
layoutHeight
==
1000
.
0
,
"got %.2f
\n
"
,
metrics
.
layoutHeight
);
ok
(
metrics
.
maxBidiReorderingDepth
>
1
,
"got %u
\n
"
,
metrics
.
maxBidiReorderingDepth
);
ok
(
metrics
.
lineCount
==
1
,
"got %u
\n
"
,
metrics
.
lineCount
);
}
IDWriteTextLayout_Release
(
layout
);
IDWriteTextFormat_Release
(
format
);
IDWriteFactory_Release
(
factory
);
}
START_TEST
(
layout
)
...
...
@@ -2324,6 +2398,7 @@ START_TEST(layout)
test_SetFontStyle
();
test_SetFontStretch
();
test_SetStrikethrough
();
test_GetMetrics
();
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