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
ce526d15
Commit
ce526d15
authored
Feb 09, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Support optional glyph offsets for color runs.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
79fa94c3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
font.c
dlls/dwrite/font.c
+15
-1
No files found.
dlls/dwrite/font.c
View file @
ce526d15
...
@@ -191,6 +191,8 @@ struct dwrite_colorglyphenum {
...
@@ -191,6 +191,8 @@ struct dwrite_colorglyphenum {
UINT32
palette
;
/* palette index to get layer color from */
UINT32
palette
;
/* palette index to get layer color from */
FLOAT
*
advances
;
/* original or measured advances for base glyphs */
FLOAT
*
advances
;
/* original or measured advances for base glyphs */
FLOAT
*
color_advances
;
/* returned color run points to this */
FLOAT
*
color_advances
;
/* returned color run points to this */
DWRITE_GLYPH_OFFSET
*
offsets
;
/* original offsets, or NULL */
DWRITE_GLYPH_OFFSET
*
color_offsets
;
/* returned color run offsets, or NULL */
UINT16
*
glyphindices
;
/* returned color run points to this */
UINT16
*
glyphindices
;
/* returned color run points to this */
struct
dwrite_colorglyph
*
glyphs
;
/* current glyph color info */
struct
dwrite_colorglyph
*
glyphs
;
/* current glyph color info */
BOOL
has_regular_glyphs
;
/* TRUE if there's any glyph without a color */
BOOL
has_regular_glyphs
;
/* TRUE if there's any glyph without a color */
...
@@ -4629,6 +4631,8 @@ static ULONG WINAPI colorglyphenum_Release(IDWriteColorGlyphRunEnumerator *iface
...
@@ -4629,6 +4631,8 @@ static ULONG WINAPI colorglyphenum_Release(IDWriteColorGlyphRunEnumerator *iface
if
(
!
ref
)
{
if
(
!
ref
)
{
heap_free
(
This
->
advances
);
heap_free
(
This
->
advances
);
heap_free
(
This
->
color_advances
);
heap_free
(
This
->
color_advances
);
heap_free
(
This
->
offsets
);
heap_free
(
This
->
color_offsets
);
heap_free
(
This
->
glyphindices
);
heap_free
(
This
->
glyphindices
);
heap_free
(
This
->
glyphs
);
heap_free
(
This
->
glyphs
);
if
(
This
->
colr
.
context
)
if
(
This
->
colr
.
context
)
...
@@ -4672,6 +4676,8 @@ static BOOL colorglyphenum_build_color_run(struct dwrite_colorglyphenum *glyphen
...
@@ -4672,6 +4676,8 @@ static BOOL colorglyphenum_build_color_run(struct dwrite_colorglyphenum *glyphen
else
else
glyphenum
->
glyphindices
[
g
]
=
1
;
glyphenum
->
glyphindices
[
g
]
=
1
;
glyphenum
->
color_advances
[
g
]
=
glyphenum
->
advances
[
g
];
glyphenum
->
color_advances
[
g
]
=
glyphenum
->
advances
[
g
];
if
(
glyphenum
->
color_offsets
)
glyphenum
->
color_offsets
[
g
]
=
glyphenum
->
offsets
[
g
];
}
}
colorrun
->
baselineOriginX
=
glyphenum
->
origin_x
+
get_glyph_origin
(
glyphenum
,
first_glyph
);
colorrun
->
baselineOriginX
=
glyphenum
->
origin_x
+
get_glyph_origin
(
glyphenum
,
first_glyph
);
...
@@ -4716,6 +4722,9 @@ static BOOL colorglyphenum_build_color_run(struct dwrite_colorglyphenum *glyphen
...
@@ -4716,6 +4722,9 @@ static BOOL colorglyphenum_build_color_run(struct dwrite_colorglyphenum *glyphen
}
}
glyphenum
->
glyphindices
[
index
]
=
glyphenum
->
glyphs
[
g
].
glyph
;
glyphenum
->
glyphindices
[
index
]
=
glyphenum
->
glyphs
[
g
].
glyph
;
/* offsets are relative to glyph origin, nothing to fix up */
if
(
glyphenum
->
color_offsets
)
glyphenum
->
color_offsets
[
index
]
=
glyphenum
->
offsets
[
g
];
opentype_colr_next_glyph
(
glyphenum
->
colr
.
data
,
glyphenum
->
glyphs
+
g
);
opentype_colr_next_glyph
(
glyphenum
->
colr
.
data
,
glyphenum
->
glyphs
+
g
);
if
(
index
)
if
(
index
)
glyphenum
->
color_advances
[
index
-
1
]
+=
advance_adj
;
glyphenum
->
color_advances
[
index
-
1
]
+=
advance_adj
;
...
@@ -4846,10 +4855,15 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
...
@@ -4846,10 +4855,15 @@ HRESULT create_colorglyphenum(FLOAT originX, FLOAT originY, const DWRITE_GLYPH_R
colorglyphenum
->
advances
=
heap_alloc
(
run
->
glyphCount
*
sizeof
(
FLOAT
));
colorglyphenum
->
advances
=
heap_alloc
(
run
->
glyphCount
*
sizeof
(
FLOAT
));
colorglyphenum
->
color_advances
=
heap_alloc
(
run
->
glyphCount
*
sizeof
(
FLOAT
));
colorglyphenum
->
color_advances
=
heap_alloc
(
run
->
glyphCount
*
sizeof
(
FLOAT
));
colorglyphenum
->
glyphindices
=
heap_alloc
(
run
->
glyphCount
*
sizeof
(
UINT16
));
colorglyphenum
->
glyphindices
=
heap_alloc
(
run
->
glyphCount
*
sizeof
(
UINT16
));
if
(
run
->
glyphOffsets
)
{
colorglyphenum
->
offsets
=
heap_alloc
(
run
->
glyphCount
*
sizeof
(
*
colorglyphenum
->
offsets
));
colorglyphenum
->
color_offsets
=
heap_alloc
(
run
->
glyphCount
*
sizeof
(
*
colorglyphenum
->
color_offsets
));
memcpy
(
colorglyphenum
->
offsets
,
run
->
glyphOffsets
,
run
->
glyphCount
*
sizeof
(
*
run
->
glyphOffsets
));
}
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
=
NULL
;
/* FIXME */
colorglyphenum
->
colorrun
.
glyphRun
.
glyphOffsets
=
colorglyphenum
->
color_offsets
;
colorglyphenum
->
colorrun
.
glyphRunDescription
=
NULL
;
/* FIXME */
colorglyphenum
->
colorrun
.
glyphRunDescription
=
NULL
;
/* FIXME */
if
(
run
->
glyphAdvances
)
if
(
run
->
glyphAdvances
)
...
...
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