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
cd8c1b28
Commit
cd8c1b28
authored
Aug 14, 2012
by
Aric Stewart
Committed by
Alexandre Julliard
Aug 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Correct rounding of negative offsets in GPOS.
parent
e2250ce6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
opentype.c
dlls/usp10/opentype.c
+13
-11
No files found.
dlls/usp10/opentype.c
View file @
cd8c1b28
...
...
@@ -43,6 +43,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(uniscribe);
#define GET_BE_DWORD(x) RtlUlongByteSwap(x)
#endif
#define round(x) (((x) < 0) ? (int)((x) - 0.5) : (int)((x) + 0.5))
/* These are all structures needed for the cmap format 12 table */
#define CMAP_TAG MS_MAKE_TAG('c', 'm', 'a', 'p')
...
...
@@ -1403,13 +1405,13 @@ static INT GPOS_apply_lookup(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, I
if
(
adjust
.
x
||
adjust
.
y
)
{
GPOS_convert_design_units_to_device
(
lpotm
,
lplogfont
,
adjust
.
x
,
adjust
.
y
,
&
devX
,
&
devY
);
pGoffset
[
glyph_index
].
du
+=
(
int
)(
devX
+
0
.
5
);
pGoffset
[
glyph_index
].
dv
+=
(
int
)(
devY
+
0
.
5
);
pGoffset
[
glyph_index
].
du
+=
round
(
devX
);
pGoffset
[
glyph_index
].
dv
+=
round
(
devY
);
}
if
(
advance
.
x
||
advance
.
y
)
{
GPOS_convert_design_units_to_device
(
lpotm
,
lplogfont
,
advance
.
x
,
advance
.
y
,
&
devX
,
&
devY
);
piAdvance
[
glyph_index
]
+=
(
int
)(
devX
+
0
.
5
);
piAdvance
[
glyph_index
]
+=
round
(
devX
);
if
(
advance
.
y
)
FIXME
(
"Unhandled adjustment to Y advancement
\n
"
);
}
...
...
@@ -1424,24 +1426,24 @@ static INT GPOS_apply_lookup(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, I
if
(
adjust
[
0
].
x
||
adjust
[
0
].
y
)
{
GPOS_convert_design_units_to_device
(
lpotm
,
lplogfont
,
adjust
[
0
].
x
,
adjust
[
0
].
y
,
&
devX
,
&
devY
);
pGoffset
[
glyph_index
].
du
+=
(
int
)(
devX
+
0
.
5
);
pGoffset
[
glyph_index
].
dv
+=
(
int
)(
devY
+
0
.
5
);
pGoffset
[
glyph_index
].
du
+=
round
(
devX
);
pGoffset
[
glyph_index
].
dv
+=
round
(
devY
);
}
if
(
advance
[
0
].
x
||
advance
[
0
].
y
)
{
GPOS_convert_design_units_to_device
(
lpotm
,
lplogfont
,
advance
[
0
].
x
,
advance
[
0
].
y
,
&
devX
,
&
devY
);
piAdvance
[
glyph_index
]
+=
(
int
)(
devX
+
0
.
5
);
piAdvance
[
glyph_index
]
+=
round
(
devX
);
}
if
(
adjust
[
1
].
x
||
adjust
[
1
].
y
)
{
GPOS_convert_design_units_to_device
(
lpotm
,
lplogfont
,
adjust
[
1
].
x
,
adjust
[
1
].
y
,
&
devX
,
&
devY
);
pGoffset
[
glyph_index
+
write_dir
].
du
+=
(
int
)(
devX
+
0
.
5
);
pGoffset
[
glyph_index
+
write_dir
].
dv
+=
(
int
)(
devY
+
0
.
5
);
pGoffset
[
glyph_index
+
write_dir
].
du
+=
round
(
devX
);
pGoffset
[
glyph_index
+
write_dir
].
dv
+=
round
(
devY
);
}
if
(
advance
[
1
].
x
||
advance
[
1
].
y
)
{
GPOS_convert_design_units_to_device
(
lpotm
,
lplogfont
,
advance
[
1
].
x
,
advance
[
1
].
y
,
&
devX
,
&
devY
);
piAdvance
[
glyph_index
+
write_dir
]
+=
(
int
)(
devX
+
0
.
5
);
piAdvance
[
glyph_index
+
write_dir
]
+=
round
(
devX
);
}
return
index
;
}
...
...
@@ -1453,8 +1455,8 @@ static INT GPOS_apply_lookup(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, I
if
(
desU
.
x
||
desU
.
y
)
{
GPOS_convert_design_units_to_device
(
lpotm
,
lplogfont
,
desU
.
x
,
desU
.
y
,
&
devX
,
&
devY
);
pGoffset
[
glyph_index
].
du
+=
(
(
int
)(
devX
+
0
.
5
)
-
piAdvance
[
glyph_index
-
1
]);
pGoffset
[
glyph_index
].
dv
+=
(
int
)(
devY
+
0
.
5
);
pGoffset
[
glyph_index
].
du
+=
(
round
(
devX
)
-
piAdvance
[
glyph_index
-
1
]);
pGoffset
[
glyph_index
].
dv
+=
round
(
devY
);
}
break
;
}
...
...
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