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
dfb94e6f
Commit
dfb94e6f
authored
Jan 22, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Add per shaping stage functions.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3c0836bf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
12 deletions
+25
-12
dwrite_private.h
dlls/dwrite/dwrite_private.h
+16
-5
opentype.c
dlls/dwrite/opentype.c
+4
-3
shape.c
dlls/dwrite/shape.c
+2
-1
arabic.c
dlls/dwrite/shapers/arabic.c
+3
-3
No files found.
dlls/dwrite/dwrite_private.h
View file @
dfb94e6f
...
...
@@ -559,12 +559,23 @@ struct shaping_feature
unsigned
int
stage
;
};
#define MAX_SHAPING_STAGE 16
typedef
void
(
*
stage_func
)(
struct
scriptshaping_context
*
context
);
struct
shaping_stage
{
stage_func
func
;
unsigned
int
last_lookup
;
};
struct
shaping_features
{
struct
shaping_feature
*
features
;
size_t
count
;
size_t
capacity
;
unsigned
int
stage
;
struct
shaping_stage
stages
[
MAX_SHAPING_STAGE
];
};
struct
shaper
...
...
@@ -577,9 +588,9 @@ extern const struct shaper arabic_shaper DECLSPEC_HIDDEN;
extern
void
shape_enable_feature
(
struct
shaping_features
*
features
,
unsigned
int
tag
,
unsigned
int
flags
)
DECLSPEC_HIDDEN
;
extern
void
shape_add_feature_full
(
struct
shaping_features
*
features
,
unsigned
int
tag
,
unsigned
int
flags
,
unsigned
int
value
)
DECLSPEC_HIDDEN
;
extern
void
shape_start_next_stage
(
struct
shaping_features
*
features
)
DECLSPEC_HIDDEN
;
extern
void
shape_add_feature_full
(
struct
shaping_features
*
features
,
unsigned
int
tag
,
unsigned
int
flags
,
unsigned
int
value
)
DECLSPEC_HIDDEN
;
extern
void
shape_start_next_stage
(
struct
shaping_features
*
features
,
stage_func
func
)
DECLSPEC_HIDDEN
;
struct
scriptshaping_context
{
...
...
@@ -667,9 +678,9 @@ extern DWORD opentype_layout_find_script(const struct scriptshaping_cache *cache
extern
DWORD
opentype_layout_find_language
(
const
struct
scriptshaping_cache
*
cache
,
DWORD
kind
,
DWORD
tag
,
unsigned
int
script_index
,
unsigned
int
*
language_index
)
DECLSPEC_HIDDEN
;
extern
void
opentype_layout_apply_gsub_features
(
struct
scriptshaping_context
*
context
,
unsigned
int
script_index
,
unsigned
int
language_index
,
const
struct
shaping_features
*
features
)
DECLSPEC_HIDDEN
;
unsigned
int
language_index
,
struct
shaping_features
*
features
)
DECLSPEC_HIDDEN
;
extern
void
opentype_layout_apply_gpos_features
(
struct
scriptshaping_context
*
context
,
unsigned
int
script_index
,
unsigned
int
language_index
,
const
struct
shaping_features
*
features
)
DECLSPEC_HIDDEN
;
unsigned
int
language_index
,
struct
shaping_features
*
features
)
DECLSPEC_HIDDEN
;
extern
BOOL
opentype_layout_check_feature
(
struct
scriptshaping_context
*
context
,
unsigned
int
script_index
,
unsigned
int
language_index
,
struct
shaping_feature
*
feature
,
unsigned
int
glyph_count
,
const
UINT16
*
glyphs
,
UINT8
*
feature_applies
)
DECLSPEC_HIDDEN
;
...
...
dlls/dwrite/opentype.c
View file @
dfb94e6f
...
...
@@ -4442,7 +4442,7 @@ static void opentype_layout_add_lookups(const struct ot_feature_list *feature_li
}
static
void
opentype_layout_collect_lookups
(
struct
scriptshaping_context
*
context
,
unsigned
int
script_index
,
unsigned
int
language_index
,
const
struct
shaping_features
*
features
,
const
struct
ot_gsubgpos_table
*
table
,
unsigned
int
language_index
,
struct
shaping_features
*
features
,
const
struct
ot_gsubgpos_table
*
table
,
struct
lookups
*
lookups
)
{
unsigned
int
last_num_lookups
=
0
,
stage
,
script_feature_count
=
0
;
...
...
@@ -4607,6 +4607,7 @@ static void opentype_layout_collect_lookups(struct scriptshaping_context *contex
}
last_num_lookups
=
lookups
->
count
;
features
->
stages
[
stage
].
last_lookup
=
last_num_lookups
;
}
}
...
...
@@ -4688,7 +4689,7 @@ static void opentype_layout_apply_gpos_context_lookup(struct scriptshaping_conte
}
void
opentype_layout_apply_gpos_features
(
struct
scriptshaping_context
*
context
,
unsigned
int
script_index
,
unsigned
int
language_index
,
const
struct
shaping_features
*
features
)
unsigned
int
language_index
,
struct
shaping_features
*
features
)
{
struct
lookups
lookups
=
{
0
};
unsigned
int
i
;
...
...
@@ -5791,7 +5792,7 @@ static void opentype_layout_apply_gsub_context_lookup(struct scriptshaping_conte
}
void
opentype_layout_apply_gsub_features
(
struct
scriptshaping_context
*
context
,
unsigned
int
script_index
,
unsigned
int
language_index
,
const
struct
shaping_features
*
features
)
unsigned
int
language_index
,
struct
shaping_features
*
features
)
{
struct
lookups
lookups
=
{
0
};
unsigned
int
i
,
j
,
start_idx
;
...
...
dlls/dwrite/shape.c
View file @
dfb94e6f
...
...
@@ -142,8 +142,9 @@ void shape_enable_feature(struct shaping_features *features, unsigned int tag,
shape_add_feature_full
(
features
,
tag
,
FEATURE_GLOBAL
|
flags
,
1
);
}
void
shape_start_next_stage
(
struct
shaping_features
*
features
)
void
shape_start_next_stage
(
struct
shaping_features
*
features
,
stage_func
func
)
{
features
->
stages
[
features
->
stage
].
func
=
func
;
features
->
stage
++
;
}
...
...
dlls/dwrite/shapers/arabic.c
View file @
dfb94e6f
...
...
@@ -56,21 +56,21 @@ static void arabic_collect_features(struct scriptshaping_context *context,
shape_enable_feature
(
features
,
DWRITE_MAKE_OPENTYPE_TAG
(
'c'
,
'c'
,
'm'
,
'p'
),
0
);
shape_enable_feature
(
features
,
DWRITE_MAKE_OPENTYPE_TAG
(
'l'
,
'o'
,
'c'
,
'l'
),
0
);
shape_start_next_stage
(
features
);
shape_start_next_stage
(
features
,
NULL
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
arabic_features
);
++
i
)
{
unsigned
int
flags
=
context
->
script
==
Script_Arabic
&&
!
feature_is_syriac
(
arabic_features
[
i
])
?
FEATURE_HAS_FALLBACK
:
0
;
shape_add_feature_full
(
features
,
arabic_features
[
i
],
flags
,
1
);
shape_start_next_stage
(
features
);
shape_start_next_stage
(
features
,
NULL
);
}
shape_enable_feature
(
features
,
DWRITE_MAKE_OPENTYPE_TAG
(
'r'
,
'l'
,
'i'
,
'g'
),
FEATURE_MANUAL_ZWJ
|
FEATURE_HAS_FALLBACK
);
shape_enable_feature
(
features
,
DWRITE_MAKE_OPENTYPE_TAG
(
'r'
,
'c'
,
'l'
,
't'
),
FEATURE_MANUAL_ZWJ
);
shape_enable_feature
(
features
,
DWRITE_MAKE_OPENTYPE_TAG
(
'c'
,
'a'
,
'l'
,
't'
),
FEATURE_MANUAL_ZWJ
);
shape_start_next_stage
(
features
);
shape_start_next_stage
(
features
,
NULL
);
shape_enable_feature
(
features
,
DWRITE_MAKE_OPENTYPE_TAG
(
'm'
,
's'
,
'e'
,
't'
),
0
);
}
...
...
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