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
cf3e9299
Commit
cf3e9299
authored
Mar 08, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Implement IDWriteFontFamily1::GetFont().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
05e42a55
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
font.c
dlls/dwrite/font.c
+16
-8
font.c
dlls/dwrite/tests/font.c
+1
-5
No files found.
dlls/dwrite/font.c
View file @
cf3e9299
...
...
@@ -1541,7 +1541,7 @@ static const IDWriteFont3Vtbl dwritefontvtbl = {
dwritefont3_GetLocality
};
static
HRESULT
create_font
(
struct
dwrite_font_data
*
data
,
IDWriteFontFamily1
*
family
,
IDWriteFont
**
font
)
static
HRESULT
create_font
(
struct
dwrite_font_data
*
data
,
IDWriteFontFamily1
*
family
,
IDWriteFont
3
**
font
)
{
struct
dwrite_font
*
This
;
*
font
=
NULL
;
...
...
@@ -1557,7 +1557,7 @@ static HRESULT create_font(struct dwrite_font_data *data, IDWriteFontFamily1 *fa
This
->
data
=
data
;
InterlockedIncrement
(
&
This
->
data
->
ref
);
*
font
=
(
IDWriteFont
*
)
&
This
->
IDWriteFont3_iface
;
*
font
=
&
This
->
IDWriteFont3_iface
;
return
S_OK
;
}
...
...
@@ -1635,7 +1635,7 @@ static HRESULT WINAPI dwritefontlist_GetFont(IDWriteFontList *iface, UINT32 inde
if
(
index
>=
This
->
font_count
)
return
E_INVALIDARG
;
return
create_font
(
This
->
fonts
[
index
],
This
->
family
,
font
);
return
create_font
(
This
->
fonts
[
index
],
This
->
family
,
(
IDWriteFont3
**
)
font
);
}
static
const
IDWriteFontListVtbl
dwritefontlistvtbl
=
{
...
...
@@ -1723,7 +1723,7 @@ static HRESULT WINAPI dwritefontfamily_GetFont(IDWriteFontFamily1 *iface, UINT32
if
(
index
>=
This
->
data
->
font_count
)
return
E_INVALIDARG
;
return
create_font
(
This
->
data
->
fonts
[
index
],
iface
,
font
);
return
create_font
(
This
->
data
->
fonts
[
index
],
iface
,
(
IDWriteFont3
**
)
font
);
}
static
HRESULT
WINAPI
dwritefontfamily_GetFamilyNames
(
IDWriteFontFamily1
*
iface
,
IDWriteLocalizedStrings
**
names
)
...
...
@@ -1796,7 +1796,7 @@ static HRESULT WINAPI dwritefontfamily_GetFirstMatchingFont(IDWriteFontFamily1 *
match
=
This
->
data
->
fonts
[
i
];
}
return
create_font
(
match
,
iface
,
font
);
return
create_font
(
match
,
iface
,
(
IDWriteFont3
**
)
font
);
}
typedef
BOOL
(
*
matching_filter_func
)(
const
struct
dwrite_font_data
*
);
...
...
@@ -1902,9 +1902,17 @@ static HRESULT WINAPI dwritefontfamily1_GetFont(IDWriteFontFamily1 *iface, UINT3
{
struct
dwrite_fontfamily
*
This
=
impl_from_IDWriteFontFamily1
(
iface
);
FIXME
(
"(%p)->(%u %p): stub
\n
"
,
This
,
index
,
font
);
TRACE
(
"(%p)->(%u %p)
\n
"
,
This
,
index
,
font
);
return
E_NOTIMPL
;
*
font
=
NULL
;
if
(
This
->
data
->
font_count
==
0
)
return
S_FALSE
;
if
(
index
>=
This
->
data
->
font_count
)
return
E_FAIL
;
return
create_font
(
This
->
data
->
fonts
[
index
],
iface
,
font
);
}
static
HRESULT
WINAPI
dwritefontfamily1_GetFontFaceReference
(
IDWriteFontFamily1
*
iface
,
UINT32
index
,
...
...
@@ -2121,7 +2129,7 @@ static HRESULT WINAPI dwritefontcollection_GetFontFromFontFace(IDWriteFontCollec
if
(
FAILED
(
hr
))
return
hr
;
hr
=
create_font
(
found_font
,
family
,
font
);
hr
=
create_font
(
found_font
,
family
,
(
IDWriteFont3
**
)
font
);
IDWriteFontFamily1_Release
(
family
);
return
hr
;
}
...
...
dlls/dwrite/tests/font.c
View file @
cf3e9299
...
...
@@ -1128,15 +1128,12 @@ if (0) /* crashes on native */
font3
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFontFamily1_GetFont
(
family1
,
~
0u
,
&
font3
);
todo_wine
{
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
font3
==
NULL
,
"got %p
\n
"
,
font3
);
}
hr
=
IDWriteFontFamily1_GetFont
(
family1
,
0
,
&
font3
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
hr
=
IDWriteFont3_QueryInterface
(
font3
,
&
IID_IDWriteFont
,
(
void
**
)
&
font
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IDWriteFont_Release
(
font
);
...
...
@@ -1146,7 +1143,6 @@ if (0) /* crashes on native */
IDWriteFont1_Release
(
font1
);
IDWriteFont3_Release
(
font3
);
}
IDWriteFontFamily1_Release
(
family1
);
}
else
...
...
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