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
808152b7
Commit
808152b7
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: Fix positions in outline mode.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5a0de62c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
28 deletions
+38
-28
dwrite_private.h
dlls/dwrite/dwrite_private.h
+3
-2
freetype.c
dlls/dwrite/freetype.c
+35
-26
No files found.
dlls/dwrite/dwrite_private.h
View file @
808152b7
...
@@ -320,8 +320,9 @@ extern void release_freetype(void) DECLSPEC_HIDDEN;
...
@@ -320,8 +320,9 @@ extern void release_freetype(void) DECLSPEC_HIDDEN;
extern
HRESULT
freetype_get_design_glyph_metrics
(
IDWriteFontFace4
*
,
UINT16
,
UINT16
,
DWRITE_GLYPH_METRICS
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
freetype_get_design_glyph_metrics
(
IDWriteFontFace4
*
,
UINT16
,
UINT16
,
DWRITE_GLYPH_METRICS
*
)
DECLSPEC_HIDDEN
;
extern
void
freetype_notify_cacheremove
(
IDWriteFontFace4
*
)
DECLSPEC_HIDDEN
;
extern
void
freetype_notify_cacheremove
(
IDWriteFontFace4
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
freetype_is_monospaced
(
IDWriteFontFace4
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
freetype_is_monospaced
(
IDWriteFontFace4
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
freetype_get_glyphrun_outline
(
IDWriteFontFace4
*
,
FLOAT
,
UINT16
const
*
,
FLOAT
const
*
,
DWRITE_GLYPH_OFFSET
const
*
,
extern
HRESULT
freetype_get_glyphrun_outline
(
IDWriteFontFace4
*
fontface
,
float
emsize
,
UINT16
const
*
glyphs
,
UINT32
,
BOOL
,
IDWriteGeometrySink
*
)
DECLSPEC_HIDDEN
;
float
const
*
advances
,
DWRITE_GLYPH_OFFSET
const
*
offsets
,
unsigned
int
count
,
BOOL
is_rtl
,
IDWriteGeometrySink
*
sink
)
DECLSPEC_HIDDEN
;
extern
UINT16
freetype_get_glyphcount
(
IDWriteFontFace4
*
)
DECLSPEC_HIDDEN
;
extern
UINT16
freetype_get_glyphcount
(
IDWriteFontFace4
*
)
DECLSPEC_HIDDEN
;
extern
void
freetype_get_glyphs
(
IDWriteFontFace4
*
,
INT
,
UINT32
const
*
,
UINT32
,
UINT16
*
)
DECLSPEC_HIDDEN
;
extern
void
freetype_get_glyphs
(
IDWriteFontFace4
*
,
INT
,
UINT32
const
*
,
UINT32
,
UINT16
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
freetype_has_kerning_pairs
(
IDWriteFontFace4
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
freetype_has_kerning_pairs
(
IDWriteFontFace4
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/dwrite/freetype.c
View file @
808152b7
...
@@ -438,7 +438,7 @@ static int decompose_cubic_to(const FT_Vector *control1, const FT_Vector *contro
...
@@ -438,7 +438,7 @@ static int decompose_cubic_to(const FT_Vector *control1, const FT_Vector *contro
return
0
;
return
0
;
}
}
static
void
decompose_outline
(
FT_Outline
*
outline
,
FLOAT
xoffset
,
FLOAT
y
offset
,
IDWriteGeometrySink
*
sink
)
static
void
decompose_outline
(
FT_Outline
*
outline
,
D2D1_POINT_2F
offset
,
IDWriteGeometrySink
*
sink
)
{
{
static
const
FT_Outline_Funcs
decompose_funcs
=
{
static
const
FT_Outline_Funcs
decompose_funcs
=
{
decompose_move_to
,
decompose_move_to
,
...
@@ -451,8 +451,8 @@ static void decompose_outline(FT_Outline *outline, FLOAT xoffset, FLOAT yoffset,
...
@@ -451,8 +451,8 @@ static void decompose_outline(FT_Outline *outline, FLOAT xoffset, FLOAT yoffset,
struct
decompose_context
context
;
struct
decompose_context
context
;
context
.
sink
=
sink
;
context
.
sink
=
sink
;
context
.
xoffset
=
xoffset
;
context
.
xoffset
=
offset
.
x
;
context
.
yoffset
=
yoffset
;
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
;
...
@@ -485,8 +485,9 @@ static void embolden_glyph(FT_Glyph glyph, FLOAT emsize)
...
@@ -485,8 +485,9 @@ static void embolden_glyph(FT_Glyph glyph, FLOAT emsize)
embolden_glyph_outline
(
&
outline_glyph
->
outline
,
emsize
);
embolden_glyph_outline
(
&
outline_glyph
->
outline
,
emsize
);
}
}
HRESULT
freetype_get_glyphrun_outline
(
IDWriteFontFace4
*
fontface
,
FLOAT
emSize
,
UINT16
const
*
glyphs
,
HRESULT
freetype_get_glyphrun_outline
(
IDWriteFontFace4
*
fontface
,
float
emSize
,
UINT16
const
*
glyphs
,
FLOAT
const
*
advances
,
DWRITE_GLYPH_OFFSET
const
*
offsets
,
UINT32
count
,
BOOL
is_rtl
,
IDWriteGeometrySink
*
sink
)
float
const
*
advances
,
DWRITE_GLYPH_OFFSET
const
*
offsets
,
unsigned
int
count
,
BOOL
is_rtl
,
IDWriteGeometrySink
*
sink
)
{
{
FTC_ScalerRec
scaler
;
FTC_ScalerRec
scaler
;
USHORT
simulations
;
USHORT
simulations
;
...
@@ -509,14 +510,19 @@ HRESULT freetype_get_glyphrun_outline(IDWriteFontFace4 *fontface, FLOAT emSize,
...
@@ -509,14 +510,19 @@ HRESULT freetype_get_glyphrun_outline(IDWriteFontFace4 *fontface, FLOAT emSize,
EnterCriticalSection
(
&
freetype_cs
);
EnterCriticalSection
(
&
freetype_cs
);
if
(
pFTC_Manager_LookupSize
(
cache_manager
,
&
scaler
,
&
size
)
==
0
)
{
if
(
pFTC_Manager_LookupSize
(
cache_manager
,
&
scaler
,
&
size
)
==
0
)
{
FLOAT
advance
=
0
.
0
f
;
float
rtl_factor
=
is_rtl
?
-
1
.
0
f
:
1
.
0
f
;
UINT32
g
;
D2D1_POINT_2F
origin
;
unsigned
int
i
;
for
(
g
=
0
;
g
<
count
;
g
++
)
{
if
(
pFT_Load_Glyph
(
size
->
face
,
glyphs
[
g
],
FT_LOAD_NO_BITMAP
)
==
0
)
{
origin
.
x
=
origin
.
y
=
0
.
0
f
;
for
(
i
=
0
;
i
<
count
;
++
i
)
{
if
(
pFT_Load_Glyph
(
size
->
face
,
glyphs
[
i
],
FT_LOAD_NO_BITMAP
)
==
0
)
{
FLOAT
ft_advance
=
size
->
face
->
glyph
->
metrics
.
horiAdvance
>>
6
;
FLOAT
ft_advance
=
size
->
face
->
glyph
->
metrics
.
horiAdvance
>>
6
;
FT_Outline
*
outline
=
&
size
->
face
->
glyph
->
outline
;
FT_Outline
*
outline
=
&
size
->
face
->
glyph
->
outline
;
FLOAT
xoffset
=
0
.
0
f
,
yoffset
=
0
.
0
f
;
D2D1_POINT_2F
glyph_origin
;
float
advance
;
FT_Matrix
m
;
FT_Matrix
m
;
if
(
simulations
&
DWRITE_FONT_SIMULATIONS_BOLD
)
if
(
simulations
&
DWRITE_FONT_SIMULATIONS_BOLD
)
...
@@ -529,23 +535,25 @@ HRESULT freetype_get_glyphrun_outline(IDWriteFontFace4 *fontface, FLOAT emSize,
...
@@ -529,23 +535,25 @@ HRESULT freetype_get_glyphrun_outline(IDWriteFontFace4 *fontface, FLOAT emSize,
pFT_Outline_Transform
(
outline
,
&
m
);
pFT_Outline_Transform
(
outline
,
&
m
);
if
(
advances
)
advance
=
rtl_factor
*
advances
[
i
];
else
advance
=
rtl_factor
*
ft_advance
;
glyph_origin
=
origin
;
if
(
is_rtl
)
glyph_origin
.
x
+=
advance
;
/* glyph offsets act as current glyph adjustment */
/* glyph offsets act as current glyph adjustment */
if
(
offsets
)
{
if
(
offsets
)
xoffset
+=
is_rtl
?
-
offsets
[
g
].
advanceOffset
:
offsets
[
g
].
advanceOffset
;
{
yoffset
-=
offsets
[
g
].
ascenderOffset
;
glyph_origin
.
x
+=
rtl_factor
*
offsets
[
i
].
advanceOffset
;
glyph_origin
.
y
-=
offsets
[
i
].
ascenderOffset
;
}
}
if
(
g
==
0
&&
is_rtl
)
decompose_outline
(
outline
,
glyph_origin
,
sink
);
advance
=
advances
?
-
advances
[
g
]
:
-
ft_advance
;
xoffset
+=
advance
;
decompose_outline
(
outline
,
xoffset
,
yoffset
,
sink
);
/* update advance to next glyph */
origin
.
x
+=
advance
;
if
(
advances
)
advance
+=
is_rtl
?
-
advances
[
g
]
:
advances
[
g
];
else
advance
+=
is_rtl
?
-
ft_advance
:
ft_advance
;
}
}
}
}
}
}
...
@@ -959,8 +967,9 @@ BOOL freetype_is_monospaced(IDWriteFontFace4 *fontface)
...
@@ -959,8 +967,9 @@ BOOL freetype_is_monospaced(IDWriteFontFace4 *fontface)
return
FALSE
;
return
FALSE
;
}
}
HRESULT
freetype_get_glyphrun_outline
(
IDWriteFontFace4
*
fontface
,
FLOAT
emSize
,
UINT16
const
*
glyphs
,
FLOAT
const
*
advances
,
HRESULT
freetype_get_glyphrun_outline
(
IDWriteFontFace4
*
fontface
,
float
emSize
,
UINT16
const
*
glyphs
,
DWRITE_GLYPH_OFFSET
const
*
offsets
,
UINT32
count
,
BOOL
is_rtl
,
IDWriteGeometrySink
*
sink
)
float
const
*
advances
,
DWRITE_GLYPH_OFFSET
const
*
offsets
,
unsigned
int
count
,
BOOL
is_rtl
,
IDWriteGeometrySink
*
sink
)
{
{
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
...
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