Nikolay Sivov : dwrite: Initialize GSUB offsets in shaping cache.

Alexandre Julliard julliard at winehq.org
Mon May 4 15:49:16 CDT 2020


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon May  4 11:29:31 2020 +0300

dwrite: Initialize GSUB offsets in shaping cache.

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

---

 dlls/dwrite/dwrite_private.h |  1 +
 dlls/dwrite/opentype.c       | 10 ++++++++++
 dlls/dwrite/shape.c          |  1 +
 3 files changed, 12 insertions(+)

diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h
index d89dacb3a4..4516189445 100644
--- a/dlls/dwrite/dwrite_private.h
+++ b/dlls/dwrite/dwrite_private.h
@@ -448,6 +448,7 @@ struct scriptshaping_cache
     void *context;
     UINT16 upem;
 
+    struct ot_gsubgpos_table gsub;
     struct ot_gsubgpos_table gpos;
 
     struct
diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index 66c3398316..a2af5ce954 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -2942,6 +2942,16 @@ DWRITE_CONTAINER_TYPE opentype_analyze_container_type(void const *data, UINT32 d
 
 void opentype_layout_scriptshaping_cache_init(struct scriptshaping_cache *cache)
 {
+    cache->font->grab_font_table(cache->context, MS_GSUB_TAG, &cache->gsub.table.data, &cache->gsub.table.size,
+            &cache->gsub.table.context);
+
+    if (cache->gsub.table.data)
+    {
+        cache->gsub.script_list = table_read_be_word(&cache->gsub.table, FIELD_OFFSET(struct gpos_gsub_header, script_list));
+        cache->gsub.feature_list = table_read_be_word(&cache->gsub.table, FIELD_OFFSET(struct gpos_gsub_header, feature_list));
+        cache->gsub.lookup_list = table_read_be_word(&cache->gsub.table, FIELD_OFFSET(struct gpos_gsub_header, lookup_list));
+    }
+
     cache->font->grab_font_table(cache->context, MS_GPOS_TAG, &cache->gpos.table.data, &cache->gpos.table.size,
             &cache->gpos.table.context);
 
diff --git a/dlls/dwrite/shape.c b/dlls/dwrite/shape.c
index d7d1261f35..bd53f03513 100644
--- a/dlls/dwrite/shape.c
+++ b/dlls/dwrite/shape.c
@@ -52,6 +52,7 @@ void release_scriptshaping_cache(struct scriptshaping_cache *cache)
         return;
 
     cache->font->release_font_table(cache->context, cache->gdef.table.context);
+    cache->font->release_font_table(cache->context, cache->gsub.table.context);
     cache->font->release_font_table(cache->context, cache->gpos.table.context);
     heap_free(cache);
 }




More information about the wine-cvs mailing list