Nikolay Sivov : dwrite: Don' t bother going through fallback for non-visual runs.

Alexandre Julliard julliard at winehq.org
Fri Jun 17 10:35:01 CDT 2016


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Jun 16 20:47:10 2016 +0300

dwrite: Don't bother going through fallback for non-visual runs.

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

---

 dlls/dwrite/layout.c | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
index 3fcf07a..926a2cf 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -789,17 +789,48 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout)
     /* resolve run fonts */
     LIST_FOR_EACH_ENTRY(r, &layout->runs, struct layout_run, entry) {
         struct regular_layout_run *run = &r->u.regular;
+        IDWriteFont *font;
         UINT32 length;
 
         if (r->kind == LAYOUT_RUN_INLINE)
             continue;
 
         range = get_layout_range_by_pos(layout, run->descr.textPosition);
+
+        if (run->sa.shapes == DWRITE_SCRIPT_SHAPES_NO_VISUAL) {
+            IDWriteFontCollection *collection;
+
+            if (range->collection) {
+                collection = range->collection;
+                IDWriteFontCollection_AddRef(collection);
+            }
+            else
+                IDWriteFactory_GetSystemFontCollection((IDWriteFactory*)layout->factory, &collection, FALSE);
+
+            hr = create_matching_font(range->collection, range->fontfamily, range->weight,
+                range->style, range->stretch, &font);
+
+            IDWriteFontCollection_Release(collection);
+
+            if (FAILED(hr)) {
+                WARN("%s: failed to create a font for non visual run, %s, collection %p\n", debugstr_rundescr(&run->descr),
+                    debugstr_w(range->fontfamily), range->collection);
+                return hr;
+            }
+
+            hr = IDWriteFont_CreateFontFace(font, &run->run.fontFace);
+            IDWriteFont_Release(font);
+            if (FAILED(hr))
+                return hr;
+
+            run->run.fontEmSize = range->fontsize;
+            continue;
+        }
+
         length = run->descr.stringLength;
 
         while (length) {
             UINT32 mapped_length;
-            IDWriteFont *font;
             FLOAT scale;
 
             run = &r->u.regular;




More information about the wine-cvs mailing list