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
188bfd6f
Commit
188bfd6f
authored
Nov 27, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Respect typographic metrics when font instructs us to.
parent
80218d19
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
opentype.c
dlls/dwrite/opentype.c
+29
-1
No files found.
dlls/dwrite/opentype.c
View file @
188bfd6f
...
...
@@ -185,6 +185,19 @@ typedef struct
}
TT_OS2_V2
;
#include "poppack.h"
enum
OS2_FSSELECTION
{
OS2_FSSELECTION_ITALIC
=
1
<<
0
,
OS2_FSSELECTION_UNDERSCORE
=
1
<<
1
,
OS2_FSSELECTION_NEGATIVE
=
1
<<
2
,
OS2_FSSELECTION_OUTLINED
=
1
<<
3
,
OS2_FSSELECTION_STRIKEOUT
=
1
<<
4
,
OS2_FSSELECTION_BOLD
=
1
<<
5
,
OS2_FSSELECTION_REGULAR
=
1
<<
6
,
OS2_FSSELECTION_USE_TYPO_METRICS
=
1
<<
7
,
OS2_FSSELECTION_WWS
=
1
<<
8
,
OS2_FSSELECTION_OBLIQUE
=
1
<<
9
};
typedef
struct
{
WORD
platformID
;
WORD
encodingID
;
...
...
@@ -875,8 +888,12 @@ void opentype_get_font_metrics(const void *os2, const void *head, const void *po
}
if
(
tt_os2
)
{
USHORT
version
=
GET_BE_WORD
(
tt_os2
->
version
);
metrics
->
ascent
=
GET_BE_WORD
(
tt_os2
->
usWinAscent
);
metrics
->
descent
=
GET_BE_WORD
(
tt_os2
->
usWinDescent
);
/* FIXME: sTypoLineGap should only be used when USE_TYPO_METRICS is set,
if not set this value is probably derived from other metrics */
metrics
->
lineGap
=
GET_BE_WORD
(
tt_os2
->
sTypoLineGap
);
metrics
->
strikethroughPosition
=
GET_BE_WORD
(
tt_os2
->
yStrikeoutPosition
);
metrics
->
strikethroughThickness
=
GET_BE_WORD
(
tt_os2
->
yStrikeoutSize
);
...
...
@@ -891,10 +908,21 @@ void opentype_get_font_metrics(const void *os2, const void *head, const void *po
metrics
->
superscriptSizeY
=
GET_BE_WORD
(
tt_os2
->
ySuperscriptYSize
);
/* version 2 fields */
if
(
tt_os2
->
version
>=
2
)
{
if
(
version
>=
2
)
{
metrics
->
capHeight
=
GET_BE_WORD
(
tt_os2
->
sCapHeight
);
metrics
->
xHeight
=
GET_BE_WORD
(
tt_os2
->
sxHeight
);
}
/* version 4 fields */
if
(
version
>=
4
)
{
if
(
GET_BE_WORD
(
tt_os2
->
fsSelection
)
&
OS2_FSSELECTION_USE_TYPO_METRICS
)
{
SHORT
descent
=
GET_BE_WORD
(
tt_os2
->
sTypoDescender
);
metrics
->
ascent
=
GET_BE_WORD
(
tt_os2
->
sTypoAscender
);
metrics
->
descent
=
descent
<
0
?
-
descent
:
0
;
metrics
->
lineGap
=
GET_BE_WORD
(
tt_os2
->
sTypoLineGap
);
metrics
->
hasTypographicMetrics
=
TRUE
;
}
}
}
if
(
tt_post
)
{
...
...
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