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
b9cfb927
Commit
b9cfb927
authored
Sep 03, 2014
by
Aric Stewart
Committed by
Alexandre Julliard
Sep 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Break out basic IDWriteFont creation from requiring a logfont.
parent
2ec9fbb2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
15 deletions
+31
-15
font.c
dlls/dwrite/font.c
+31
-15
No files found.
dlls/dwrite/font.c
View file @
b9cfb927
...
...
@@ -208,6 +208,7 @@ struct dwrite_fontfile {
};
static
HRESULT
create_fontfamily
(
const
WCHAR
*
familyname
,
IDWriteFontFamily
**
family
);
static
HRESULT
create_font_base
(
IDWriteFont
**
font
);
static
inline
struct
dwrite_fontface
*
impl_from_IDWriteFontFace
(
IDWriteFontFace
*
iface
)
{
...
...
@@ -1120,17 +1121,9 @@ static void get_font_properties(struct dwrite_font *font, HDC hdc)
}
}
HRESULT
create_font_from_logfont
(
const
LOGFONTW
*
logfont
,
IDWriteFont
**
font
)
static
HRESULT
create_font_base
(
IDWriteFont
**
font
)
{
const
WCHAR
*
facename
,
*
familyname
;
struct
dwrite_font
*
This
;
IDWriteFontFamily
*
family
;
OUTLINETEXTMETRICW
*
otm
;
HRESULT
hr
;
HFONT
hfont
;
HDC
hdc
;
int
ret
;
*
font
=
NULL
;
This
=
heap_alloc
(
sizeof
(
struct
dwrite_font
));
...
...
@@ -1142,6 +1135,35 @@ HRESULT create_font_from_logfont(const LOGFONTW *logfont, IDWriteFont **font)
return
E_OUTOFMEMORY
;
}
This
->
IDWriteFont_iface
.
lpVtbl
=
&
dwritefontvtbl
;
This
->
ref
=
1
;
This
->
data
->
face_data
=
NULL
;
This
->
face
=
NULL
;
This
->
family
=
NULL
;
This
->
is_system
=
FALSE
;
*
font
=
&
This
->
IDWriteFont_iface
;
return
S_OK
;
}
HRESULT
create_font_from_logfont
(
const
LOGFONTW
*
logfont
,
IDWriteFont
**
font
)
{
const
WCHAR
*
facename
,
*
familyname
;
struct
dwrite_font
*
This
;
IDWriteFontFamily
*
family
;
OUTLINETEXTMETRICW
*
otm
;
HRESULT
hr
;
HFONT
hfont
;
HDC
hdc
;
int
ret
;
hr
=
create_font_base
(
font
);
if
(
FAILED
(
hr
))
return
hr
;
This
=
impl_from_IDWriteFont
(
*
font
);
hfont
=
CreateFontIndirectW
(
logfont
);
if
(
!
hfont
)
{
...
...
@@ -1184,17 +1206,11 @@ HRESULT create_font_from_logfont(const LOGFONTW *logfont, IDWriteFont **font)
return
hr
;
}
This
->
IDWriteFont_iface
.
lpVtbl
=
&
dwritefontvtbl
;
This
->
ref
=
1
;
This
->
face
=
NULL
;
This
->
is_system
=
TRUE
;
This
->
family
=
family
;
This
->
data
->
simulations
=
DWRITE_FONT_SIMULATIONS_NONE
;
This
->
data
->
style
=
logfont
->
lfItalic
?
DWRITE_FONT_STYLE_ITALIC
:
DWRITE_FONT_STYLE_NORMAL
;
This
->
data
->
facename
=
heap_strdupW
(
logfont
->
lfFaceName
);
This
->
data
->
face_data
=
NULL
;
*
font
=
&
This
->
IDWriteFont_iface
;
return
S_OK
;
}
...
...
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