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
f2ad1d8b
Commit
f2ad1d8b
authored
Jul 17, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Override existing ranges with AddMapping().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
76e675a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
3 deletions
+38
-3
analyzer.c
dlls/dwrite/analyzer.c
+38
-3
No files found.
dlls/dwrite/analyzer.c
View file @
f2ad1d8b
...
...
@@ -2452,7 +2452,7 @@ static HRESULT WINAPI fontfallbackbuilder_AddMapping(IDWriteFontFallbackBuilder
struct
dwrite_fontfallback_builder
*
builder
=
impl_from_IDWriteFontFallbackBuilder
(
iface
);
struct
fallback_mapping
*
mapping
;
struct
fallback_locale
*
locale
;
unsigned
int
i
,
count
;
unsigned
int
i
,
j
,
m
,
count
;
TRACE
(
"%p, %p, %u, %p, %u, %p, %s, %s, %f.
\n
"
,
iface
,
ranges
,
ranges_count
,
families
,
families_count
,
collection
,
debugstr_w
(
locale_name
),
debugstr_w
(
base_family
),
scale
);
...
...
@@ -2502,12 +2502,47 @@ static HRESULT WINAPI fontfallbackbuilder_AddMapping(IDWriteFontFallbackBuilder
mapping
->
families_count
=
families_count
;
for
(
i
=
0
;
i
<
families_count
;
i
++
)
if
(
!
(
mapping
->
families
[
i
]
=
wcsdup
(
families
[
i
])))
goto
failed
;
mapping
->
scale
=
scale
;
if
(
FAILED
(
fallback_locale_add_mapping
(
locale
,
builder
->
data
.
count
)))
goto
failed
;
/* Mappings with explicit collections take priority, for that reduce existing mappings ranges
by newly added ranges. */
mapping
->
collection
=
collection
;
if
(
mapping
->
collection
)
{
IDWriteFontCollection_AddRef
(
mapping
->
collection
);
mapping
->
scale
=
scale
;
if
(
FAILED
(
fallback_locale_add_mapping
(
locale
,
builder
->
data
.
count
)))
goto
failed
;
for
(
m
=
0
;
m
<
builder
->
data
.
count
;
++
m
)
{
struct
fallback_mapping
*
c
=
&
builder
->
data
.
mappings
[
m
];
if
(
c
->
collection
)
continue
;
for
(
i
=
0
;
i
<
count
;
++
i
)
{
const
DWRITE_UNICODE_RANGE
*
new_range
=
&
mapping
->
ranges
[
i
];
for
(
j
=
0
;
j
<
c
->
ranges_count
;
++
j
)
{
DWRITE_UNICODE_RANGE
*
range
=
&
c
->
ranges
[
j
];
/* In case existing ranges intersect, disable or reduce them */
if
(
range
->
first
>=
new_range
->
first
&&
range
->
last
<=
new_range
->
last
)
{
range
->
first
=
range
->
last
=
~
0u
;
}
else
if
(
range
->
first
>=
new_range
->
first
&&
range
->
first
<=
new_range
->
last
)
{
range
->
first
=
new_range
->
last
;
}
else
if
(
range
->
last
>=
new_range
->
first
&&
range
->
last
<=
new_range
->
last
)
{
range
->
last
=
new_range
->
first
;
}
}
}
}
}
builder
->
data
.
count
++
;
return
S_OK
;
...
...
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