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
f7fc249e
Commit
f7fc249e
authored
Jun 11, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Update clustermap once after all features have been applied.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a7a977ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
33 deletions
+30
-33
dwrite_private.h
dlls/dwrite/dwrite_private.h
+4
-0
opentype.c
dlls/dwrite/opentype.c
+26
-33
No files found.
dlls/dwrite/dwrite_private.h
View file @
f7fc249e
...
...
@@ -513,8 +513,12 @@ struct scriptshaping_cache
struct
shaping_glyph_info
{
/* Combined features mask. */
unsigned
int
mask
;
/* Derived from glyph class, supplied by GDEF. */
unsigned
int
props
;
/* Only relevant for isClusterStart glyphs. Indicates text position for this cluster. */
unsigned
int
start_text_idx
;
};
struct
shaping_glyph_properties
...
...
dlls/dwrite/opentype.c
View file @
f7fc249e
...
...
@@ -4949,30 +4949,6 @@ static BOOL opentype_layout_gsub_ensure_buffer(struct scriptshaping_context *con
return
ret
;
}
static
unsigned
int
opentype_layout_get_next_char_index
(
const
struct
scriptshaping_context
*
context
,
unsigned
int
idx
)
{
unsigned
int
start
=
0
,
end
=
context
->
length
-
1
,
mid
,
ret
=
~
0u
;
for
(;;)
{
mid
=
(
start
+
end
)
/
2
;
if
(
context
->
u
.
buffer
.
clustermap
[
mid
]
<=
idx
)
{
if
(
mid
==
end
)
break
;
start
=
mid
+
1
;
}
else
{
ret
=
mid
;
if
(
mid
==
start
)
break
;
end
=
mid
-
1
;
}
}
return
ret
;
}
static
BOOL
opentype_layout_apply_gsub_mult_substitution
(
struct
scriptshaping_context
*
context
,
const
struct
lookup
*
lookup
,
unsigned
int
subtable_offset
)
{
...
...
@@ -5053,20 +5029,13 @@ static BOOL opentype_layout_apply_gsub_mult_substitution(struct scriptshaping_co
{
context
->
u
.
subst
.
glyph_props
[
idx
+
i
].
isClusterStart
=
0
;
context
->
u
.
buffer
.
glyph_props
[
idx
+
i
].
components
=
0
;
context
->
glyph_infos
[
idx
+
i
].
start_text_idx
=
0
;
}
opentype_set_subst_glyph_props
(
context
,
idx
+
i
);
/* Inherit feature mask from original matched glyph. */
context
->
glyph_infos
[
idx
+
i
].
mask
=
mask
;
}
/* Update following clusters. */
idx
=
opentype_layout_get_next_char_index
(
context
,
context
->
cur
);
if
(
idx
!=
~
0u
)
{
for
(
i
=
idx
;
i
<
context
->
length
;
++
i
)
context
->
u
.
subst
.
clustermap
[
i
]
+=
glyph_count
;
}
context
->
cur
+=
glyph_count
+
1
;
context
->
glyph_count
+=
glyph_count
;
}
...
...
@@ -5889,6 +5858,7 @@ static void opentype_get_nominal_glyphs(struct scriptshaping_context *context, c
if
(
!
g
||
!
opentype_is_diacritic
(
codepoint
))
{
context
->
u
.
buffer
.
glyph_props
[
g
].
isClusterStart
=
1
;
context
->
glyph_infos
[
g
].
start_text_idx
=
i
;
cluster_start_idx
=
g
;
}
...
...
@@ -5932,7 +5902,7 @@ void opentype_layout_apply_gsub_features(struct scriptshaping_context *context,
unsigned
int
language_index
,
const
struct
shaping_features
*
features
)
{
struct
lookups
lookups
=
{
0
};
unsigned
int
i
;
unsigned
int
i
,
j
,
start_idx
;
BOOL
ret
;
context
->
nesting_level_left
=
SHAPE_MAX_NESTING_LEVEL
;
...
...
@@ -5981,6 +5951,29 @@ void opentype_layout_apply_gsub_features(struct scriptshaping_context *context,
}
}
/* For every glyph range of [<last>.isClusterStart, <next>.isClusterStart) set corresponding
text span to start_idx. */
start_idx
=
0
;
for
(
i
=
1
;
i
<
context
->
glyph_count
;
++
i
)
{
if
(
context
->
u
.
buffer
.
glyph_props
[
i
].
isClusterStart
)
{
unsigned
int
start_text
,
end_text
;
start_text
=
context
->
glyph_infos
[
start_idx
].
start_text_idx
;
end_text
=
context
->
glyph_infos
[
i
].
start_text_idx
;
for
(
j
=
start_text
;
j
<
end_text
;
++
j
)
context
->
u
.
buffer
.
clustermap
[
j
]
=
start_idx
;
start_idx
=
i
;
}
}
/* Fill the tail. */
for
(
j
=
context
->
glyph_infos
[
start_idx
].
start_text_idx
;
j
<
context
->
length
;
++
j
)
context
->
u
.
buffer
.
clustermap
[
j
]
=
start_idx
;
heap_free
(
lookups
.
lookups
);
}
...
...
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