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
5909ab53
Commit
5909ab53
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 alternate substitution handler.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
78ea46f6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
29 deletions
+19
-29
opentype.c
dlls/dwrite/opentype.c
+19
-29
No files found.
dlls/dwrite/opentype.c
View file @
5909ab53
...
@@ -4221,16 +4221,16 @@ static BOOL opentype_layout_apply_gpos_mark_to_base_attachment(struct scriptshap
...
@@ -4221,16 +4221,16 @@ static BOOL opentype_layout_apply_gpos_mark_to_base_attachment(struct scriptshap
return
TRUE
;
return
TRUE
;
}
}
static
BOOL
table_read_array_be_word
(
const
struct
dwrite_fonttable
*
table
,
unsigned
int
offset
,
static
const
UINT16
*
table_read_array_be_word
(
const
struct
dwrite_fonttable
*
table
,
unsigned
int
offset
,
unsigned
int
index
,
UINT16
*
data
)
unsigned
int
index
,
UINT16
*
data
)
{
{
unsigned
int
count
=
table_read_be_word
(
table
,
offset
);
unsigned
int
count
=
table_read_be_word
(
table
,
offset
);
const
UINT16
*
array
;
const
UINT16
*
array
;
if
(
index
>=
count
)
return
FALSE
;
if
(
index
!=
~
0u
&&
index
>=
count
)
return
NULL
;
if
(
!
(
array
=
table_read_ensure
(
table
,
offset
+
2
,
count
*
sizeof
(
*
array
))))
return
FALSE
;
if
(
!
(
array
=
table_read_ensure
(
table
,
offset
+
2
,
count
*
sizeof
(
*
array
))))
return
FALSE
;
*
data
=
GET_BE_WORD
(
array
[
index
]);
*
data
=
index
==
~
0u
?
count
:
GET_BE_WORD
(
array
[
index
]);
return
TRUE
;
return
array
;
}
}
static
BOOL
opentype_layout_apply_gpos_mark_to_lig_attachment
(
struct
scriptshaping_context
*
context
,
static
BOOL
opentype_layout_apply_gpos_mark_to_lig_attachment
(
struct
scriptshaping_context
*
context
,
...
@@ -4887,10 +4887,7 @@ static BOOL opentype_layout_apply_gsub_mult_substitution(struct scriptshaping_co
...
@@ -4887,10 +4887,7 @@ static BOOL opentype_layout_apply_gsub_mult_substitution(struct scriptshaping_co
return
FALSE
;
return
FALSE
;
}
}
glyph_count
=
table_read_be_word
(
table
,
subtable_offset
+
seq_offset
);
if
(
!
(
glyphs
=
table_read_array_be_word
(
table
,
subtable_offset
+
seq_offset
,
~
0u
,
&
glyph_count
)))
return
FALSE
;
if
(
!
(
glyphs
=
table_read_ensure
(
table
,
subtable_offset
+
seq_offset
+
2
,
glyph_count
*
sizeof
(
*
glyphs
))))
return
FALSE
;
if
(
glyph_count
==
1
)
if
(
glyph_count
==
1
)
{
{
...
@@ -4959,43 +4956,36 @@ static BOOL opentype_layout_apply_gsub_mult_substitution(struct scriptshaping_co
...
@@ -4959,43 +4956,36 @@ static BOOL opentype_layout_apply_gsub_mult_substitution(struct scriptshaping_co
static
BOOL
opentype_layout_apply_gsub_alt_substitution
(
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
,
static
BOOL
opentype_layout_apply_gsub_alt_substitution
(
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
,
unsigned
int
subtable_offset
)
unsigned
int
subtable_offset
)
{
{
const
struct
dwrite_fonttable
*
gsub
=
&
context
->
table
->
table
;
const
struct
dwrite_fonttable
*
table
=
&
context
->
table
->
table
;
unsigned
int
idx
,
coverage_index
,
offset
;
unsigned
int
idx
,
coverage_index
;
UINT16
format
,
coverage
,
glyph
;
UINT16
format
,
coverage
,
glyph
;
idx
=
context
->
cur
;
idx
=
context
->
cur
;
glyph
=
context
->
u
.
subst
.
glyphs
[
idx
];
glyph
=
context
->
u
.
subst
.
glyphs
[
idx
];
format
=
table_read_be_word
(
gsub
,
subtable_offset
);
format
=
table_read_be_word
(
table
,
subtable_offset
);
if
(
format
==
1
)
if
(
format
==
1
)
{
{
const
struct
ot_gsub_altsubst_format1
*
format1
=
table_read_ensure
(
gsub
,
subtable_offset
,
sizeof
(
*
format1
));
const
struct
ot_gsub_altsubst_format1
*
format1
=
table_read_ensure
(
table
,
subtable_offset
,
sizeof
(
*
format1
));
unsigned
int
count
,
shift
,
alt_index
;
unsigned
int
shift
,
alt_index
;
UINT16
set_offset
;
coverage
=
table_read_be_word
(
gsub
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub_altsubst_format1
,
coverage
));
coverage
=
table_read_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub_altsubst_format1
,
coverage
));
coverage_index
=
opentype_layout_is_glyph_covered
(
gsub
,
subtable_offset
+
coverage
,
glyph
);
coverage_index
=
opentype_layout_is_glyph_covered
(
table
,
subtable_offset
+
coverage
,
glyph
);
if
(
coverage_index
==
GLYPH_NOT_COVERED
)
if
(
coverage_index
==
GLYPH_NOT_COVERED
)
return
FALSE
;
return
FALSE
;
if
(
coverage_index
>=
GET_BE_WORD
(
format1
->
count
))
return
FALSE
;
offset
=
table_read_be_word
(
gsub
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub_altsubst_format1
,
sets
[
coverage_index
]));
count
=
table_read_be_word
(
gsub
,
subtable_offset
+
offset
);
if
(
!
table_read_array_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub_altsubst_format1
,
count
),
if
(
!
count
)
coverage_index
,
&
set_offset
)
)
return
FALSE
;
return
FALSE
;
/* Argument is 1-based. */
BitScanForward
(
&
shift
,
context
->
lookup_mask
);
BitScanForward
(
&
shift
,
context
->
lookup_mask
);
alt_index
=
(
context
->
lookup_mask
&
context
->
glyph_infos
[
idx
].
mask
)
>>
shift
;
alt_index
=
(
context
->
lookup_mask
&
context
->
glyph_infos
[
idx
].
mask
)
>>
shift
;
if
(
!
alt_index
)
return
FALSE
;
if
(
alt_index
>
count
||
!
alt_index
)
if
(
!
table_read_array_be_word
(
table
,
subtable_offset
+
set_offset
,
alt_index
-
1
,
&
glyph
))
return
FALSE
;
return
FALSE
;
glyph
=
table_read_be_word
(
gsub
,
subtable_offset
+
offset
+
2
+
(
alt_index
-
1
)
*
sizeof
(
glyph
));
}
}
else
else
{
{
...
...
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