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
6e356742
Commit
6e356742
authored
Dec 20, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 20, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Improve strikethrough and underline thickness extraction logic.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6d0fa4ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
19 deletions
+6
-19
opentype.c
dlls/dwrite/opentype.c
+3
-10
font.c
dlls/dwrite/tests/font.c
+3
-9
No files found.
dlls/dwrite/opentype.c
View file @
6e356742
...
...
@@ -1243,17 +1243,10 @@ void opentype_get_font_metrics(struct file_stream_desc *stream_desc, DWRITE_FONT
metrics
->
underlineThickness
=
GET_BE_WORD
(
tt_post
->
underlineThickness
);
}
/* use any of thickness values if another one is zero, if both are zero use estimate */
if
(
metrics
->
strikethroughThickness
||
metrics
->
underlineThickness
)
{
if
(
!
metrics
->
strikethroughThickness
)
metrics
->
strikethroughThickness
=
metrics
->
underlineThickness
;
if
(
!
metrics
->
underlineThickness
)
metrics
->
underlineThickness
=
metrics
->
strikethroughThickness
;
}
else
{
metrics
->
strikethroughThickness
=
metrics
->
designUnitsPerEm
/
14
;
if
(
metrics
->
underlineThickness
==
0
)
metrics
->
underlineThickness
=
metrics
->
designUnitsPerEm
/
14
;
}
if
(
metrics
->
strikethroughThickness
==
0
)
metrics
->
strikethroughThickness
=
metrics
->
underlineThickness
;
/* estimate missing metrics */
if
(
metrics
->
xHeight
==
0
)
...
...
dlls/dwrite/tests/font.c
View file @
6e356742
...
...
@@ -1725,16 +1725,10 @@ static void get_expected_font_metrics(IDWriteFontFace *fontface, DWRITE_FONT_MET
metrics
->
underlineThickness
=
GET_BE_WORD
(
tt_post
->
underlineThickness
);
}
if
(
metrics
->
strikethroughThickness
||
metrics
->
underlineThickness
)
{
if
(
!
metrics
->
strikethroughThickness
)
metrics
->
strikethroughThickness
=
metrics
->
underlineThickness
;
if
(
!
metrics
->
underlineThickness
)
metrics
->
underlineThickness
=
metrics
->
strikethroughThickness
;
}
else
{
metrics
->
strikethroughThickness
=
metrics
->
designUnitsPerEm
/
14
;
if
(
metrics
->
underlineThickness
==
0
)
metrics
->
underlineThickness
=
metrics
->
designUnitsPerEm
/
14
;
}
if
(
metrics
->
strikethroughThickness
==
0
)
metrics
->
strikethroughThickness
=
metrics
->
underlineThickness
;
if
(
tt_os2
)
IDWriteFontFace_ReleaseFontTable
(
fontface
,
os2_context
);
...
...
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