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
9103ee4c
Commit
9103ee4c
authored
Nov 06, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Set fontface pointer and font size for returned color glyph run.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1e8a706b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
font.c
dlls/dwrite/font.c
+10
-8
font.c
dlls/dwrite/tests/font.c
+8
-0
No files found.
dlls/dwrite/font.c
View file @
9103ee4c
...
@@ -5418,19 +5418,19 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
...
@@ -5418,19 +5418,19 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
{
{
struct
dwrite_colorglyphenum
*
colorglyphenum
;
struct
dwrite_colorglyphenum
*
colorglyphenum
;
BOOL
colorfont
,
has_colored_glyph
;
BOOL
colorfont
,
has_colored_glyph
;
IDWriteFontFace4
*
fontface
3
;
IDWriteFontFace4
*
fontface
;
HRESULT
hr
;
HRESULT
hr
;
UINT32
i
;
UINT32
i
;
*
ret
=
NULL
;
*
ret
=
NULL
;
hr
=
IDWriteFontFace_QueryInterface
(
run
->
fontFace
,
&
IID_IDWriteFontFace4
,
(
void
**
)
&
fontface
3
);
hr
=
IDWriteFontFace_QueryInterface
(
run
->
fontFace
,
&
IID_IDWriteFontFace4
,
(
void
**
)
&
fontface
);
if
(
FAILED
(
hr
))
{
if
(
FAILED
(
hr
))
{
WARN
(
"failed to get IDWriteFontFace4, 0x%08x
\n
"
,
hr
);
WARN
(
"failed to get IDWriteFontFace4, 0x%08x
\n
"
,
hr
);
return
hr
;
return
hr
;
}
}
colorfont
=
IDWriteFontFace4_IsColorFont
(
fontface
3
)
&&
IDWriteFontFace4_GetColorPaletteCount
(
fontface3
)
>
palette
;
colorfont
=
IDWriteFontFace4_IsColorFont
(
fontface
)
&&
IDWriteFontFace4_GetColorPaletteCount
(
fontface
)
>
palette
;
if
(
!
colorfont
)
{
if
(
!
colorfont
)
{
hr
=
DWRITE_E_NOCOLOR
;
hr
=
DWRITE_E_NOCOLOR
;
goto
failed
;
goto
failed
;
...
@@ -5446,7 +5446,7 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
...
@@ -5446,7 +5446,7 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
colorglyphenum
->
ref
=
1
;
colorglyphenum
->
ref
=
1
;
colorglyphenum
->
origin_x
=
originX
;
colorglyphenum
->
origin_x
=
originX
;
colorglyphenum
->
origin_y
=
originY
;
colorglyphenum
->
origin_y
=
originY
;
colorglyphenum
->
fontface
=
fontface
3
;
colorglyphenum
->
fontface
=
fontface
;
colorglyphenum
->
glyphs
=
NULL
;
colorglyphenum
->
glyphs
=
NULL
;
colorglyphenum
->
run
=
*
run
;
colorglyphenum
->
run
=
*
run
;
colorglyphenum
->
run
.
glyphIndices
=
NULL
;
colorglyphenum
->
run
.
glyphIndices
=
NULL
;
...
@@ -5455,7 +5455,7 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
...
@@ -5455,7 +5455,7 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
colorglyphenum
->
palette
=
palette
;
colorglyphenum
->
palette
=
palette
;
memset
(
&
colorglyphenum
->
colr
,
0
,
sizeof
(
colorglyphenum
->
colr
));
memset
(
&
colorglyphenum
->
colr
,
0
,
sizeof
(
colorglyphenum
->
colr
));
colorglyphenum
->
colr
.
exists
=
TRUE
;
colorglyphenum
->
colr
.
exists
=
TRUE
;
get_fontface_table
(
fontface
3
,
MS_COLR_TAG
,
&
colorglyphenum
->
colr
);
get_fontface_table
(
fontface
,
MS_COLR_TAG
,
&
colorglyphenum
->
colr
);
colorglyphenum
->
current_layer
=
0
;
colorglyphenum
->
current_layer
=
0
;
colorglyphenum
->
max_layer_num
=
0
;
colorglyphenum
->
max_layer_num
=
0
;
...
@@ -5488,6 +5488,8 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
...
@@ -5488,6 +5488,8 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
memcpy
(
colorglyphenum
->
offsets
,
run
->
glyphOffsets
,
run
->
glyphCount
*
sizeof
(
*
run
->
glyphOffsets
));
memcpy
(
colorglyphenum
->
offsets
,
run
->
glyphOffsets
,
run
->
glyphCount
*
sizeof
(
*
run
->
glyphOffsets
));
}
}
colorglyphenum
->
colorrun
.
glyphRun
.
fontFace
=
(
IDWriteFontFace
*
)
fontface
;
colorglyphenum
->
colorrun
.
glyphRun
.
fontEmSize
=
run
->
fontEmSize
;
colorglyphenum
->
colorrun
.
glyphRun
.
glyphIndices
=
colorglyphenum
->
glyphindices
;
colorglyphenum
->
colorrun
.
glyphRun
.
glyphIndices
=
colorglyphenum
->
glyphindices
;
colorglyphenum
->
colorrun
.
glyphRun
.
glyphAdvances
=
colorglyphenum
->
color_advances
;
colorglyphenum
->
colorrun
.
glyphRun
.
glyphAdvances
=
colorglyphenum
->
color_advances
;
colorglyphenum
->
colorrun
.
glyphRun
.
glyphOffsets
=
colorglyphenum
->
color_offsets
;
colorglyphenum
->
colorrun
.
glyphRun
.
glyphOffsets
=
colorglyphenum
->
color_offsets
;
...
@@ -5506,14 +5508,14 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
...
@@ -5506,14 +5508,14 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
switch
(
measuring_mode
)
switch
(
measuring_mode
)
{
{
case
DWRITE_MEASURING_MODE_NATURAL
:
case
DWRITE_MEASURING_MODE_NATURAL
:
hr
=
IDWriteFontFace4_GetDesignGlyphAdvances
(
fontface
3
,
1
,
run
->
glyphIndices
+
i
,
&
a
,
run
->
isSideways
);
hr
=
IDWriteFontFace4_GetDesignGlyphAdvances
(
fontface
,
1
,
run
->
glyphIndices
+
i
,
&
a
,
run
->
isSideways
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
a
=
0
;
a
=
0
;
colorglyphenum
->
advances
[
i
]
=
get_scaled_advance_width
(
a
,
run
->
fontEmSize
,
&
metrics
);
colorglyphenum
->
advances
[
i
]
=
get_scaled_advance_width
(
a
,
run
->
fontEmSize
,
&
metrics
);
break
;
break
;
case
DWRITE_MEASURING_MODE_GDI_CLASSIC
:
case
DWRITE_MEASURING_MODE_GDI_CLASSIC
:
case
DWRITE_MEASURING_MODE_GDI_NATURAL
:
case
DWRITE_MEASURING_MODE_GDI_NATURAL
:
hr
=
IDWriteFontFace4_GetGdiCompatibleGlyphAdvances
(
fontface
3
,
run
->
fontEmSize
,
1
.
0
f
,
transform
,
hr
=
IDWriteFontFace4_GetGdiCompatibleGlyphAdvances
(
fontface
,
run
->
fontEmSize
,
1
.
0
f
,
transform
,
measuring_mode
==
DWRITE_MEASURING_MODE_GDI_NATURAL
,
run
->
isSideways
,
1
,
run
->
glyphIndices
+
i
,
&
a
);
measuring_mode
==
DWRITE_MEASURING_MODE_GDI_NATURAL
,
run
->
isSideways
,
1
,
run
->
glyphIndices
+
i
,
&
a
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
colorglyphenum
->
advances
[
i
]
=
0
.
0
f
;
colorglyphenum
->
advances
[
i
]
=
0
.
0
f
;
...
@@ -5530,7 +5532,7 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
...
@@ -5530,7 +5532,7 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
return
S_OK
;
return
S_OK
;
failed:
failed:
IDWriteFontFace4_Release
(
fontface
3
);
IDWriteFontFace4_Release
(
fontface
);
return
hr
;
return
hr
;
}
}
...
...
dlls/dwrite/tests/font.c
View file @
9103ee4c
...
@@ -5977,6 +5977,14 @@ static void test_TranslateColorGlyphRun(void)
...
@@ -5977,6 +5977,14 @@ static void test_TranslateColorGlyphRun(void)
if
(
!
hasrun
)
if
(
!
hasrun
)
break
;
break
;
hr
=
IDWriteColorGlyphRunEnumerator_GetCurrentRun
(
layers
,
&
colorrun
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
colorrun
->
glyphRun
.
fontFace
!=
NULL
,
"got fontface %p
\n
"
,
colorrun
->
glyphRun
.
fontFace
);
ok
(
colorrun
->
glyphRun
.
fontEmSize
==
20
.
0
f
,
"got wrong font size %f
\n
"
,
colorrun
->
glyphRun
.
fontEmSize
);
ok
(
colorrun
->
glyphRun
.
glyphCount
>
0
,
"got wrong glyph count %u
\n
"
,
colorrun
->
glyphRun
.
glyphCount
);
ok
(
colorrun
->
glyphRun
.
glyphIndices
!=
NULL
,
"got null glyph indices %p
\n
"
,
colorrun
->
glyphRun
.
glyphIndices
);
ok
(
colorrun
->
glyphRun
.
glyphAdvances
!=
NULL
,
"got null glyph advances %p
\n
"
,
colorrun
->
glyphRun
.
glyphAdvances
);
}
}
/* iterated all way through */
/* iterated all way through */
...
...
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