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
bd0abb59
Commit
bd0abb59
authored
May 21, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Append enabled user features that apply to whole text.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b9f580c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
3 deletions
+36
-3
analyzer.c
dlls/dwrite/analyzer.c
+9
-0
dwrite_private.h
dlls/dwrite/dwrite_private.h
+7
-0
shape.c
dlls/dwrite/shape.c
+20
-3
No files found.
dlls/dwrite/analyzer.c
View file @
bd0abb59
...
...
@@ -1256,6 +1256,9 @@ static HRESULT WINAPI dwritetextanalyzer_GetGlyphs(IDWriteTextAnalyzer2 *iface,
context
.
u
.
subst
.
max_glyph_count
=
max_glyph_count
;
context
.
glyph_count
=
g
;
context
.
language_tag
=
get_opentype_language
(
locale
);
context
.
user_features
.
features
=
features
;
context
.
user_features
.
range_lengths
=
feature_range_lengths
;
context
.
user_features
.
range_count
=
feature_ranges
;
script
=
analysis
->
script
>
Script_LastId
?
Script_Unknown
:
analysis
->
script
;
scriptprops
=
&
dwritescripts_properties
[
script
];
...
...
@@ -1321,6 +1324,9 @@ static HRESULT WINAPI dwritetextanalyzer_GetGlyphPlacements(IDWriteTextAnalyzer2
context
.
advances
=
advances
;
context
.
offsets
=
offsets
;
context
.
language_tag
=
get_opentype_language
(
locale
);
context
.
user_features
.
features
=
features
;
context
.
user_features
.
range_lengths
=
feature_range_lengths
;
context
.
user_features
.
range_count
=
feature_ranges
;
return
shape_get_positions
(
&
context
,
scriptprops
->
scripttags
);
}
...
...
@@ -1380,6 +1386,9 @@ static HRESULT WINAPI dwritetextanalyzer_GetGdiCompatibleGlyphPlacements(IDWrite
context
.
advances
=
advances
;
context
.
offsets
=
offsets
;
context
.
language_tag
=
get_opentype_language
(
locale
);
context
.
user_features
.
features
=
features
;
context
.
user_features
.
range_lengths
=
feature_range_lengths
;
context
.
user_features
.
range_count
=
feature_ranges
;
return
shape_get_positions
(
&
context
,
scriptprops
->
scripttags
);
}
...
...
dlls/dwrite/dwrite_private.h
View file @
bd0abb59
...
...
@@ -486,6 +486,13 @@ struct scriptshaping_context
}
subst
;
}
u
;
struct
{
const
DWRITE_TYPOGRAPHIC_FEATURES
**
features
;
const
unsigned
int
*
range_lengths
;
unsigned
int
range_count
;
}
user_features
;
unsigned
int
glyph_count
;
float
emsize
;
DWRITE_MEASURING_MODE
measuring_mode
;
...
...
dlls/dwrite/shape.c
View file @
bd0abb59
...
...
@@ -223,10 +223,27 @@ static int features_sorting_compare(const void *a, const void *b)
return
left
->
tag
!=
right
->
tag
?
(
left
->
tag
<
right
->
tag
?
-
1
:
1
)
:
0
;
};
static
void
shape_merge_features
(
struct
shaping_features
*
features
)
static
void
shape_merge_features
(
struct
s
criptshaping_context
*
context
,
struct
s
haping_features
*
features
)
{
const
DWRITE_TYPOGRAPHIC_FEATURES
**
user_features
=
context
->
user_features
.
features
;
unsigned
int
j
=
0
,
i
;
/* For now only consider global, enabled user features. */
if
(
user_features
&&
context
->
user_features
.
range_lengths
&&
context
->
user_features
.
range_count
==
1
)
{
for
(
i
=
0
;
i
<
context
->
user_features
.
range_count
;
++
i
)
{
if
(
context
->
user_features
.
range_lengths
[
i
]
!=
context
->
length
)
break
;
for
(
j
=
0
;
j
<
user_features
[
i
]
->
featureCount
;
++
j
)
{
if
(
user_features
[
i
]
->
features
[
j
].
parameter
==
1
)
shape_add_feature
(
features
,
user_features
[
i
]
->
features
[
j
].
nameTag
);
}
}
}
/* Sort and merge duplicates. */
qsort
(
features
->
features
,
features
->
count
,
sizeof
(
*
features
->
features
),
features_sorting_compare
);
...
...
@@ -267,7 +284,7 @@ HRESULT shape_get_positions(struct scriptshaping_context *context, const unsigne
shape_add_feature
(
&
features
,
horizontal_features
[
i
]);
}
shape_merge_features
(
&
features
);
shape_merge_features
(
context
,
&
features
);
/* Resolve script tag to actually supported script. */
if
(
cache
->
gpos
.
table
.
data
)
...
...
@@ -354,7 +371,7 @@ HRESULT shape_get_glyphs(struct scriptshaping_context *context, const unsigned i
else
shape_add_feature_flags
(
&
features
,
DWRITE_MAKE_OPENTYPE_TAG
(
'v'
,
'e'
,
'r'
,
't'
),
FEATURE_GLOBAL_SEARCH
);
shape_merge_features
(
&
features
);
shape_merge_features
(
context
,
&
features
);
/* Resolve script tag to actually supported script. */
if
(
cache
->
gsub
.
table
.
data
)
...
...
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