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
5e4d5ebd
Commit
5e4d5ebd
authored
Jan 06, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Implement ConvertFontFaceToLOGFONT().
parent
07ded6bb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
3 deletions
+68
-3
dwrite_private.h
dlls/dwrite/dwrite_private.h
+1
-0
font.c
dlls/dwrite/font.c
+11
-0
gdiinterop.c
dlls/dwrite/gdiinterop.c
+3
-3
font.c
dlls/dwrite/tests/font.c
+53
-0
No files found.
dlls/dwrite/dwrite_private.h
View file @
5e4d5ebd
...
...
@@ -72,6 +72,7 @@ static inline LPWSTR heap_strdupnW(const WCHAR *str, UINT32 len)
}
extern
HRESULT
create_font_from_logfont
(
const
LOGFONTW
*
,
IDWriteFont
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
convert_fontface_to_logfont
(
IDWriteFontFace
*
,
LOGFONTW
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_textformat
(
const
WCHAR
*
,
IDWriteFontCollection
*
,
DWRITE_FONT_WEIGHT
,
DWRITE_FONT_STYLE
,
DWRITE_FONT_STRETCH
,
FLOAT
,
const
WCHAR
*
,
IDWriteTextFormat
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_textlayout
(
const
WCHAR
*
,
UINT32
,
IDWriteTextFormat
*
,
IDWriteTextLayout
**
)
DECLSPEC_HIDDEN
;
...
...
dlls/dwrite/font.c
View file @
5e4d5ebd
...
...
@@ -396,6 +396,8 @@ static HRESULT create_fontface(struct dwrite_font *font, IDWriteFontFace **face)
memset
(
&
This
->
logfont
,
0
,
sizeof
(
This
->
logfont
));
This
->
logfont
.
lfItalic
=
font
->
style
==
DWRITE_FONT_STYLE_ITALIC
;
/* weight values from DWRITE_FONT_WEIGHT match values used for LOGFONT */
This
->
logfont
.
lfWeight
=
font
->
weight
;
strcpyW
(
This
->
logfont
.
lfFaceName
,
font
->
facename
);
*
face
=
&
This
->
IDWriteFontFace_iface
;
...
...
@@ -403,6 +405,15 @@ static HRESULT create_fontface(struct dwrite_font *font, IDWriteFontFace **face)
return
S_OK
;
}
HRESULT
convert_fontface_to_logfont
(
IDWriteFontFace
*
face
,
LOGFONTW
*
logfont
)
{
struct
dwrite_fontface
*
fontface
=
impl_from_IDWriteFontFace
(
face
);
*
logfont
=
fontface
->
logfont
;
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefont_QueryInterface
(
IDWriteFont
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
...
...
dlls/dwrite/gdiinterop.c
View file @
5e4d5ebd
...
...
@@ -242,10 +242,10 @@ static HRESULT WINAPI gdiinterop_ConvertFontToLOGFONT(IDWriteGdiInterop *iface,
}
static
HRESULT
WINAPI
gdiinterop_ConvertFontFaceToLOGFONT
(
IDWriteGdiInterop
*
iface
,
IDWriteFontFace
*
font
,
LOGFONTW
*
logfont
)
IDWriteFontFace
*
font
face
,
LOGFONTW
*
logfont
)
{
FIXME
(
"(%p %p): stub
\n
"
,
font
,
logfont
);
return
E_NOTIMPL
;
TRACE
(
"(%p %p)
\n
"
,
fontface
,
logfont
);
return
convert_fontface_to_logfont
(
fontface
,
logfont
)
;
}
static
HRESULT
WINAPI
gdiinterop_CreateFontFaceFromHdc
(
IDWriteGdiInterop
*
iface
,
...
...
dlls/dwrite/tests/font.c
View file @
5e4d5ebd
...
...
@@ -561,6 +561,58 @@ static void test_system_fontcollection(void)
IDWriteFontCollection_Release
(
collection
);
}
static
void
test_ConvertFontFaceToLOGFONT
(
void
)
{
IDWriteGdiInterop
*
interop
;
IDWriteFontFace
*
fontface
;
IDWriteFont
*
font
;
LOGFONTW
logfont
;
HRESULT
hr
;
hr
=
IDWriteFactory_GetGdiInterop
(
factory
,
&
interop
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
memset
(
&
logfont
,
0
,
sizeof
(
logfont
));
logfont
.
lfHeight
=
12
;
logfont
.
lfWidth
=
12
;
logfont
.
lfEscapement
=
100
;
logfont
.
lfWeight
=
FW_NORMAL
;
logfont
.
lfItalic
=
1
;
logfont
.
lfUnderline
=
1
;
logfont
.
lfStrikeOut
=
1
;
lstrcpyW
(
logfont
.
lfFaceName
,
tahomaW
);
hr
=
IDWriteGdiInterop_CreateFontFromLOGFONT
(
interop
,
&
logfont
,
&
font
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFont_CreateFontFace
(
font
,
&
fontface
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
0
)
/* crashes on native */
{
hr
=
IDWriteGdiInterop_ConvertFontFaceToLOGFONT
(
interop
,
NULL
,
NULL
);
hr
=
IDWriteGdiInterop_ConvertFontFaceToLOGFONT
(
interop
,
fontface
,
NULL
);
}
memset
(
&
logfont
,
0xa
,
sizeof
(
logfont
));
logfont
.
lfFaceName
[
0
]
=
0
;
hr
=
IDWriteGdiInterop_ConvertFontFaceToLOGFONT
(
interop
,
fontface
,
&
logfont
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
logfont
.
lfHeight
==
0
,
"got %d
\n
"
,
logfont
.
lfHeight
);
ok
(
logfont
.
lfWidth
==
0
,
"got %d
\n
"
,
logfont
.
lfWidth
);
ok
(
logfont
.
lfWeight
==
FW_NORMAL
,
"got %d
\n
"
,
logfont
.
lfWeight
);
ok
(
logfont
.
lfEscapement
==
0
,
"got %d
\n
"
,
logfont
.
lfEscapement
);
ok
(
logfont
.
lfItalic
==
1
,
"got %d
\n
"
,
logfont
.
lfItalic
);
ok
(
logfont
.
lfUnderline
==
0
,
"got %d
\n
"
,
logfont
.
lfUnderline
);
ok
(
logfont
.
lfStrikeOut
==
0
,
"got %d
\n
"
,
logfont
.
lfStrikeOut
);
ok
(
!
lstrcmpW
(
logfont
.
lfFaceName
,
tahomaW
),
"got %s
\n
"
,
wine_dbgstr_w
(
logfont
.
lfFaceName
));
IDWriteGdiInterop_Release
(
interop
);
IDWriteFontFace_Release
(
fontface
);
}
START_TEST
(
font
)
{
HRESULT
hr
;
...
...
@@ -580,6 +632,7 @@ START_TEST(font)
test_CreateFontFace
();
test_GetMetrics
();
test_system_fontcollection
();
test_ConvertFontFaceToLOGFONT
();
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