Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
cd7c31fe
Commit
cd7c31fe
authored
Oct 20, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Implement CreateFontFaceFromHdc().
parent
a088f7d3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
3 deletions
+61
-3
gdiinterop.c
dlls/dwrite/gdiinterop.c
+22
-2
Makefile.in
dlls/dwrite/tests/Makefile.in
+1
-1
font.c
dlls/dwrite/tests/font.c
+38
-0
No files found.
dlls/dwrite/gdiinterop.c
View file @
cd7c31fe
...
...
@@ -334,8 +334,28 @@ static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop *iface,
HDC
hdc
,
IDWriteFontFace
**
fontface
)
{
struct
gdiinterop
*
This
=
impl_from_IDWriteGdiInterop
(
iface
);
FIXME
(
"(%p)->(%p %p): stub
\n
"
,
This
,
hdc
,
fontface
);
return
E_NOTIMPL
;
IDWriteFont
*
font
;
LOGFONTW
logfont
;
HFONT
hfont
;
HRESULT
hr
;
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
hdc
,
fontface
);
*
fontface
=
NULL
;
hfont
=
GetCurrentObject
(
hdc
,
OBJ_FONT
);
if
(
!
hfont
)
return
E_INVALIDARG
;
GetObjectW
(
hfont
,
sizeof
(
logfont
),
&
logfont
);
hr
=
IDWriteGdiInterop_CreateFontFromLOGFONT
(
iface
,
&
logfont
,
&
font
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IDWriteFont_CreateFontFace
(
font
,
fontface
);
IDWriteFont_Release
(
font
);
return
hr
;
}
static
HRESULT
WINAPI
gdiinterop_CreateBitmapRenderTarget
(
IDWriteGdiInterop
*
iface
,
...
...
dlls/dwrite/tests/Makefile.in
View file @
cd7c31fe
TESTDLL
=
dwrite.dll
IMPORTS
=
dwrite gdi32
IMPORTS
=
dwrite gdi32
user32
C_SRCS
=
\
analyzer.c
\
...
...
dlls/dwrite/tests/font.c
View file @
cd7c31fe
...
...
@@ -1407,6 +1407,43 @@ static void test_GetGdiInterop(void)
IDWriteGdiInterop_Release
(
interop
);
}
static
void
test_CreateFontFaceFromHdc
(
void
)
{
IDWriteGdiInterop
*
interop
;
IDWriteFontFace
*
fontface
;
HFONT
hfont
,
oldhfont
;
LOGFONTW
logfont
;
HRESULT
hr
;
HDC
hdc
;
interop
=
NULL
;
hr
=
IDWriteFactory_GetGdiInterop
(
factory
,
&
interop
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteGdiInterop_CreateFontFaceFromHdc
(
interop
,
NULL
,
&
fontface
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
memset
(
&
logfont
,
0
,
sizeof
(
logfont
));
logfont
.
lfHeight
=
12
;
logfont
.
lfWidth
=
12
;
logfont
.
lfWeight
=
FW_NORMAL
;
logfont
.
lfItalic
=
1
;
lstrcpyW
(
logfont
.
lfFaceName
,
tahomaW
);
hfont
=
CreateFontIndirectW
(
&
logfont
);
hdc
=
CreateCompatibleDC
(
0
);
oldhfont
=
SelectObject
(
hdc
,
hfont
);
fontface
=
NULL
;
hr
=
IDWriteGdiInterop_CreateFontFaceFromHdc
(
interop
,
hdc
,
&
fontface
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IDWriteFontFace_Release
(
fontface
);
DeleteObject
(
SelectObject
(
hdc
,
oldhfont
));
DeleteDC
(
hdc
);
IDWriteGdiInterop_Release
(
interop
);
}
START_TEST
(
font
)
{
HRESULT
hr
;
...
...
@@ -1436,6 +1473,7 @@ START_TEST(font)
test_GetFirstMatchingFont
();
test_GetInformationalStrings
();
test_GetGdiInterop
();
test_CreateFontFaceFromHdc
();
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