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
5ec7a860
Commit
5ec7a860
authored
Feb 16, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 16, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Always use system font collection to create fallback fonts.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1a92176b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
23 deletions
+19
-23
analyzer.c
dlls/dwrite/analyzer.c
+19
-22
layout.c
dlls/dwrite/tests/layout.c
+0
-1
No files found.
dlls/dwrite/analyzer.c
View file @
5ec7a860
...
...
@@ -199,6 +199,7 @@ static const struct fallback_mapping fontfallback_neutral_data[] = {
struct
dwrite_fontfallback
{
IDWriteFontFallback
IDWriteFontFallback_iface
;
IDWriteFactory2
*
factory
;
IDWriteFontCollection
*
systemcollection
;
const
struct
fallback_mapping
*
mappings
;
UINT32
count
;
};
...
...
@@ -1810,8 +1811,7 @@ static HRESULT fallback_map_characters(IDWriteFont *font, const WCHAR *text, UIN
}
static
HRESULT
fallback_get_fallback_font
(
struct
dwrite_fontfallback
*
fallback
,
const
WCHAR
*
text
,
UINT32
length
,
IDWriteFontCollection
*
collection
,
DWRITE_FONT_WEIGHT
weight
,
DWRITE_FONT_STYLE
style
,
DWRITE_FONT_STRETCH
stretch
,
UINT32
*
mapped_length
,
IDWriteFont
**
mapped_font
)
DWRITE_FONT_WEIGHT
weight
,
DWRITE_FONT_STYLE
style
,
DWRITE_FONT_STRETCH
stretch
,
UINT32
*
mapped_length
,
IDWriteFont
**
mapped_font
)
{
const
struct
fallback_mapping
*
mapping
;
HRESULT
hr
;
...
...
@@ -1823,7 +1823,7 @@ static HRESULT fallback_get_fallback_font(struct dwrite_fontfallback *fallback,
}
/* now let's see what fallback can handle */
hr
=
create_matching_font
(
collection
,
mapping
->
family
,
weight
,
style
,
stretch
,
mapped_font
);
hr
=
create_matching_font
(
fallback
->
system
collection
,
mapping
->
family
,
weight
,
style
,
stretch
,
mapped_font
);
if
(
FAILED
(
hr
))
{
WARN
(
"failed to create fallback font %s for range [0x%x,0x%x], 0x%08x
\n
"
,
debugstr_w
(
mapping
->
family
),
mapping
->
range
.
first
,
mapping
->
range
.
last
,
hr
);
...
...
@@ -1865,21 +1865,14 @@ static HRESULT WINAPI fontfallback_MapCharacters(IDWriteFontFallback *iface, IDW
if
(
length
==
0
)
return
S_OK
;
if
(
!
basecollection
)
{
hr
=
IDWriteFactory2_GetSystemFontCollection
(
fallback
->
factory
,
&
basecollection
,
FALSE
);
if
(
FAILED
(
hr
))
return
hr
;
}
else
IDWriteFontCollection_AddRef
(
basecollection
);
if
(
!
basecollection
)
basecollection
=
fallback
->
systemcollection
;
hr
=
get_text_source_ptr
(
source
,
position
,
length
,
&
text
,
&
buff
);
if
(
FAILED
(
hr
))
goto
done
;
if
(
basefamily
&&
*
basefamily
)
{
IDWriteFont
*
mapped_font
;
hr
=
create_matching_font
(
basecollection
,
basefamily
,
weight
,
style
,
stretch
,
ret_font
);
if
(
FAILED
(
hr
))
goto
done
;
...
...
@@ -1887,25 +1880,27 @@ static HRESULT WINAPI fontfallback_MapCharacters(IDWriteFontFallback *iface, IDW
hr
=
fallback_map_characters
(
*
ret_font
,
text
,
length
,
mapped_length
);
if
(
FAILED
(
hr
))
goto
done
;
}
if
(
!*
mapped_length
)
{
hr
=
fallback_get_fallback_font
(
fallback
,
text
,
length
,
basecollection
,
weight
,
style
,
stretch
,
mapped_length
,
&
mapped_font
);
if
(
FAILED
(
hr
))
{
if
(
!*
mapped_length
)
{
IDWriteFont
*
mapped_font
;
hr
=
fallback_get_fallback_font
(
fallback
,
text
,
length
,
weight
,
style
,
stretch
,
mapped_length
,
&
mapped_font
);
if
(
FAILED
(
hr
))
{
/* fallback wasn't found, keep base font if any, so we can get at least some visual output */
if
(
*
ret_font
)
{
*
mapped_length
=
length
;
hr
=
S_OK
;
goto
done
;
}
else
{
}
else
{
if
(
*
ret_font
)
IDWriteFont_Release
(
*
ret_font
);
*
ret_font
=
mapped_font
;
}
*
ret_font
=
mapped_font
;
}
}
else
hr
=
fallback_get_fallback_font
(
fallback
,
text
,
length
,
basecollection
,
weight
,
style
,
stretch
,
mapped_length
,
ret_font
);
done:
IDWriteFontCollection_Release
(
basecollection
);
heap_free
(
buff
);
return
hr
;
}
...
...
@@ -1931,6 +1926,7 @@ HRESULT create_system_fontfallback(IDWriteFactory2 *factory, IDWriteFontFallback
fallback
->
factory
=
factory
;
fallback
->
mappings
=
fontfallback_neutral_data
;
fallback
->
count
=
sizeof
(
fontfallback_neutral_data
)
/
sizeof
(
fontfallback_neutral_data
[
0
]);
IDWriteFactory2_GetSystemFontCollection
(
fallback
->
factory
,
&
fallback
->
systemcollection
,
FALSE
);
*
ret
=
&
fallback
->
IDWriteFontFallback_iface
;
return
S_OK
;
...
...
@@ -1939,5 +1935,6 @@ HRESULT create_system_fontfallback(IDWriteFactory2 *factory, IDWriteFontFallback
void
release_system_fontfallback
(
IDWriteFontFallback
*
iface
)
{
struct
dwrite_fontfallback
*
fallback
=
impl_from_IDWriteFontFallback
(
iface
);
IDWriteFontCollection_Release
(
fallback
->
systemcollection
);
heap_free
(
fallback
);
}
dlls/dwrite/tests/layout.c
View file @
5ec7a860
...
...
@@ -4200,7 +4200,6 @@ static HRESULT WINAPI fontcollection_FindFamilyName(IDWriteFontCollection *iface
*
exists
=
TRUE
;
return
S_OK
;
}
todo_wine
ok
(
0
,
"unexpected call, name %s
\n
"
,
wine_dbgstr_w
(
name
));
return
E_NOTIMPL
;
}
...
...
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