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
cecf7d55
Commit
cecf7d55
authored
Apr 26, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Implement CreateTextFormat() for IDWriteFactory6.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
46a2f3e4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
17 deletions
+40
-17
dwrite_private.h
dlls/dwrite/dwrite_private.h
+3
-2
format.c
dlls/dwrite/format.c
+8
-5
main.c
dlls/dwrite/main.c
+28
-6
layout.c
dlls/dwrite/tests/layout.c
+1
-4
No files found.
dlls/dwrite/dwrite_private.h
View file @
cecf7d55
...
...
@@ -286,8 +286,9 @@ struct dwrite_fontface
};
extern
HRESULT
create_numbersubstitution
(
DWRITE_NUMBER_SUBSTITUTION_METHOD
,
const
WCHAR
*
locale
,
BOOL
,
IDWriteNumberSubstitution
**
)
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_text_format
(
const
WCHAR
*
family_name
,
IDWriteFontCollection
*
collection
,
DWRITE_FONT_WEIGHT
weight
,
DWRITE_FONT_STYLE
style
,
DWRITE_FONT_STRETCH
stretch
,
float
size
,
const
WCHAR
*
locale
,
REFIID
riid
,
void
**
out
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_textlayout
(
const
struct
textlayout_desc
*
,
IDWriteTextLayout
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_trimmingsign
(
IDWriteFactory7
*
factory
,
IDWriteTextFormat
*
format
,
IDWriteInlineObject
**
sign
)
DECLSPEC_HIDDEN
;
...
...
dlls/dwrite/format.c
View file @
cecf7d55
...
...
@@ -711,12 +711,14 @@ struct dwrite_textformat *unsafe_impl_from_IDWriteTextFormat(IDWriteTextFormat *
CONTAINING_RECORD
(
iface
,
struct
dwrite_textformat
,
IDWriteTextFormat3_iface
)
:
NULL
;
}
HRESULT
create_textformat
(
const
WCHAR
*
family_name
,
IDWriteFontCollection
*
collection
,
DWRITE_FONT_WEIGHT
weight
,
DWRITE_FONT_STYLE
style
,
DWRITE_FONT_STRETCH
stretch
,
float
size
,
const
WCHAR
*
locale
,
IDWriteTextFormat
**
format
)
HRESULT
create_text_format
(
const
WCHAR
*
family_name
,
IDWriteFontCollection
*
collection
,
DWRITE_FONT_WEIGHT
weight
,
DWRITE_FONT_STYLE
style
,
DWRITE_FONT_STRETCH
stretch
,
float
size
,
const
WCHAR
*
locale
,
REFIID
riid
,
void
**
out
)
{
struct
dwrite_textformat
*
object
;
HRESULT
hr
;
*
forma
t
=
NULL
;
*
ou
t
=
NULL
;
if
(
size
<=
0
.
0
f
)
return
E_INVALIDARG
;
...
...
@@ -746,9 +748,10 @@ HRESULT create_textformat(const WCHAR *family_name, IDWriteFontCollection *colle
object
->
format
.
collection
=
collection
;
IDWriteFontCollection_AddRef
(
object
->
format
.
collection
);
*
format
=
(
IDWriteTextFormat
*
)
&
object
->
IDWriteTextFormat3_iface
;
hr
=
IDWriteTextFormat3_QueryInterface
(
&
object
->
IDWriteTextFormat3_iface
,
riid
,
out
);
IDWriteTextFormat3_Release
(
&
object
->
IDWriteTextFormat3_iface
);
return
S_OK
;
return
hr
;
}
static
HRESULT
WINAPI
dwritetrimmingsign_QueryInterface
(
IDWriteInlineObject
*
iface
,
REFIID
riid
,
void
**
obj
)
...
...
dlls/dwrite/main.c
View file @
cecf7d55
...
...
@@ -1199,7 +1199,8 @@ static HRESULT WINAPI dwritefactory_CreateTextFormat(IDWriteFactory7 *iface, WCH
return
hr
;
}
hr
=
create_textformat
(
family_name
,
collection
,
weight
,
style
,
stretch
,
size
,
locale
,
format
);
hr
=
create_text_format
(
family_name
,
collection
,
weight
,
style
,
stretch
,
size
,
locale
,
&
IID_IDWriteTextFormat
,
(
void
**
)
format
);
IDWriteFontCollection_Release
(
collection
);
return
hr
;
}
...
...
@@ -1895,14 +1896,35 @@ static HRESULT WINAPI dwritefactory6_CreateFontSetBuilder(IDWriteFactory7 *iface
return
create_fontset_builder
(
iface
,
builder
);
}
static
HRESULT
WINAPI
dwritefactory6_CreateTextFormat
(
IDWriteFactory7
*
iface
,
const
WCHAR
*
familyname
,
static
HRESULT
WINAPI
dwritefactory6_CreateTextFormat
(
IDWriteFactory7
*
iface
,
const
WCHAR
*
family
_
name
,
IDWriteFontCollection
*
collection
,
DWRITE_FONT_AXIS_VALUE
const
*
axis_values
,
UINT32
num_axis
,
FLOAT
fontsize
,
const
WCHAR
*
localenam
e
,
IDWriteTextFormat3
**
format
)
float
size
,
const
WCHAR
*
local
e
,
IDWriteTextFormat3
**
format
)
{
FIXME
(
"%p, %s, %p, %p, %u, %.8e, %s, %p.
\n
"
,
iface
,
debugstr_w
(
familyname
),
collection
,
axis_values
,
num_axis
,
fontsize
,
debugstr_w
(
localename
),
format
)
;
struct
dwritefactory
*
factory
=
impl_from_IDWriteFactory7
(
iface
);
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p, %s, %p, %p, %u, %.8e, %s, %p.
\n
"
,
iface
,
debugstr_w
(
family_name
),
collection
,
axis_values
,
num_axis
,
size
,
debugstr_w
(
locale
),
format
);
*
format
=
NULL
;
if
(
axis_values
)
FIXME
(
"Axis values are ignored.
\n
"
);
if
(
collection
)
{
IDWriteFontCollection_AddRef
(
collection
);
}
else
if
(
FAILED
(
hr
=
factory_get_system_collection
(
factory
,
DWRITE_FONT_FAMILY_MODEL_TYPOGRAPHIC
,
&
IID_IDWriteFontCollection
,
(
void
**
)
&
collection
)))
{
return
hr
;
}
hr
=
create_text_format
(
family_name
,
collection
,
DWRITE_FONT_WEIGHT_NORMAL
,
DWRITE_FONT_STYLE_NORMAL
,
DWRITE_FONT_STRETCH_NORMAL
,
size
,
locale
,
&
IID_IDWriteTextFormat3
,
(
void
**
)
format
);
IDWriteFontCollection_Release
(
collection
);
return
hr
;
}
static
HRESULT
WINAPI
dwritefactory7_GetSystemFontSet
(
IDWriteFactory7
*
iface
,
BOOL
include_downloadable
,
...
...
dlls/dwrite/tests/layout.c
View file @
cecf7d55
...
...
@@ -5986,11 +5986,8 @@ static void test_text_format_axes(void)
}
hr
=
IDWriteFactory6_CreateTextFormat
(
factory
,
L"test_family"
,
NULL
,
NULL
,
0
,
10
.
0
f
,
L"en-us"
,
&
format3
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDWriteTextFormat3_GetFontCollection
(
format3
,
&
collection
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
...
...
@@ -6025,7 +6022,7 @@ if (SUCCEEDED(hr))
ok
(
weight
==
DWRITE_FONT_WEIGHT_NORMAL
,
"Unexpected font weight %d.
\n
"
,
weight
);
IDWriteTextFormat3_Release
(
format3
);
}
hr
=
IDWriteFactory_CreateTextFormat
((
IDWriteFactory
*
)
factory
,
L"test_family"
,
NULL
,
DWRITE_FONT_WEIGHT_BOLD
,
DWRITE_FONT_STYLE_ITALIC
,
DWRITE_FONT_STRETCH_EXPANDED
,
10
.
0
f
,
L"en-us"
,
&
format
);
...
...
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