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
943fb2c0
Commit
943fb2c0
authored
Jan 14, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Scale strikethrough thickness and position with current font size.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
261563f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
layout.c
dlls/dwrite/layout.c
+6
-8
No files found.
dlls/dwrite/layout.c
View file @
943fb2c0
...
...
@@ -651,10 +651,7 @@ static void layout_set_cluster_metrics(struct dwrite_textlayout *layout, const s
}
}
static
inline
FLOAT
get_scaled_font_metric
(
UINT32
metric
,
FLOAT
emSize
,
const
DWRITE_FONT_METRICS
*
metrics
)
{
return
(
FLOAT
)
metric
*
emSize
/
(
FLOAT
)
metrics
->
designUnitsPerEm
;
}
#define SCALE_FONT_METRIC(metric, emSize, metrics) ((FLOAT)(metric) * (emSize) / (FLOAT)(metrics)->designUnitsPerEm)
static
HRESULT
layout_compute_runs
(
struct
dwrite_textlayout
*
layout
)
{
...
...
@@ -878,8 +875,8 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout)
else
IDWriteFontFace_GetMetrics
(
run
->
run
.
fontFace
,
&
fontmetrics
);
r
->
baseline
=
get_scaled_font_metric
(
fontmetrics
.
ascent
,
run
->
run
.
fontEmSize
,
&
fontmetrics
);
r
->
height
=
get_scaled_font_metric
(
fontmetrics
.
ascent
+
fontmetrics
.
descent
,
run
->
run
.
fontEmSize
,
&
fontmetrics
);
r
->
baseline
=
SCALE_FONT_METRIC
(
fontmetrics
.
ascent
,
run
->
run
.
fontEmSize
,
&
fontmetrics
);
r
->
height
=
SCALE_FONT_METRIC
(
fontmetrics
.
ascent
+
fontmetrics
.
descent
,
run
->
run
.
fontEmSize
,
&
fontmetrics
);
layout_set_cluster_metrics
(
layout
,
r
,
&
cluster
);
...
...
@@ -1135,8 +1132,9 @@ static HRESULT layout_add_effective_run(struct dwrite_textlayout *layout, const
IDWriteFontFace_GetMetrics
(
r
->
u
.
regular
.
run
.
fontFace
,
&
metrics
);
s
->
s
.
width
=
get_cluster_range_width
(
layout
,
first_cluster
,
first_cluster
+
cluster_count
);
s
->
s
.
thickness
=
metrics
.
strikethroughThickness
;
s
->
s
.
offset
=
metrics
.
strikethroughPosition
;
s
->
s
.
thickness
=
SCALE_FONT_METRIC
(
metrics
.
strikethroughThickness
,
r
->
u
.
regular
.
run
.
fontEmSize
,
&
metrics
);
/* Negative offset moves it above baseline as Y coordinate grows downward. */
s
->
s
.
offset
=
-
SCALE_FONT_METRIC
(
metrics
.
strikethroughPosition
,
r
->
u
.
regular
.
run
.
fontEmSize
,
&
metrics
);
s
->
s
.
readingDirection
=
layout
->
format
.
readingdir
;
s
->
s
.
flowDirection
=
layout
->
format
.
flow
;
s
->
s
.
localeName
=
r
->
u
.
regular
.
descr
.
localeName
;
...
...
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