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
240567a8
Commit
240567a8
authored
Dec 02, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/shaping: Merge extension subtables handling with existing helper.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
810a2f0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
60 deletions
+43
-60
opentype.c
dlls/dwrite/opentype.c
+43
-60
No files found.
dlls/dwrite/opentype.c
View file @
240567a8
...
...
@@ -3499,13 +3499,46 @@ static void opentype_layout_apply_gpos_value(struct scriptshaping_context *conte
}
}
struct
lookup
{
unsigned
short
index
;
unsigned
short
type
;
unsigned
short
flags
;
unsigned
short
subtable_count
;
unsigned
int
mask
;
unsigned
int
offset
;
};
static
unsigned
int
opentype_layout_get_gsubgpos_subtable
(
const
struct
scriptshaping_context
*
context
,
unsigned
int
lookup_offset
,
unsigned
int
subtabl
e
)
const
struct
lookup
*
lookup
,
unsigned
int
subtable
,
unsigned
int
*
lookup_typ
e
)
{
unsigned
int
subtable_offset
=
table_read_be_word
(
&
context
->
table
->
table
,
lookup
_
offset
+
unsigned
int
subtable_offset
=
table_read_be_word
(
&
context
->
table
->
table
,
lookup
->
offset
+
FIELD_OFFSET
(
struct
ot_lookup_table
,
subtable
[
subtable
]));
const
struct
ot_gsubgpos_extension_format1
*
format1
;
subtable_offset
+=
lookup
->
offset
;
if
((
context
->
table
==
&
context
->
cache
->
gsub
&&
lookup
->
type
!=
GSUB_LOOKUP_EXTENSION_SUBST
)
||
(
context
->
table
==
&
context
->
cache
->
gpos
&&
lookup
->
type
!=
GPOS_LOOKUP_EXTENSION_POSITION
))
{
*
lookup_type
=
lookup
->
type
;
return
subtable_offset
;
}
*
lookup_type
=
0
;
if
(
!
(
format1
=
table_read_ensure
(
&
context
->
table
->
table
,
subtable_offset
,
sizeof
(
*
format1
))))
return
0
;
if
(
GET_BE_WORD
(
format1
->
format
)
!=
1
)
{
WARN
(
"Unexpected extension table format %#x.
\n
"
,
format1
->
format
);
return
0
;
}
return
lookup_offset
+
subtable_offset
;
*
lookup_type
=
GET_BE_WORD
(
format1
->
lookup_type
);
return
subtable_offset
+
GET_BE_DWORD
(
format1
->
extension_offset
);
}
struct
ot_lookup
...
...
@@ -3715,17 +3748,6 @@ static BOOL glyph_iterator_prev(struct glyph_iterator *iter)
return
FALSE
;
}
struct
lookup
{
unsigned
short
index
;
unsigned
short
type
;
unsigned
short
flags
;
unsigned
short
subtable_count
;
unsigned
int
mask
;
unsigned
int
offset
;
};
static
BOOL
opentype_layout_apply_gpos_single_adjustment
(
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
,
unsigned
int
subtable_offset
)
{
...
...
@@ -4247,31 +4269,6 @@ static BOOL opentype_layout_apply_gpos_mark_to_mark_attachment(struct scriptshap
return
TRUE
;
}
static
unsigned
int
opentype_layout_adjust_extension_subtable
(
struct
scriptshaping_context
*
context
,
unsigned
int
*
subtable_offset
,
const
struct
lookup
*
lookup
)
{
const
struct
ot_gsubgpos_extension_format1
*
format1
;
if
((
context
->
table
==
&
context
->
cache
->
gsub
&&
lookup
->
type
!=
GSUB_LOOKUP_EXTENSION_SUBST
)
||
(
context
->
table
==
&
context
->
cache
->
gpos
&&
lookup
->
type
!=
GPOS_LOOKUP_EXTENSION_POSITION
))
{
return
lookup
->
type
;
}
if
(
!
(
format1
=
table_read_ensure
(
&
context
->
table
->
table
,
*
subtable_offset
,
sizeof
(
*
format1
))))
return
0
;
if
(
GET_BE_WORD
(
format1
->
format
)
!=
1
)
{
WARN
(
"Unexpected extension table format %#x.
\n
"
,
format1
->
format
);
return
0
;
}
*
subtable_offset
=
*
subtable_offset
+
GET_BE_DWORD
(
format1
->
extension_offset
);
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
,
...
...
@@ -4284,9 +4281,7 @@ static BOOL opentype_layout_apply_gpos_lookup(struct scriptshaping_context *cont
for
(
i
=
0
;
i
<
lookup
->
subtable_count
;
++
i
)
{
unsigned
int
subtable_offset
=
opentype_layout_get_gsubgpos_subtable
(
context
,
lookup
->
offset
,
i
);
lookup_type
=
opentype_layout_adjust_extension_subtable
(
context
,
&
subtable_offset
,
lookup
);
unsigned
int
subtable_offset
=
opentype_layout_get_gsubgpos_subtable
(
context
,
lookup
,
i
,
&
lookup_type
);
switch
(
lookup_type
)
{
...
...
@@ -5595,9 +5590,7 @@ static BOOL opentype_layout_apply_gsub_lookup(struct scriptshaping_context *cont
for
(
i
=
0
;
i
<
lookup
->
subtable_count
;
++
i
)
{
unsigned
int
subtable_offset
=
opentype_layout_get_gsubgpos_subtable
(
context
,
lookup
->
offset
,
i
);
lookup_type
=
opentype_layout_adjust_extension_subtable
(
context
,
&
subtable_offset
,
lookup
);
unsigned
int
subtable_offset
=
opentype_layout_get_gsubgpos_subtable
(
context
,
lookup
,
i
,
&
lookup_type
);
switch
(
lookup_type
)
{
...
...
@@ -5740,14 +5733,9 @@ static void opentype_get_nominal_glyphs(struct scriptshaping_context *context, c
static
BOOL
opentype_is_gsub_lookup_reversed
(
const
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
)
{
unsigned
int
subtable_offset
,
lookup_type
=
lookup
->
type
;
unsigned
int
lookup_
type
;
if
(
lookup
->
type
==
GSUB_LOOKUP_EXTENSION_SUBST
)
{
subtable_offset
=
opentype_layout_get_gsubgpos_subtable
(
context
,
lookup
->
offset
,
0
);
/* Assumes format 1. */
lookup_type
=
table_read_be_word
(
&
context
->
table
->
table
,
subtable_offset
+
2
);
}
opentype_layout_get_gsubgpos_subtable
(
context
,
lookup
,
0
,
&
lookup_type
);
return
lookup_type
==
GSUB_LOOKUP_REVERSE_CHAINING_CONTEXTUAL_SUBST
;
}
...
...
@@ -5914,9 +5902,7 @@ static BOOL opentype_layout_gsub_lookup_is_glyph_covered(struct scriptshaping_co
for
(
i
=
0
;
i
<
lookup
->
subtable_count
;
++
i
)
{
unsigned
int
subtable_offset
=
opentype_layout_get_gsubgpos_subtable
(
context
,
lookup
->
offset
,
i
);
lookup_type
=
opentype_layout_adjust_extension_subtable
(
context
,
&
subtable_offset
,
lookup
);
unsigned
int
subtable_offset
=
opentype_layout_get_gsubgpos_subtable
(
context
,
lookup
,
i
,
&
lookup_type
);
format
=
table_read_be_word
(
gsub
,
subtable_offset
);
...
...
@@ -5981,9 +5967,7 @@ static BOOL opentype_layout_gpos_lookup_is_glyph_covered(struct scriptshaping_co
for
(
i
=
0
;
i
<
lookup
->
subtable_count
;
++
i
)
{
unsigned
int
subtable_offset
=
opentype_layout_get_gsubgpos_subtable
(
context
,
lookup
->
offset
,
i
);
lookup_type
=
opentype_layout_adjust_extension_subtable
(
context
,
&
subtable_offset
,
lookup
);
unsigned
int
subtable_offset
=
opentype_layout_get_gsubgpos_subtable
(
context
,
lookup
,
i
,
&
lookup_type
);
format
=
table_read_be_word
(
gpos
,
subtable_offset
);
...
...
@@ -6104,8 +6088,7 @@ BOOL opentype_has_vertical_variants(struct dwrite_fontface *fontface)
for
(
j
=
0
;
j
<
lookup
->
subtable_count
&&
!
count
;
++
j
)
{
subtable_offset
=
opentype_layout_get_gsubgpos_subtable
(
&
context
,
lookup
->
offset
,
j
);
lookup_type
=
opentype_layout_adjust_extension_subtable
(
&
context
,
&
subtable_offset
,
lookup
);
subtable_offset
=
opentype_layout_get_gsubgpos_subtable
(
&
context
,
lookup
,
j
,
&
lookup_type
);
if
(
lookup_type
!=
GSUB_LOOKUP_SINGLE_SUBST
)
continue
;
...
...
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