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
a718a9a5
Commit
a718a9a5
authored
Jul 20, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/tests: Some tests for bounds returned by GetAlphaTextureBounds().
parent
5231715d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
font.c
dlls/dwrite/tests/font.c
+36
-0
No files found.
dlls/dwrite/tests/font.c
View file @
a718a9a5
...
...
@@ -3403,6 +3403,7 @@ static void test_CreateGlyphRunAnalysis(void)
RECT
rect
;
DWRITE_GLYPH_OFFSET
offset
;
DWRITE_GLYPH_METRICS
metrics
;
DWRITE_FONT_METRICS
fm
;
int
i
;
factory
=
create_factory
();
...
...
@@ -3492,6 +3493,41 @@ static void test_CreateGlyphRunAnalysis(void)
IDWriteGlyphRunAnalysis_Release
(
analysis
);
}
IDWriteFontFace_GetMetrics
(
run
.
fontFace
,
&
fm
);
/* check bbox for a single glyph run */
for
(
run
.
fontEmSize
=
1
.
0
;
run
.
fontEmSize
<=
100
.
0
;
run
.
fontEmSize
+=
1
.
0
)
{
DWRITE_GLYPH_METRICS
gm
;
LONG
bboxX
,
bboxY
;
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
1
.
0
,
NULL
,
DWRITE_RENDERING_MODE_ALIASED
,
DWRITE_MEASURING_MODE_GDI_CLASSIC
,
0
.
0
,
0
.
0
,
&
analysis
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
memset
(
&
rect
,
0
,
sizeof
(
rect
));
hr
=
IDWriteGlyphRunAnalysis_GetAlphaTextureBounds
(
analysis
,
DWRITE_TEXTURE_ALIASED_1x1
,
&
rect
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
break
;
hr
=
IDWriteFontFace_GetGdiCompatibleGlyphMetrics
(
run
.
fontFace
,
run
.
fontEmSize
,
1
.
0
,
NULL
,
DWRITE_MEASURING_MODE_GDI_CLASSIC
,
run
.
glyphIndices
,
1
,
&
gm
,
run
.
isSideways
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
/* metrics are in design units */
bboxX
=
(
int
)
floorf
((
gm
.
advanceWidth
-
gm
.
leftSideBearing
-
gm
.
rightSideBearing
)
*
run
.
fontEmSize
/
fm
.
designUnitsPerEm
+
0
.
5
f
);
bboxY
=
(
int
)
floorf
((
gm
.
advanceHeight
-
gm
.
topSideBearing
-
gm
.
bottomSideBearing
)
*
run
.
fontEmSize
/
fm
.
designUnitsPerEm
+
0
.
5
f
);
rect
.
right
-=
rect
.
left
;
rect
.
bottom
-=
rect
.
top
;
ok
(
abs
(
bboxX
-
rect
.
right
)
<=
1
,
"%.0f: bbox width %d, from metrics %d
\n
"
,
run
.
fontEmSize
,
rect
.
right
,
bboxX
);
ok
(
abs
(
bboxY
-
rect
.
bottom
)
<=
1
,
"%.0f: bbox height %d, from metrics %d
\n
"
,
run
.
fontEmSize
,
rect
.
bottom
,
bboxY
);
IDWriteGlyphRunAnalysis_Release
(
analysis
);
}
IDWriteFontFace_Release
(
face
);
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