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
00ea0b72
Commit
00ea0b72
authored
Dec 17, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Added stub EUDC font collection.
parent
cacc9ae8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
2 deletions
+101
-2
dwrite_private.h
dlls/dwrite/dwrite_private.h
+1
-0
font.c
dlls/dwrite/font.c
+52
-0
main.c
dlls/dwrite/main.c
+20
-2
font.c
dlls/dwrite/tests/font.c
+28
-0
No files found.
dlls/dwrite/dwrite_private.h
View file @
00ea0b72
...
...
@@ -103,6 +103,7 @@ extern HRESULT create_localizedstrings(IDWriteLocalizedStrings**) DECLSPEC_HIDDE
extern
HRESULT
add_localizedstring
(
IDWriteLocalizedStrings
*
,
const
WCHAR
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
clone_localizedstring
(
IDWriteLocalizedStrings
*
iface
,
IDWriteLocalizedStrings
**
strings
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_system_fontcollection
(
IDWriteFactory2
*
,
IDWriteFontCollection
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_eudc_fontcollection
(
IDWriteFactory2
*
,
IDWriteFontCollection
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_textanalyzer
(
IDWriteTextAnalyzer
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_font_file
(
IDWriteFontFileLoader
*
loader
,
const
void
*
reference_key
,
UINT32
key_size
,
IDWriteFontFile
**
font_file
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_localfontfileloader
(
IDWriteLocalFontFileLoader
**
iface
)
DECLSPEC_HIDDEN
;
...
...
dlls/dwrite/font.c
View file @
00ea0b72
...
...
@@ -1968,6 +1968,58 @@ HRESULT get_system_fontcollection(IDWriteFactory2 *factory, IDWriteFontCollectio
return
hr
;
}
static
HRESULT
WINAPI
eudcfontfileenumerator_QueryInterface
(
IDWriteFontFileEnumerator
*
iface
,
REFIID
riid
,
void
**
obj
)
{
*
obj
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IDWriteFontFileEnumerator
)
||
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
IDWriteFontFileEnumerator_AddRef
(
iface
);
*
obj
=
iface
;
return
S_OK
;
}
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
eudcfontfileenumerator_AddRef
(
IDWriteFontFileEnumerator
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
eudcfontfileenumerator_Release
(
IDWriteFontFileEnumerator
*
iface
)
{
return
1
;
}
static
HRESULT
WINAPI
eudcfontfileenumerator_GetCurrentFontFile
(
IDWriteFontFileEnumerator
*
iface
,
IDWriteFontFile
**
file
)
{
*
file
=
NULL
;
return
E_FAIL
;
}
static
HRESULT
WINAPI
eudcfontfileenumerator_MoveNext
(
IDWriteFontFileEnumerator
*
iface
,
BOOL
*
current
)
{
*
current
=
FALSE
;
return
S_OK
;
}
static
const
struct
IDWriteFontFileEnumeratorVtbl
eudcfontfileenumeratorvtbl
=
{
eudcfontfileenumerator_QueryInterface
,
eudcfontfileenumerator_AddRef
,
eudcfontfileenumerator_Release
,
eudcfontfileenumerator_MoveNext
,
eudcfontfileenumerator_GetCurrentFontFile
};
static
IDWriteFontFileEnumerator
eudc_fontfile_enumerator
=
{
&
eudcfontfileenumeratorvtbl
};
HRESULT
get_eudc_fontcollection
(
IDWriteFactory2
*
factory
,
IDWriteFontCollection
**
collection
)
{
TRACE
(
"building EUDC font collection for factory %p
\n
"
,
factory
);
return
create_font_collection
(
factory
,
&
eudc_fontfile_enumerator
,
FALSE
,
collection
);
}
static
HRESULT
WINAPI
dwritefontfile_QueryInterface
(
IDWriteFontFile
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
dwrite_fontfile
*
This
=
impl_from_IDWriteFontFile
(
iface
);
...
...
dlls/dwrite/main.c
View file @
00ea0b72
...
...
@@ -453,6 +453,7 @@ struct dwritefactory {
LONG
ref
;
IDWriteFontCollection
*
system_collection
;
IDWriteFontCollection
*
eudc_collection
;
IDWriteGdiInterop
*
gdiinterop
;
IDWriteLocalFontFileLoader
*
localfontfileloader
;
...
...
@@ -505,6 +506,8 @@ static void release_dwritefactory(struct dwritefactory *factory)
if
(
factory
->
system_collection
)
IDWriteFontCollection_Release
(
factory
->
system_collection
);
if
(
factory
->
eudc_collection
)
IDWriteFontCollection_Release
(
factory
->
eudc_collection
);
if
(
factory
->
gdiinterop
)
release_gdiinterop
(
factory
->
gdiinterop
);
heap_free
(
factory
);
...
...
@@ -1025,8 +1028,22 @@ static HRESULT WINAPI dwritefactory1_GetEudcFontCollection(IDWriteFactory2 *ifac
BOOL
check_for_updates
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory2
(
iface
);
FIXME
(
"(%p)->(%p %d): stub
\n
"
,
This
,
collection
,
check_for_updates
);
return
E_NOTIMPL
;
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p)->(%p %d)
\n
"
,
This
,
collection
,
check_for_updates
);
if
(
check_for_updates
)
FIXME
(
"checking for eudc updates not implemented
\n
"
);
if
(
!
This
->
eudc_collection
)
hr
=
get_eudc_fontcollection
(
iface
,
&
This
->
eudc_collection
);
if
(
SUCCEEDED
(
hr
))
IDWriteFontCollection_AddRef
(
This
->
eudc_collection
);
*
collection
=
This
->
eudc_collection
;
return
hr
;
}
static
HRESULT
WINAPI
dwritefactory1_CreateCustomRenderingParams
(
IDWriteFactory2
*
iface
,
FLOAT
gamma
,
...
...
@@ -1172,6 +1189,7 @@ static void init_dwritefactory(struct dwritefactory *factory, DWRITE_FACTORY_TYP
factory
->
ref
=
1
;
factory
->
localfontfileloader
=
NULL
;
factory
->
system_collection
=
NULL
;
factory
->
eudc_collection
=
NULL
;
factory
->
gdiinterop
=
NULL
;
list_init
(
&
factory
->
collection_loaders
);
...
...
dlls/dwrite/tests/font.c
View file @
00ea0b72
...
...
@@ -2928,6 +2928,33 @@ static void test_GetGlyphRunOutline(void)
DeleteFileW
(
test_fontfile
);
}
static
void
test_GetEudcFontCollection
(
void
)
{
IDWriteFontCollection
*
coll
,
*
coll2
;
IDWriteFactory1
*
factory1
;
IDWriteFactory
*
factory
;
HRESULT
hr
;
factory
=
create_factory
();
hr
=
IDWriteFactory_QueryInterface
(
factory
,
&
IID_IDWriteFactory1
,
(
void
**
)
&
factory1
);
IDWriteFactory_Release
(
factory
);
if
(
hr
!=
S_OK
)
{
win_skip
(
"GetEudcFontCollection() is not supported.
\n
"
);
return
;
}
hr
=
IDWriteFactory1_GetEudcFontCollection
(
factory1
,
&
coll
,
FALSE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFactory1_GetEudcFontCollection
(
factory1
,
&
coll2
,
FALSE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
coll
==
coll2
,
"got %p, %p
\n
"
,
coll
,
coll2
);
IDWriteFontCollection_Release
(
coll
);
IDWriteFontCollection_Release
(
coll2
);
IDWriteFactory1_Release
(
factory1
);
}
START_TEST
(
font
)
{
IDWriteFactory
*
factory
;
...
...
@@ -2965,6 +2992,7 @@ START_TEST(font)
test_GetDesignGlyphAdvances
();
test_IsMonospacedFont
();
test_GetGlyphRunOutline
();
test_GetEudcFontCollection
();
IDWriteFactory_Release
(
factory
);
}
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