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
88bc8f94
Commit
88bc8f94
authored
Jan 20, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Implement GetMatchingFontsByLOGFONT().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
33208d8a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
3 deletions
+71
-3
font.c
dlls/dwrite/font.c
+3
-1
gdiinterop.c
dlls/dwrite/gdiinterop.c
+11
-2
font.c
dlls/dwrite/tests/font.c
+57
-0
No files found.
dlls/dwrite/font.c
View file @
88bc8f94
...
@@ -7501,6 +7501,8 @@ static IDWriteLocalizedStrings * fontset_entry_get_property(struct dwrite_fontse
...
@@ -7501,6 +7501,8 @@ static IDWriteLocalizedStrings * fontset_entry_get_property(struct dwrite_fontse
opentype_get_font_info_strings
(
&
stream_desc
,
DWRITE_INFORMATIONAL_STRING_DESIGN_SCRIPT_LANGUAGE_TAG
,
&
value
);
opentype_get_font_info_strings
(
&
stream_desc
,
DWRITE_INFORMATIONAL_STRING_DESIGN_SCRIPT_LANGUAGE_TAG
,
&
value
);
else
if
(
property
==
DWRITE_FONT_PROPERTY_ID_SUPPORTED_SCRIPT_LANGUAGE_TAG
)
else
if
(
property
==
DWRITE_FONT_PROPERTY_ID_SUPPORTED_SCRIPT_LANGUAGE_TAG
)
opentype_get_font_info_strings
(
&
stream_desc
,
DWRITE_INFORMATIONAL_STRING_SUPPORTED_SCRIPT_LANGUAGE_TAG
,
&
value
);
opentype_get_font_info_strings
(
&
stream_desc
,
DWRITE_INFORMATIONAL_STRING_SUPPORTED_SCRIPT_LANGUAGE_TAG
,
&
value
);
else
if
(
property
==
DWRITE_FONT_PROPERTY_ID_WIN32_FAMILY_NAME
)
opentype_get_font_info_strings
(
&
stream_desc
,
DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES
,
&
value
);
else
else
WARN
(
"Unsupported property %u.
\n
"
,
property
);
WARN
(
"Unsupported property %u.
\n
"
,
property
);
...
@@ -7642,6 +7644,7 @@ static BOOL fontset_entry_is_matching(struct dwrite_fontset_entry *entry, DWRITE
...
@@ -7642,6 +7644,7 @@ static BOOL fontset_entry_is_matching(struct dwrite_fontset_entry *entry, DWRITE
case
DWRITE_FONT_PROPERTY_ID_FULL_NAME
:
case
DWRITE_FONT_PROPERTY_ID_FULL_NAME
:
case
DWRITE_FONT_PROPERTY_ID_DESIGN_SCRIPT_LANGUAGE_TAG
:
case
DWRITE_FONT_PROPERTY_ID_DESIGN_SCRIPT_LANGUAGE_TAG
:
case
DWRITE_FONT_PROPERTY_ID_SUPPORTED_SCRIPT_LANGUAGE_TAG
:
case
DWRITE_FONT_PROPERTY_ID_SUPPORTED_SCRIPT_LANGUAGE_TAG
:
case
DWRITE_FONT_PROPERTY_ID_WIN32_FAMILY_NAME
:
if
(
!
(
value
=
fontset_entry_get_property
(
entry
,
props
[
i
].
propertyId
)))
if
(
!
(
value
=
fontset_entry_get_property
(
entry
,
props
[
i
].
propertyId
)))
return
FALSE
;
return
FALSE
;
...
@@ -7652,7 +7655,6 @@ static BOOL fontset_entry_is_matching(struct dwrite_fontset_entry *entry, DWRITE
...
@@ -7652,7 +7655,6 @@ static BOOL fontset_entry_is_matching(struct dwrite_fontset_entry *entry, DWRITE
case
DWRITE_FONT_PROPERTY_ID_WEIGHT_STRETCH_STYLE_FAMILY_NAME
:
case
DWRITE_FONT_PROPERTY_ID_WEIGHT_STRETCH_STYLE_FAMILY_NAME
:
case
DWRITE_FONT_PROPERTY_ID_TYPOGRAPHIC_FAMILY_NAME
:
case
DWRITE_FONT_PROPERTY_ID_TYPOGRAPHIC_FAMILY_NAME
:
case
DWRITE_FONT_PROPERTY_ID_WEIGHT_STRETCH_STYLE_FACE_NAME
:
case
DWRITE_FONT_PROPERTY_ID_WEIGHT_STRETCH_STYLE_FACE_NAME
:
case
DWRITE_FONT_PROPERTY_ID_WIN32_FAMILY_NAME
:
case
DWRITE_FONT_PROPERTY_ID_SEMANTIC_TAG
:
case
DWRITE_FONT_PROPERTY_ID_SEMANTIC_TAG
:
case
DWRITE_FONT_PROPERTY_ID_WEIGHT
:
case
DWRITE_FONT_PROPERTY_ID_WEIGHT
:
case
DWRITE_FONT_PROPERTY_ID_STRETCH
:
case
DWRITE_FONT_PROPERTY_ID_STRETCH
:
...
...
dlls/dwrite/gdiinterop.c
View file @
88bc8f94
...
@@ -908,9 +908,18 @@ static HRESULT WINAPI gdiinterop1_GetFontSignature(IDWriteGdiInterop1 *iface, ID
...
@@ -908,9 +908,18 @@ static HRESULT WINAPI gdiinterop1_GetFontSignature(IDWriteGdiInterop1 *iface, ID
static
HRESULT
WINAPI
gdiinterop1_GetMatchingFontsByLOGFONT
(
IDWriteGdiInterop1
*
iface
,
LOGFONTW
const
*
logfont
,
static
HRESULT
WINAPI
gdiinterop1_GetMatchingFontsByLOGFONT
(
IDWriteGdiInterop1
*
iface
,
LOGFONTW
const
*
logfont
,
IDWriteFontSet
*
fontset
,
IDWriteFontSet
**
subset
)
IDWriteFontSet
*
fontset
,
IDWriteFontSet
**
subset
)
{
{
FIXME
(
"%p, %p, %p, %p: stub.
\n
"
,
iface
,
logfont
,
fontset
,
subset
)
;
DWRITE_FONT_PROPERTY
property
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p, %p, %p.
\n
"
,
iface
,
logfont
,
fontset
,
subset
);
if
(
!
logfont
||
!
fontset
)
return
E_INVALIDARG
;
property
.
propertyId
=
DWRITE_FONT_PROPERTY_ID_WIN32_FAMILY_NAME
;
property
.
propertyValue
=
logfont
->
lfFaceName
;
property
.
localeName
=
L""
;
return
IDWriteFontSet_GetMatchingFonts
(
fontset
,
&
property
,
1
,
subset
);
}
}
static
const
IDWriteGdiInterop1Vtbl
gdiinteropvtbl
=
static
const
IDWriteGdiInterop1Vtbl
gdiinteropvtbl
=
...
...
dlls/dwrite/tests/font.c
View file @
88bc8f94
...
@@ -10319,6 +10319,62 @@ if (SUCCEEDED(hr))
...
@@ -10319,6 +10319,62 @@ if (SUCCEEDED(hr))
DELETE_FONTFILE
(
path
);
DELETE_FONTFILE
(
path
);
}
}
static
void
test_GetMatchingFontsByLOGFONT
(
void
)
{
IDWriteFontSet
*
systemset
,
*
set
;
IDWriteGdiInterop1
*
interop
;
IDWriteGdiInterop
*
interop0
;
IDWriteFactory3
*
factory
;
ULONG
refcount
,
count
;
LOGFONTW
logfont
;
HRESULT
hr
;
factory
=
create_factory_iid
(
&
IID_IDWriteFactory3
);
if
(
!
factory
)
{
win_skip
(
"Skipping GetMatchingFontsByLOGFONT() tests.
\n
"
);
return
;
}
hr
=
IDWriteFactory3_GetSystemFontSet
(
factory
,
&
systemset
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
interop
=
NULL
;
hr
=
IDWriteFactory3_GetGdiInterop
(
factory
,
&
interop0
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDWriteGdiInterop_QueryInterface
(
interop0
,
&
IID_IDWriteGdiInterop1
,
(
void
**
)
&
interop
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IDWriteGdiInterop_Release
(
interop0
);
memset
(
&
logfont
,
0
,
sizeof
(
logfont
));
logfont
.
lfHeight
=
12
;
logfont
.
lfWidth
=
12
;
logfont
.
lfWeight
=
FW_BOLD
;
logfont
.
lfItalic
=
1
;
lstrcpyW
(
logfont
.
lfFaceName
,
L"tahoma"
);
hr
=
IDWriteGdiInterop1_GetMatchingFontsByLOGFONT
(
interop
,
NULL
,
systemset
,
&
set
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDWriteGdiInterop1_GetMatchingFontsByLOGFONT
(
interop
,
&
logfont
,
NULL
,
&
set
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDWriteGdiInterop1_GetMatchingFontsByLOGFONT
(
interop
,
&
logfont
,
systemset
,
&
set
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
count
=
IDWriteFontSet_GetFontCount
(
set
);
ok
(
count
>
0
,
"Unexpected count %u.
\n
"
,
count
);
IDWriteFontSet_Release
(
set
);
IDWriteGdiInterop1_Release
(
interop
);
IDWriteFontSet_Release
(
systemset
);
refcount
=
IDWriteFactory3_Release
(
factory
);
ok
(
!
refcount
,
"Factory wasn't released, %u.
\n
"
,
refcount
);
}
START_TEST
(
font
)
START_TEST
(
font
)
{
{
IDWriteFactory
*
factory
;
IDWriteFactory
*
factory
;
...
@@ -10393,6 +10449,7 @@ START_TEST(font)
...
@@ -10393,6 +10449,7 @@ START_TEST(font)
test_family_font_set
();
test_family_font_set
();
test_system_font_set
();
test_system_font_set
();
test_CreateFontCollectionFromFontSet
();
test_CreateFontCollectionFromFontSet
();
test_GetMatchingFontsByLOGFONT
();
IDWriteFactory_Release
(
factory
);
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