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
f5e342b2
Commit
f5e342b2
authored
Jun 17, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Simplify ligature substitution handler.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5909ab53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
24 deletions
+15
-24
opentype.c
dlls/dwrite/opentype.c
+15
-24
No files found.
dlls/dwrite/opentype.c
View file @
f5e342b2
...
...
@@ -5119,46 +5119,37 @@ static BOOL opentype_layout_apply_ligature(struct scriptshaping_context *context
static
BOOL
opentype_layout_apply_gsub_lig_substitution
(
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
,
unsigned
int
subtable_offset
)
{
const
struct
dwrite_fonttable
*
gsub
=
&
context
->
table
->
table
;
unsigned
int
coverage_index
,
offset
,
lig_set_offset
,
lig_set_coun
t
;
UINT16
format
,
coverage
,
glyph
;
const
struct
dwrite_fonttable
*
table
=
&
context
->
table
->
table
;
UINT16
format
,
coverage
,
glyph
,
lig_set_offse
t
;
unsigned
int
coverage_index
;
glyph
=
context
->
u
.
subst
.
glyphs
[
context
->
cur
];
format
=
table_read_be_word
(
gsub
,
subtable_offset
);
format
=
table_read_be_word
(
table
,
subtable_offset
);
if
(
format
==
1
)
{
const
struct
ot_gsub_ligsubst_format1
*
format1
=
table_read_ensure
(
gsub
,
subtable_offset
,
sizeof
(
*
format1
));
const
struct
ot_gsub_ligset
*
lig_set
;
unsigned
int
i
,
lig_count
;
const
struct
ot_gsub_ligsubst_format1
*
format1
=
table_read_ensure
(
table
,
subtable_offset
,
sizeof
(
*
format1
));
unsigned
int
i
;
const
UINT16
*
offsets
;
UINT16
lig_count
;
coverage
=
table_read_be_word
(
gsub
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub_ligsubst_format1
,
coverage
));
coverage
=
table_read_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub_ligsubst_format1
,
coverage
));
coverage_index
=
opentype_layout_is_glyph_covered
(
gsub
,
subtable_offset
+
coverage
,
glyph
);
if
(
coverage_index
==
GLYPH_NOT_COVERED
)
return
FALSE
;
coverage_index
=
opentype_layout_is_glyph_covered
(
table
,
subtable_offset
+
coverage
,
glyph
);
if
(
coverage_index
==
GLYPH_NOT_COVERED
)
return
FALSE
;
lig_set_count
=
table_read_be_word
(
gsub
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub_ligsubst_format1
,
lig_set_count
));
if
(
coverage_index
>=
lig_set_count
||
!
table_read_ensure
(
gsub
,
subtable_offset
,
FIELD_OFFSET
(
struct
ot_gsub_ligsubst_format1
,
lig_sets
[
lig_set_count
])))
{
if
(
!
table_read_array_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub_ligsubst_format1
,
lig_set_count
),
coverage_index
,
&
lig_set_offset
))
return
FALSE
;
}
lig_set_offset
=
table_read_be_word
(
gsub
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub_ligsubst_format1
,
lig_sets
[
coverage_index
]));
offset
=
subtable_offset
+
lig_set_offset
;
lig_count
=
table_read_be_word
(
gsub
,
offset
);
lig_set
=
table_read_ensure
(
gsub
,
offset
,
FIELD_OFFSET
(
struct
ot_gsub_ligset
,
offsets
[
lig_count
]));
if
(
!
lig_count
||
!
lig_set
)
if
(
!
(
offsets
=
table_read_array_be_word
(
table
,
subtable_offset
+
lig_set_offset
,
~
0u
,
&
lig_count
)))
return
FALSE
;
/* First applicable ligature is used. */
for
(
i
=
0
;
i
<
lig_count
;
++
i
)
{
if
(
opentype_layout_apply_ligature
(
context
,
offset
+
GET_BE_WORD
(
lig_set
->
offsets
[
i
]),
lookup
))
if
(
opentype_layout_apply_ligature
(
context
,
subtable_offset
+
lig_set_offset
+
GET_BE_WORD
(
offsets
[
i
]),
lookup
))
return
TRUE
;
}
}
...
...
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