Nikolay Sivov : dwrite/tests: Add a test for matching in system font set.

Alexandre Julliard julliard at winehq.org
Thu Mar 11 15:59:34 CST 2021


Module: wine
Branch: master
Commit: e729b2602613b8241292b5d7cec0f62a18c2aa70
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e729b2602613b8241292b5d7cec0f62a18c2aa70

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Mar 11 12:41:24 2021 +0300

dwrite/tests: Add a test for matching in system font set.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dwrite/tests/font.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c
index bded40a53c7..d0940c3b145 100644
--- a/dlls/dwrite/tests/font.c
+++ b/dlls/dwrite/tests/font.c
@@ -10011,8 +10011,11 @@ static void test_family_font_set(void)
 
 static void test_system_font_set(void)
 {
+    IDWriteFontSet *fontset, *filtered_set;
+    IDWriteFontFaceReference *ref;
+    IDWriteFontFace3 *fontface;
     IDWriteFactory3 *factory;
-    IDWriteFontSet *fontset;
+    DWRITE_FONT_PROPERTY p;
     unsigned int count;
     HRESULT hr;
 
@@ -10028,6 +10031,25 @@ static void test_system_font_set(void)
     count = IDWriteFontSet_GetFontCount(fontset);
     ok(!!count, "Unexpected font count %u.\n", count);
 
+    p.propertyId = DWRITE_FONT_PROPERTY_ID_FULL_NAME;
+    p.propertyValue = L"Tahoma";
+    p.localeName = L"";
+    hr = IDWriteFontSet_GetMatchingFonts(fontset, &p, 1, &filtered_set);
+    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+    count = IDWriteFontSet_GetFontCount(filtered_set);
+    ok(!!count, "Unexpected font count %u.\n", count);
+
+    hr = IDWriteFontSet_GetFontFaceReference(filtered_set, 0, &ref);
+    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+    hr = IDWriteFontFaceReference_CreateFontFace(ref, &fontface);
+    ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+
+    IDWriteFontFace3_Release(fontface);
+    IDWriteFontFaceReference_Release(ref);
+
+    IDWriteFontSet_Release(filtered_set);
+
     IDWriteFontSet_Release(fontset);
 
     IDWriteFactory3_Release(factory);




More information about the wine-cvs mailing list