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
215ad4e9
Commit
215ad4e9
authored
Feb 08, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Store outline offset as a vector.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
808152b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
freetype.c
dlls/dwrite/freetype.c
+13
-15
No files found.
dlls/dwrite/freetype.c
View file @
215ad4e9
...
@@ -317,17 +317,16 @@ BOOL freetype_is_monospaced(IDWriteFontFace4 *fontface)
...
@@ -317,17 +317,16 @@ BOOL freetype_is_monospaced(IDWriteFontFace4 *fontface)
struct
decompose_context
{
struct
decompose_context
{
IDWriteGeometrySink
*
sink
;
IDWriteGeometrySink
*
sink
;
FLOAT
xoffset
;
D2D1_POINT_2F
offset
;
FLOAT
yoffset
;
BOOL
figure_started
;
BOOL
figure_started
;
BOOL
move_to
;
/* last call was 'move_to' */
BOOL
move_to
;
/* last call was 'move_to' */
FT_Vector
origin
;
/* 'pen' position from last call */
FT_Vector
origin
;
/* 'pen' position from last call */
};
};
static
inline
void
ft_vector_to_d2d_point
(
const
FT_Vector
*
v
,
FLOAT
xoffset
,
FLOAT
y
offset
,
D2D1_POINT_2F
*
p
)
static
inline
void
ft_vector_to_d2d_point
(
const
FT_Vector
*
v
,
D2D1_POINT_2F
offset
,
D2D1_POINT_2F
*
p
)
{
{
p
->
x
=
(
v
->
x
/
64
.
0
f
)
+
xoffset
;
p
->
x
=
(
v
->
x
/
64
.
0
f
)
+
offset
.
x
;
p
->
y
=
(
v
->
y
/
64
.
0
f
)
+
yoffset
;
p
->
y
=
(
v
->
y
/
64
.
0
f
)
+
offset
.
y
;
}
}
static
void
decompose_beginfigure
(
struct
decompose_context
*
ctxt
)
static
void
decompose_beginfigure
(
struct
decompose_context
*
ctxt
)
...
@@ -337,7 +336,7 @@ static void decompose_beginfigure(struct decompose_context *ctxt)
...
@@ -337,7 +336,7 @@ static void decompose_beginfigure(struct decompose_context *ctxt)
if
(
!
ctxt
->
move_to
)
if
(
!
ctxt
->
move_to
)
return
;
return
;
ft_vector_to_d2d_point
(
&
ctxt
->
origin
,
ctxt
->
xoffset
,
ctxt
->
y
offset
,
&
point
);
ft_vector_to_d2d_point
(
&
ctxt
->
origin
,
ctxt
->
offset
,
&
point
);
ID2D1SimplifiedGeometrySink_BeginFigure
(
ctxt
->
sink
,
point
,
D2D1_FIGURE_BEGIN_FILLED
);
ID2D1SimplifiedGeometrySink_BeginFigure
(
ctxt
->
sink
,
point
,
D2D1_FIGURE_BEGIN_FILLED
);
ctxt
->
figure_started
=
TRUE
;
ctxt
->
figure_started
=
TRUE
;
...
@@ -369,7 +368,7 @@ static int decompose_line_to(const FT_Vector *to, void *user)
...
@@ -369,7 +368,7 @@ static int decompose_line_to(const FT_Vector *to, void *user)
decompose_beginfigure
(
ctxt
);
decompose_beginfigure
(
ctxt
);
ft_vector_to_d2d_point
(
to
,
ctxt
->
xoffset
,
ctxt
->
y
offset
,
&
point
);
ft_vector_to_d2d_point
(
to
,
ctxt
->
offset
,
&
point
);
ID2D1SimplifiedGeometrySink_AddLines
(
ctxt
->
sink
,
&
point
,
1
);
ID2D1SimplifiedGeometrySink_AddLines
(
ctxt
->
sink
,
&
point
,
1
);
ctxt
->
origin
=
*
to
;
ctxt
->
origin
=
*
to
;
...
@@ -414,9 +413,9 @@ static int decompose_conic_to(const FT_Vector *control, const FT_Vector *to, voi
...
@@ -414,9 +413,9 @@ static int decompose_conic_to(const FT_Vector *control, const FT_Vector *to, voi
cubic
[
1
].
y
+=
(
to
->
y
+
1
)
/
3
;
cubic
[
1
].
y
+=
(
to
->
y
+
1
)
/
3
;
cubic
[
2
]
=
*
to
;
cubic
[
2
]
=
*
to
;
ft_vector_to_d2d_point
(
cubic
,
ctxt
->
xoffset
,
ctxt
->
y
offset
,
points
);
ft_vector_to_d2d_point
(
cubic
,
ctxt
->
offset
,
points
);
ft_vector_to_d2d_point
(
cubic
+
1
,
ctxt
->
xoffset
,
ctxt
->
y
offset
,
points
+
1
);
ft_vector_to_d2d_point
(
cubic
+
1
,
ctxt
->
offset
,
points
+
1
);
ft_vector_to_d2d_point
(
cubic
+
2
,
ctxt
->
xoffset
,
ctxt
->
y
offset
,
points
+
2
);
ft_vector_to_d2d_point
(
cubic
+
2
,
ctxt
->
offset
,
points
+
2
);
ID2D1SimplifiedGeometrySink_AddBeziers
(
ctxt
->
sink
,
(
D2D1_BEZIER_SEGMENT
*
)
points
,
1
);
ID2D1SimplifiedGeometrySink_AddBeziers
(
ctxt
->
sink
,
(
D2D1_BEZIER_SEGMENT
*
)
points
,
1
);
ctxt
->
origin
=
*
to
;
ctxt
->
origin
=
*
to
;
return
0
;
return
0
;
...
@@ -430,9 +429,9 @@ static int decompose_cubic_to(const FT_Vector *control1, const FT_Vector *contro
...
@@ -430,9 +429,9 @@ static int decompose_cubic_to(const FT_Vector *control1, const FT_Vector *contro
decompose_beginfigure
(
ctxt
);
decompose_beginfigure
(
ctxt
);
ft_vector_to_d2d_point
(
control1
,
ctxt
->
xoffset
,
ctxt
->
y
offset
,
points
);
ft_vector_to_d2d_point
(
control1
,
ctxt
->
offset
,
points
);
ft_vector_to_d2d_point
(
control2
,
ctxt
->
xoffset
,
ctxt
->
y
offset
,
points
+
1
);
ft_vector_to_d2d_point
(
control2
,
ctxt
->
offset
,
points
+
1
);
ft_vector_to_d2d_point
(
to
,
ctxt
->
xoffset
,
ctxt
->
y
offset
,
points
+
2
);
ft_vector_to_d2d_point
(
to
,
ctxt
->
offset
,
points
+
2
);
ID2D1SimplifiedGeometrySink_AddBeziers
(
ctxt
->
sink
,
(
D2D1_BEZIER_SEGMENT
*
)
points
,
1
);
ID2D1SimplifiedGeometrySink_AddBeziers
(
ctxt
->
sink
,
(
D2D1_BEZIER_SEGMENT
*
)
points
,
1
);
ctxt
->
origin
=
*
to
;
ctxt
->
origin
=
*
to
;
return
0
;
return
0
;
...
@@ -451,8 +450,7 @@ static void decompose_outline(FT_Outline *outline, D2D1_POINT_2F offset, IDWrite
...
@@ -451,8 +450,7 @@ static void decompose_outline(FT_Outline *outline, D2D1_POINT_2F offset, IDWrite
struct
decompose_context
context
;
struct
decompose_context
context
;
context
.
sink
=
sink
;
context
.
sink
=
sink
;
context
.
xoffset
=
offset
.
x
;
context
.
offset
=
offset
;
context
.
yoffset
=
offset
.
y
;
context
.
figure_started
=
FALSE
;
context
.
figure_started
=
FALSE
;
context
.
move_to
=
FALSE
;
context
.
move_to
=
FALSE
;
context
.
origin
.
x
=
0
;
context
.
origin
.
x
=
0
;
...
...
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