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
4c12157c
Commit
4c12157c
authored
Aug 20, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 21, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/tests: Fix analyzer test failures on Win10.
parent
8dd0738b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
9 deletions
+41
-9
analyzer.c
dlls/dwrite/tests/analyzer.c
+41
-9
No files found.
dlls/dwrite/tests/analyzer.c
View file @
4c12157c
...
@@ -1197,6 +1197,35 @@ static void test_numbersubstitution(void)
...
@@ -1197,6 +1197,35 @@ static void test_numbersubstitution(void)
IDWriteNumberSubstitution_Release
(
substitution
);
IDWriteNumberSubstitution_Release
(
substitution
);
}
}
static
void
get_fontface_glyphs
(
IDWriteFontFace
*
fontface
,
const
WCHAR
*
str
,
UINT16
*
glyphs
)
{
while
(
*
str
)
{
UINT32
codepoint
=
*
str
;
HRESULT
hr
;
hr
=
IDWriteFontFace_GetGlyphIndices
(
fontface
,
&
codepoint
,
1
,
glyphs
++
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
str
++
;
}
}
static
void
get_fontface_advances
(
IDWriteFontFace
*
fontface
,
FLOAT
emsize
,
const
UINT16
*
glyphs
,
FLOAT
*
advances
,
UINT32
count
)
{
DWRITE_FONT_METRICS
fontmetrics
;
UINT32
i
;
IDWriteFontFace_GetMetrics
(
fontface
,
&
fontmetrics
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
DWRITE_GLYPH_METRICS
metrics
;
HRESULT
hr
;
hr
=
IDWriteFontFace_GetDesignGlyphMetrics
(
fontface
,
glyphs
+
i
,
1
,
&
metrics
,
FALSE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
advances
[
i
]
=
(
FLOAT
)
metrics
.
advanceWidth
*
emsize
/
(
FLOAT
)
fontmetrics
.
designUnitsPerEm
;
}
}
static
void
test_GetGlyphs
(
void
)
static
void
test_GetGlyphs
(
void
)
{
{
static
const
WCHAR
test1W
[]
=
{
'<'
,
'B'
,
' '
,
'C'
,
0
};
static
const
WCHAR
test1W
[]
=
{
'<'
,
'B'
,
' '
,
'C'
,
0
};
...
@@ -1205,6 +1234,7 @@ static void test_GetGlyphs(void)
...
@@ -1205,6 +1234,7 @@ static void test_GetGlyphs(void)
DWRITE_SHAPING_GLYPH_PROPERTIES
shapingprops
[
20
];
DWRITE_SHAPING_GLYPH_PROPERTIES
shapingprops
[
20
];
DWRITE_SHAPING_TEXT_PROPERTIES
props
[
20
];
DWRITE_SHAPING_TEXT_PROPERTIES
props
[
20
];
UINT32
maxglyphcount
,
actual_count
;
UINT32
maxglyphcount
,
actual_count
;
FLOAT
advances
[
10
],
advances2
[
10
];
IDWriteTextAnalyzer
*
analyzer
;
IDWriteTextAnalyzer
*
analyzer
;
IDWriteFontFace
*
fontface
;
IDWriteFontFace
*
fontface
;
DWRITE_SCRIPT_ANALYSIS
sa
;
DWRITE_SCRIPT_ANALYSIS
sa
;
...
@@ -1212,7 +1242,6 @@ static void test_GetGlyphs(void)
...
@@ -1212,7 +1242,6 @@ static void test_GetGlyphs(void)
UINT16
clustermap
[
10
];
UINT16
clustermap
[
10
];
UINT16
glyphs1
[
10
];
UINT16
glyphs1
[
10
];
UINT16
glyphs2
[
10
];
UINT16
glyphs2
[
10
];
FLOAT
advances
[
10
];
HRESULT
hr
;
HRESULT
hr
;
hr
=
IDWriteFactory_CreateTextAnalyzer
(
factory
,
&
analyzer
);
hr
=
IDWriteFactory_CreateTextAnalyzer
(
factory
,
&
analyzer
);
...
@@ -1275,13 +1304,16 @@ if (0) {
...
@@ -1275,13 +1304,16 @@ if (0) {
ok
(
glyphs1
[
0
]
!=
glyphs2
[
0
],
"got %d
\n
"
,
glyphs1
[
0
]);
ok
(
glyphs1
[
0
]
!=
glyphs2
[
0
],
"got %d
\n
"
,
glyphs1
[
0
]);
/* embedded control codes, with unknown script id 0 */
/* embedded control codes, with unknown script id 0 */
get_fontface_glyphs
(
fontface
,
test3W
,
glyphs2
);
get_fontface_advances
(
fontface
,
10
.
0
,
glyphs2
,
advances2
,
2
);
actual_count
=
0
;
actual_count
=
0
;
hr
=
IDWriteTextAnalyzer_GetGlyphs
(
analyzer
,
test3W
,
lstrlenW
(
test3W
),
fontface
,
FALSE
,
TRUE
,
&
sa
,
NULL
,
hr
=
IDWriteTextAnalyzer_GetGlyphs
(
analyzer
,
test3W
,
lstrlenW
(
test3W
),
fontface
,
FALSE
,
TRUE
,
&
sa
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
maxglyphcount
,
clustermap
,
props
,
glyphs1
,
shapingprops
,
&
actual_count
);
NULL
,
NULL
,
NULL
,
0
,
maxglyphcount
,
clustermap
,
props
,
glyphs1
,
shapingprops
,
&
actual_count
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
actual_count
==
2
,
"got %d
\n
"
,
actual_count
);
ok
(
actual_count
==
2
,
"got %d
\n
"
,
actual_count
);
ok
(
glyphs1
[
0
]
==
0
,
"got %d
\n
"
,
glyphs1
[
0
]);
ok
(
glyphs1
[
0
]
==
glyphs2
[
0
],
"got %u, expected %u
\n
"
,
glyphs1
[
0
],
glyphs2
[
0
]);
ok
(
glyphs1
[
1
]
==
0
,
"got %d
\n
"
,
glyphs1
[
1
]);
ok
(
glyphs1
[
1
]
==
glyphs2
[
1
],
"got %u, expected %u
\n
"
,
glyphs1
[
1
],
glyphs2
[
1
]);
ok
(
shapingprops
[
0
].
isClusterStart
==
1
,
"got %d
\n
"
,
shapingprops
[
0
].
isClusterStart
);
ok
(
shapingprops
[
0
].
isClusterStart
==
1
,
"got %d
\n
"
,
shapingprops
[
0
].
isClusterStart
);
ok
(
shapingprops
[
0
].
isZeroWidthSpace
==
0
,
"got %d
\n
"
,
shapingprops
[
0
].
isZeroWidthSpace
);
ok
(
shapingprops
[
0
].
isZeroWidthSpace
==
0
,
"got %d
\n
"
,
shapingprops
[
0
].
isZeroWidthSpace
);
ok
(
shapingprops
[
1
].
isClusterStart
==
1
,
"got %d
\n
"
,
shapingprops
[
1
].
isClusterStart
);
ok
(
shapingprops
[
1
].
isClusterStart
==
1
,
"got %d
\n
"
,
shapingprops
[
1
].
isClusterStart
);
...
@@ -1294,8 +1326,8 @@ if (0) {
...
@@ -1294,8 +1326,8 @@ if (0) {
glyphs1
,
shapingprops
,
actual_count
,
fontface
,
10
.
0
,
FALSE
,
FALSE
,
&
sa
,
NULL
,
NULL
,
glyphs1
,
shapingprops
,
actual_count
,
fontface
,
10
.
0
,
FALSE
,
FALSE
,
&
sa
,
NULL
,
NULL
,
NULL
,
0
,
advances
,
offsets
);
NULL
,
0
,
advances
,
offsets
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
advances
[
0
]
==
10
.
0
,
"got %.2f
\n
"
,
advances
[
0
]);
ok
(
advances
[
0
]
==
advances2
[
0
],
"got %.2f, expected %.2f
\n
"
,
advances
[
0
],
advances2
[
0
]);
ok
(
advances
[
1
]
==
10
.
0
,
"got %.2f
\n
"
,
advances
[
1
]);
ok
(
advances
[
1
]
==
advances2
[
1
],
"got %.2f, expected %.2f
\n
"
,
advances
[
1
],
advances2
[
1
]);
/* embedded control codes with proper script */
/* embedded control codes with proper script */
sa
.
script
=
0
;
sa
.
script
=
0
;
...
@@ -1306,8 +1338,8 @@ if (0) {
...
@@ -1306,8 +1338,8 @@ if (0) {
NULL
,
NULL
,
NULL
,
0
,
maxglyphcount
,
clustermap
,
props
,
glyphs1
,
shapingprops
,
&
actual_count
);
NULL
,
NULL
,
NULL
,
0
,
maxglyphcount
,
clustermap
,
props
,
glyphs1
,
shapingprops
,
&
actual_count
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
actual_count
==
2
,
"got %d
\n
"
,
actual_count
);
ok
(
actual_count
==
2
,
"got %d
\n
"
,
actual_count
);
ok
(
glyphs1
[
0
]
==
0
,
"got %d
\n
"
,
glyphs1
[
0
]);
ok
(
glyphs1
[
0
]
==
glyphs2
[
0
],
"got %u, expected %u
\n
"
,
glyphs1
[
0
],
glyphs2
[
0
]);
ok
(
glyphs1
[
1
]
==
0
,
"got %d
\n
"
,
glyphs1
[
1
]);
ok
(
glyphs1
[
1
]
==
glyphs2
[
1
],
"got %u, expected %u
\n
"
,
glyphs1
[
1
],
glyphs2
[
1
]);
ok
(
shapingprops
[
0
].
isClusterStart
==
1
,
"got %d
\n
"
,
shapingprops
[
0
].
isClusterStart
);
ok
(
shapingprops
[
0
].
isClusterStart
==
1
,
"got %d
\n
"
,
shapingprops
[
0
].
isClusterStart
);
ok
(
shapingprops
[
0
].
isZeroWidthSpace
==
0
,
"got %d
\n
"
,
shapingprops
[
0
].
isZeroWidthSpace
);
ok
(
shapingprops
[
0
].
isZeroWidthSpace
==
0
,
"got %d
\n
"
,
shapingprops
[
0
].
isZeroWidthSpace
);
ok
(
shapingprops
[
1
].
isClusterStart
==
1
,
"got %d
\n
"
,
shapingprops
[
1
].
isClusterStart
);
ok
(
shapingprops
[
1
].
isClusterStart
==
1
,
"got %d
\n
"
,
shapingprops
[
1
].
isClusterStart
);
...
@@ -1320,8 +1352,8 @@ if (0) {
...
@@ -1320,8 +1352,8 @@ if (0) {
glyphs1
,
shapingprops
,
actual_count
,
fontface
,
10
.
0
,
FALSE
,
FALSE
,
&
sa
,
NULL
,
NULL
,
glyphs1
,
shapingprops
,
actual_count
,
fontface
,
10
.
0
,
FALSE
,
FALSE
,
&
sa
,
NULL
,
NULL
,
NULL
,
0
,
advances
,
offsets
);
NULL
,
0
,
advances
,
offsets
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
advances
[
0
]
==
10
.
0
,
"got %.2f
\n
"
,
advances
[
0
]);
ok
(
advances
[
0
]
==
advances2
[
0
],
"got %.2f, expected %.2f
\n
"
,
advances
[
0
],
advances2
[
0
]);
ok
(
advances
[
1
]
==
10
.
0
,
"got %.2f
\n
"
,
advances
[
1
]);
ok
(
advances
[
1
]
==
advances2
[
1
],
"got %.2f, expected %.2f
\n
"
,
advances
[
1
],
advances2
[
1
]);
IDWriteTextAnalyzer_Release
(
analyzer
);
IDWriteTextAnalyzer_Release
(
analyzer
);
IDWriteFontFace_Release
(
fontface
);
IDWriteFontFace_Release
(
fontface
);
...
...
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