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
297b3d08
Commit
297b3d08
authored
Feb 16, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 16, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Force advances to zero for isZeroWidthSpace glyphs.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fd8ecd0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
6 deletions
+48
-6
analyzer.c
dlls/dwrite/analyzer.c
+9
-6
analyzer.c
dlls/dwrite/tests/analyzer.c
+39
-0
No files found.
dlls/dwrite/analyzer.c
View file @
297b3d08
...
...
@@ -1089,13 +1089,16 @@ static HRESULT WINAPI dwritetextanalyzer_GetGlyphPlacements(IDWriteTextAnalyzer2
IDWriteFontFace_GetMetrics
(
fontface
,
&
metrics
);
for
(
i
=
0
;
i
<
glyph_count
;
i
++
)
{
INT32
a
;
hr
=
IDWriteFontFace1_GetDesignGlyphAdvances
(
fontface1
,
1
,
&
glyphs
[
i
],
&
a
,
is_sideways
);
if
(
FAILED
(
hr
))
a
=
0
;
if
(
glyph_props
[
i
].
isZeroWidthSpace
)
advances
[
i
]
=
0
.
0
f
;
else
{
INT32
a
;
advances
[
i
]
=
get_scaled_advance_width
(
a
,
emSize
,
&
metrics
);
hr
=
IDWriteFontFace1_GetDesignGlyphAdvances
(
fontface1
,
1
,
&
glyphs
[
i
],
&
a
,
is_sideways
);
if
(
FAILED
(
hr
))
a
=
0
;
advances
[
i
]
=
get_scaled_advance_width
(
a
,
emSize
,
&
metrics
);
}
offsets
[
i
].
advanceOffset
=
0
.
0
f
;
offsets
[
i
].
ascenderOffset
=
0
.
0
f
;
}
...
...
dlls/dwrite/tests/analyzer.c
View file @
297b3d08
...
...
@@ -1393,6 +1393,18 @@ if (0) {
ok
(
advances
[
0
]
==
advances2
[
0
],
"got %.2f, expected %.2f
\n
"
,
advances
[
0
],
advances2
[
0
]);
ok
(
advances
[
1
]
==
advances2
[
1
],
"got %.2f, expected %.2f
\n
"
,
advances
[
1
],
advances2
[
1
]);
/* DWRITE_SCRIPT_SHAPES_NO_VISUAL run */
maxglyphcount
=
10
;
actual_count
=
0
;
sa
.
script
=
0
;
sa
.
shapes
=
DWRITE_SCRIPT_SHAPES_NO_VISUAL
;
hr
=
IDWriteTextAnalyzer_GetGlyphs
(
analyzer
,
test1W
,
lstrlenW
(
test1W
),
fontface
,
FALSE
,
FALSE
,
&
sa
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
maxglyphcount
,
clustermap
,
props
,
glyphs1
,
shapingprops
,
&
actual_count
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
actual_count
==
4
,
"got %d
\n
"
,
actual_count
);
ok
(
sa
.
script
==
0
,
"got %u
\n
"
,
sa
.
script
);
ok
(
!
shapingprops
[
0
].
isZeroWidthSpace
,
"got %d
\n
"
,
shapingprops
[
0
].
isZeroWidthSpace
);
IDWriteTextAnalyzer_Release
(
analyzer
);
IDWriteFontFace_Release
(
fontface
);
}
...
...
@@ -1582,6 +1594,33 @@ static void test_GetGlyphPlacements(void)
ok
(
offsets
[
0
].
advanceOffset
==
0
.
0
&&
offsets
[
0
].
ascenderOffset
==
0
.
0
,
"got %.2f,%.2f
\n
"
,
offsets
[
0
].
advanceOffset
,
offsets
[
0
].
ascenderOffset
);
/* DWRITE_SCRIPT_SHAPES_NO_VISUAL has no effect on placement */
sa
.
shapes
=
DWRITE_SCRIPT_SHAPES_NO_VISUAL
;
advances
[
0
]
=
advances
[
1
]
=
1
.
0
f
;
memset
(
offsets
,
0xcc
,
sizeof
(
offsets
));
hr
=
IDWriteTextAnalyzer_GetGlyphPlacements
(
analyzer
,
aW
,
clustermap
,
textprops
,
len
,
glyphs
,
glyphprops
,
len
,
fontface
,
2048
.
0
f
,
FALSE
,
FALSE
,
&
sa
,
NULL
,
NULL
,
NULL
,
0
,
advances
,
offsets
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
advances
[
0
]
==
1000
.
0
f
,
"got %.2f
\n
"
,
advances
[
0
]);
ok
(
advances
[
1
]
==
1000
.
0
f
,
"got %.2f
\n
"
,
advances
[
1
]);
ok
(
offsets
[
0
].
advanceOffset
==
0
.
0
f
&&
offsets
[
0
].
ascenderOffset
==
0
.
0
f
,
"got %.2f,%.2f
\n
"
,
offsets
[
0
].
advanceOffset
,
offsets
[
0
].
ascenderOffset
);
/* isZeroWidthSpace */
sa
.
shapes
=
DWRITE_SCRIPT_SHAPES_DEFAULT
;
advances
[
0
]
=
advances
[
1
]
=
1
.
0
f
;
memset
(
offsets
,
0xcc
,
sizeof
(
offsets
));
glyphprops
[
0
].
isZeroWidthSpace
=
1
;
hr
=
IDWriteTextAnalyzer_GetGlyphPlacements
(
analyzer
,
aW
,
clustermap
,
textprops
,
len
,
glyphs
,
glyphprops
,
len
,
fontface
,
2048
.
0
f
,
FALSE
,
FALSE
,
&
sa
,
NULL
,
NULL
,
NULL
,
0
,
advances
,
offsets
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
advances
[
0
]
==
0
.
0
f
,
"got %.2f
\n
"
,
advances
[
0
]);
ok
(
advances
[
1
]
==
1000
.
0
f
,
"got %.2f
\n
"
,
advances
[
1
]);
ok
(
offsets
[
0
].
advanceOffset
==
0
.
0
f
&&
offsets
[
0
].
ascenderOffset
==
0
.
0
f
,
"got %.2f,%.2f
\n
"
,
offsets
[
0
].
advanceOffset
,
offsets
[
0
].
ascenderOffset
);
IDWriteTextAnalyzer_Release
(
analyzer
);
IDWriteFontFace_Release
(
fontface
);
DELETE_FONTFILE
(
path
);
...
...
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