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
54b89a29
Commit
54b89a29
authored
Apr 19, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Implement GetFontFamily() for IDWriteFontCollection1.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ae85317b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
font.c
dlls/dwrite/font.c
+16
-10
font.c
dlls/dwrite/tests/font.c
+1
-4
No files found.
dlls/dwrite/font.c
View file @
54b89a29
...
...
@@ -133,7 +133,7 @@ struct dwrite_fontfamily {
struct
dwrite_fontfamily_data
*
data
;
IDWriteFontCollection
*
collection
;
IDWriteFontCollection
1
*
collection
;
};
struct
dwrite_font
{
...
...
@@ -1715,7 +1715,7 @@ static ULONG WINAPI dwritefontfamily_Release(IDWriteFontFamily1 *iface)
if
(
!
ref
)
{
IDWriteFontCollection_Release
(
This
->
collection
);
IDWriteFontCollection
1
_Release
(
This
->
collection
);
release_fontfamily_data
(
This
->
data
);
heap_free
(
This
);
}
...
...
@@ -1726,10 +1726,11 @@ static ULONG WINAPI dwritefontfamily_Release(IDWriteFontFamily1 *iface)
static
HRESULT
WINAPI
dwritefontfamily_GetFontCollection
(
IDWriteFontFamily1
*
iface
,
IDWriteFontCollection
**
collection
)
{
struct
dwrite_fontfamily
*
This
=
impl_from_IDWriteFontFamily1
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
collection
);
*
collection
=
This
->
collection
;
IDWriteFontCollection_AddRef
(
This
->
collection
);
*
collection
=
(
IDWriteFontCollection
*
)
This
->
collection
;
IDWriteFontCollection_AddRef
(
*
collection
);
return
S_OK
;
}
...
...
@@ -1971,7 +1972,7 @@ static const IDWriteFontFamily1Vtbl fontfamilyvtbl = {
dwritefontfamily1_GetFontFaceReference
};
static
HRESULT
create_fontfamily
(
struct
dwrite_fontfamily_data
*
data
,
IDWriteFontCollection
*
collection
,
IDWriteFontFamily1
**
family
)
static
HRESULT
create_fontfamily
(
struct
dwrite_fontfamily_data
*
data
,
IDWriteFontCollection
1
*
collection
,
IDWriteFontFamily1
**
family
)
{
struct
dwrite_fontfamily
*
This
;
...
...
@@ -1983,7 +1984,7 @@ static HRESULT create_fontfamily(struct dwrite_fontfamily_data *data, IDWriteFon
This
->
IDWriteFontFamily1_iface
.
lpVtbl
=
&
fontfamilyvtbl
;
This
->
ref
=
1
;
This
->
collection
=
collection
;
IDWriteFontCollection_AddRef
(
collection
);
IDWriteFontCollection
1
_AddRef
(
collection
);
This
->
data
=
data
;
InterlockedIncrement
(
&
This
->
data
->
ref
);
...
...
@@ -2082,7 +2083,7 @@ static HRESULT WINAPI dwritefontcollection_GetFontFamily(IDWriteFontCollection1
return
E_FAIL
;
}
return
create_fontfamily
(
This
->
family_data
[
index
],
(
IDWriteFontCollection
*
)
iface
,
(
IDWriteFontFamily1
**
)
family
);
return
create_fontfamily
(
This
->
family_data
[
index
],
iface
,
(
IDWriteFontFamily1
**
)
family
);
}
static
UINT32
collection_find_family
(
struct
dwrite_fontcollection
*
collection
,
const
WCHAR
*
name
)
...
...
@@ -2176,7 +2177,7 @@ static HRESULT WINAPI dwritefontcollection_GetFontFromFontFace(IDWriteFontCollec
if
(
!
found_font
)
return
DWRITE_E_NOFONT
;
hr
=
create_fontfamily
(
found_family
,
(
IDWriteFontCollection
*
)
iface
,
&
family
);
hr
=
create_fontfamily
(
found_family
,
iface
,
&
family
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -2198,9 +2199,14 @@ static HRESULT WINAPI dwritefontcollection1_GetFontFamily(IDWriteFontCollection1
{
struct
dwrite_fontcollection
*
This
=
impl_from_IDWriteFontCollection1
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
family
);
TRACE
(
"(%p)->(%u %p)
\n
"
,
This
,
index
,
family
);
return
E_NOTIMPL
;
if
(
index
>=
This
->
family_count
)
{
*
family
=
NULL
;
return
E_FAIL
;
}
return
create_fontfamily
(
This
->
family_data
[
index
],
iface
,
family
);
}
static
const
IDWriteFontCollection1Vtbl
fontcollectionvtbl
=
{
...
...
dlls/dwrite/tests/font.c
View file @
54b89a29
...
...
@@ -2073,14 +2073,11 @@ static void test_system_fontcollection(void)
family1
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFontCollection1_GetFontFamily
(
collection1
,
~
0u
,
&
family1
);
todo_wine
{
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
family1
==
NULL
,
"got %p
\n
"
,
family1
);
}
hr
=
IDWriteFontCollection1_GetFontFamily
(
collection1
,
0
,
&
family1
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IDWriteFontFamily1_Release
(
family1
);
IDWriteFontCollection1_Release
(
collection1
);
}
...
...
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