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
e55d4074
Commit
e55d4074
authored
Apr 20, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 20, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Accept local loader in CreateCustomFontFileReference().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
af18a098
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
main.c
dlls/dwrite/main.c
+3
-1
font.c
dlls/dwrite/tests/font.c
+24
-0
No files found.
dlls/dwrite/main.c
View file @
e55d4074
...
...
@@ -807,7 +807,9 @@ static HRESULT WINAPI dwritefactory_CreateCustomFontFileReference(IDWriteFactory
*
font_file
=
NULL
;
if
(
!
loader
||
!
factory_get_file_loader
(
This
,
loader
))
/* local loader is accepted as well */
if
(
!
loader
||
!
(
factory_get_file_loader
(
This
,
loader
)
||
(
IDWriteFontFileLoader
*
)
This
->
localfontfileloader
==
loader
))
return
E_INVALIDARG
;
return
create_font_file
(
loader
,
reference_key
,
key_size
,
font_file
);
...
...
dlls/dwrite/tests/font.c
View file @
e55d4074
...
...
@@ -2431,6 +2431,7 @@ static void test_CreateCustomFontFileReference(void)
IDWriteFontFileLoader
floader2
=
{
&
dwritefontfileloadervtbl
};
IDWriteFontFileLoader
floader3
=
{
&
dwritefontfileloadervtbl
};
IDWriteFactory
*
factory
,
*
factory2
;
IDWriteFontFileLoader
*
loader
;
IDWriteFontFile
*
file
,
*
file2
;
BOOL
support
;
DWRITE_FONT_FILE_TYPE
file_type
;
...
...
@@ -2441,6 +2442,11 @@ static void test_CreateCustomFontFileReference(void)
HRSRC
fontrsrc
;
UINT32
codePoints
[
1
]
=
{
0xa8
};
UINT16
indices
[
2
];
const
void
*
key
;
UINT32
key_size
;
WCHAR
*
path
;
path
=
create_testfontfile
(
test_fontfile
);
factory
=
create_factory
();
factory2
=
create_factory
();
...
...
@@ -2449,6 +2455,23 @@ if (0) { /* crashes on win10 */
hr
=
IDWriteFactory_RegisterFontFileLoader
(
factory
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
}
/* local loader is accepted too */
hr
=
IDWriteFactory_CreateFontFileReference
(
factory
,
path
,
NULL
,
&
file
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFontFile_GetLoader
(
file
,
&
loader
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFontFile_GetReferenceKey
(
file
,
&
key
,
&
key_size
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFactory_CreateCustomFontFileReference
(
factory
,
key
,
key_size
,
loader
,
&
file2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IDWriteFontFile_Release
(
file2
);
IDWriteFontFile_Release
(
file
);
IDWriteFontFileLoader_Release
(
loader
);
hr
=
IDWriteFactory_RegisterFontFileLoader
(
factory
,
&
floader
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFactory_RegisterFontFileLoader
(
factory
,
&
floader2
);
...
...
@@ -2582,6 +2605,7 @@ if (0) /* crashes on native */
IDWriteFactory_Release
(
factory2
);
IDWriteFactory_Release
(
factory
);
DELETE_FONTFILE
(
path
);
}
static
void
test_CreateFontFileReference
(
void
)
...
...
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