[PATCH 4/9] dwrite/tests: Test MapCharacters with a font name not in the collection.

Giovanni Mascellani gmascellani at codeweavers.com
Thu Mar 4 04:23:07 CST 2021


Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
---
 dlls/dwrite/tests/layout.c | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index 11fb6e1541d..993a742a7e1 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -4796,6 +4796,43 @@ todo_wine
     IDWriteFont_Release(font);
 }
 
+    /* Explicit collection, but forcing a font that does not exist in it. */
+    /* 1. Latin part */
+    g_source = str2W;
+    mappedlength = 0;
+    scale = 0.0f;
+    font = NULL;
+    hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 3, &fallbackcollection, g_fontNotInCollectionW, DWRITE_FONT_WEIGHT_NORMAL,
+        DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
+todo_wine {
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(mappedlength == 1, "got %u\n", mappedlength);
+}
+    ok(scale == 1.0f, "got %f\n", scale);
+todo_wine
+    ok(font != NULL, "got %p\n", font);
+if (font) {
+    IDWriteFont_Release(font);
+}
+
+    /* 2. Hiragana character */
+    g_source = str2W;
+    mappedlength = 0;
+    scale = 0.0f;
+    font = NULL;
+    hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 1, 1, &fallbackcollection, g_fontNotInCollectionW, DWRITE_FONT_WEIGHT_NORMAL,
+        DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
+todo_wine {
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    ok(mappedlength == 1, "got %u\n", mappedlength);
+}
+    ok(scale == 1.0f, "got %f\n", scale);
+todo_wine
+    ok(font != NULL, "got %p\n", font);
+if (font) {
+    IDWriteFont_Release(font);
+}
+
     IDWriteFontFallback_Release(fallback);
     IDWriteFactory2_Release(factory2);
 }
-- 
2.30.1




More information about the wine-devel mailing list