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
8a52d3e7
Commit
8a52d3e7
authored
Jun 08, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Implement contextual positional lookups.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
102272a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
30 deletions
+22
-30
opentype.c
dlls/dwrite/opentype.c
+22
-30
No files found.
dlls/dwrite/opentype.c
View file @
8a52d3e7
...
...
@@ -610,7 +610,7 @@ struct ot_gsub_lig
UINT16
components
[
1
];
};
struct
ot_gsub
_context_subs
t_format1
struct
ot_gsub
gpos_contex
t_format1
{
UINT16
format
;
UINT16
coverage
;
...
...
@@ -618,7 +618,7 @@ struct ot_gsub_context_subst_format1
UINT16
rulesets
[
1
];
};
struct
ot_gsub_ruleset
struct
ot_gsub
gpos
_ruleset
{
UINT16
count
;
UINT16
offsets
[
1
];
...
...
@@ -4197,18 +4197,6 @@ static BOOL opentype_layout_apply_gpos_mark_to_mark_attachment(struct scriptshap
return
TRUE
;
}
static
BOOL
opentype_layout_apply_gpos_contextual_positioning
(
const
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
,
unsigned
int
subtable_offset
)
{
return
FALSE
;
}
static
BOOL
opentype_layout_apply_gpos_chaining_contextual_positioning
(
const
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
,
unsigned
int
subtable_offset
)
{
return
FALSE
;
}
static
unsigned
int
opentype_layout_adjust_extension_subtable
(
struct
scriptshaping_context
*
context
,
unsigned
int
*
subtable_offset
)
{
...
...
@@ -4228,6 +4216,11 @@ static unsigned int opentype_layout_adjust_extension_subtable(struct scriptshapi
return
GET_BE_WORD
(
format1
->
lookup_type
);
}
static
BOOL
opentype_layout_apply_context
(
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
,
unsigned
int
subtable_offset
);
static
BOOL
opentype_layout_apply_chain_context
(
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
,
unsigned
int
subtable_offset
);
static
BOOL
opentype_layout_apply_gpos_lookup
(
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
)
{
unsigned
int
i
,
lookup_type
;
...
...
@@ -4267,10 +4260,10 @@ static BOOL opentype_layout_apply_gpos_lookup(struct scriptshaping_context *cont
ret
=
opentype_layout_apply_gpos_mark_to_mark_attachment
(
context
,
lookup
,
subtable_offset
);
break
;
case
GPOS_LOOKUP_CONTEXTUAL_POSITION
:
ret
=
opentype_layout_apply_
gpos_contextual_positioning
(
context
,
lookup
,
subtable_offset
);
ret
=
opentype_layout_apply_
context
(
context
,
lookup
,
subtable_offset
);
break
;
case
GPOS_LOOKUP_CONTEXTUAL_CHAINING_POSITION
:
ret
=
opentype_layout_apply_
gpos_chaining_contextual_positioning
(
context
,
lookup
,
subtable_offset
);
ret
=
opentype_layout_apply_
chain_context
(
context
,
lookup
,
subtable_offset
);
break
;
case
GPOS_LOOKUP_EXTENSION_POSITION
:
WARN
(
"Recursive extension lookup.
\n
"
);
...
...
@@ -5165,7 +5158,7 @@ static BOOL opentype_layout_apply_chain_rule_set(const struct match_context *mc,
unsigned
int
backtrack_count
,
input_count
,
lookahead_count
,
lookup_count
;
const
struct
dwrite_fonttable
*
table
=
&
mc
->
context
->
table
->
table
;
const
UINT16
*
backtrack
,
*
lookahead
,
*
input
,
*
lookup_records
;
const
struct
ot_gsub_ruleset
*
ruleset
;
const
struct
ot_gsub
gpos
_ruleset
*
ruleset
;
unsigned
int
i
,
count
;
count
=
table_read_be_word
(
table
,
offset
);
...
...
@@ -5223,7 +5216,7 @@ static BOOL opentype_layout_apply_rule_set(const struct match_context *mc, unsig
unsigned
int
input_count
,
lookup_count
;
const
struct
dwrite_fonttable
*
table
=
&
mc
->
context
->
table
->
table
;
const
UINT16
*
input
,
*
lookup_records
;
const
struct
ot_gsub_ruleset
*
ruleset
;
const
struct
ot_gsub
gpos
_ruleset
*
ruleset
;
unsigned
int
i
,
count
;
count
=
table_read_be_word
(
table
,
offset
);
...
...
@@ -5256,7 +5249,7 @@ static BOOL opentype_layout_apply_rule_set(const struct match_context *mc, unsig
return
FALSE
;
}
static
BOOL
opentype_layout_apply_
gsub_context_substitution
(
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
,
static
BOOL
opentype_layout_apply_
context
(
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
,
unsigned
int
subtable_offset
)
{
struct
match_context
mc
=
{
.
context
=
context
,
.
lookup
=
lookup
};
...
...
@@ -5271,18 +5264,17 @@ static BOOL opentype_layout_apply_gsub_context_substitution(struct scriptshaping
if
(
format
==
1
)
{
coverage
=
table_read_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub
_context_subs
t_format1
,
coverage
));
coverage
=
table_read_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub
gpos_contex
t_format1
,
coverage
));
coverage_index
=
opentype_layout_is_glyph_covered
(
table
,
subtable_offset
+
coverage
,
glyph
);
if
(
coverage_index
==
GLYPH_NOT_COVERED
)
return
FALSE
;
count
=
table_read_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub_context_subst_format1
,
ruleset_count
));
count
=
table_read_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsubgpos_context_format1
,
ruleset_count
));
if
(
coverage_index
>=
count
)
return
FALSE
;
offset
=
table_read_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub
_context_subs
t_format1
,
offset
=
table_read_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub
gpos_contex
t_format1
,
rulesets
[
coverage_index
]));
offset
+=
subtable_offset
;
...
...
@@ -5358,8 +5350,8 @@ static BOOL opentype_layout_apply_gsub_context_substitution(struct scriptshaping
return
ret
;
}
static
BOOL
opentype_layout_apply_
gsub_chain_context_substitution
(
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
,
unsigned
int
subtable_offset
)
static
BOOL
opentype_layout_apply_
chain_context
(
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
,
unsigned
int
subtable_offset
)
{
struct
match_context
mc
=
{
.
context
=
context
,
.
lookup
=
lookup
};
const
struct
dwrite_fonttable
*
table
=
&
context
->
table
->
table
;
...
...
@@ -5373,17 +5365,17 @@ static BOOL opentype_layout_apply_gsub_chain_context_substitution(struct scripts
if
(
format
==
1
)
{
coverage
=
table_read_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub
_context_subs
t_format1
,
coverage
));
coverage
=
table_read_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub
gpos_contex
t_format1
,
coverage
));
coverage_index
=
opentype_layout_is_glyph_covered
(
table
,
subtable_offset
+
coverage
,
glyph
);
if
(
coverage_index
==
GLYPH_NOT_COVERED
)
return
FALSE
;
count
=
table_read_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub
_context_subs
t_format1
,
ruleset_count
));
count
=
table_read_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub
gpos_contex
t_format1
,
ruleset_count
));
if
(
coverage_index
>=
count
)
return
FALSE
;
offset
=
table_read_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub
_context_subs
t_format1
,
offset
=
table_read_be_word
(
table
,
subtable_offset
+
FIELD_OFFSET
(
struct
ot_gsub
gpos_contex
t_format1
,
rulesets
[
coverage_index
]));
offset
+=
subtable_offset
;
...
...
@@ -5571,10 +5563,10 @@ static BOOL opentype_layout_apply_gsub_lookup(struct scriptshaping_context *cont
ret
=
opentype_layout_apply_gsub_lig_substitution
(
context
,
lookup
,
subtable_offset
);
break
;
case
GSUB_LOOKUP_CONTEXTUAL_SUBST
:
ret
=
opentype_layout_apply_
gsub_context_substitution
(
context
,
lookup
,
subtable_offset
);
ret
=
opentype_layout_apply_
context
(
context
,
lookup
,
subtable_offset
);
break
;
case
GSUB_LOOKUP_CHAINING_CONTEXTUAL_SUBST
:
ret
=
opentype_layout_apply_
gsub_chain_context_substitution
(
context
,
lookup
,
subtable_offset
);
ret
=
opentype_layout_apply_
chain_context
(
context
,
lookup
,
subtable_offset
);
break
;
case
GSUB_LOOKUP_REVERSE_CHAINING_CONTEXTUAL_SUBST
:
ret
=
opentype_layout_apply_gsub_reverse_chain_context_substitution
(
context
,
lookup
,
subtable_offset
);
...
...
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