[USP10] Sync with Wine Staging 1.9.23. CORE-12409
authorAmine Khaldi <amine.khaldi@reactos.org>
Thu, 17 Nov 2016 23:13:09 +0000 (23:13 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Thu, 17 Nov 2016 23:13:09 +0000 (23:13 +0000)
svn path=/trunk/; revision=73296

reactos/dll/win32/usp10/usp10.c
reactos/dll/win32/usp10/usp10_internal.h
reactos/media/doc/README.WINE

index 9d3abe5..aa839d6 100644 (file)
@@ -1008,7 +1008,7 @@ HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc)
         {
             heap_free(((ScriptCache *)*psc)->widths[i]);
         }
-        for (i = 0; i < 0x10; i++)
+        for (i = 0; i < NUM_PAGES; i++)
         {
             unsigned int j;
             if (((ScriptCache *)*psc)->page[i])
@@ -3879,16 +3879,33 @@ HRESULT WINAPI ScriptStringGetOrder(SCRIPT_STRING_ANALYSIS ssa, UINT *order)
  *  Failure: a non-zero HRESULT.
  */
 HRESULT WINAPI ScriptGetLogicalWidths(const SCRIPT_ANALYSIS *sa, int nbchars, int nbglyphs,
-                                      const int *glyph_width, const WORD *log_clust,
+                                      const int *advances, const WORD *log_clust,
                                       const SCRIPT_VISATTR *sva, int *widths)
 {
-    int i;
+    int i, next = 0, direction;
 
     TRACE("(%p, %d, %d, %p, %p, %p, %p)\n",
-          sa, nbchars, nbglyphs, glyph_width, log_clust, sva, widths);
+          sa, nbchars, nbglyphs, advances, log_clust, sva, widths);
+
+    if (sa->fRTL && !sa->fLogicalOrder)
+        direction = -1;
+    else
+        direction = 1;
+
+    for (i = 0; i < nbchars; i++)
+    {
+        int clust_size = get_cluster_size(log_clust, nbchars, i, direction, NULL, NULL);
+        int advance = get_glyph_cluster_advance(advances, sva, log_clust, nbglyphs, nbchars, log_clust[i], direction);
+        int j;
+
+        for (j = 0; j < clust_size; j++)
+        {
+            widths[next] = advance / clust_size;
+            next++;
+            if (j) i++;
+        }
+    }
 
-    /* FIXME */
-    for (i = 0; i < nbchars; i++) widths[i] = glyph_width[i];
     return S_OK;
 }
 
index 2f5443e..242e47a 100644 (file)
 #define GLYPH_BLOCK_MASK  (GLYPH_BLOCK_SIZE - 1)
 #define GLYPH_MAX         65536
 
+#define NUM_PAGES         17
+
 #define GSUB_E_NOFEATURE -2
 #define GSUB_E_NOGLYPH -1
 
@@ -189,7 +191,7 @@ typedef struct {
     OUTLINETEXTMETRICW *otm;
     SCRIPT_FONTPROPERTIES sfp;
     BOOL sfnt;
-    CacheGlyphPage *page[0x11];
+    CacheGlyphPage *page[NUM_PAGES];
     ABC *widths[GLYPH_MAX / GLYPH_BLOCK_SIZE];
     LPVOID GSUB_Table;
     LPVOID GDEF_Table;
index 0c36fc6..7f83087 100644 (file)
@@ -189,7 +189,7 @@ reactos/dll/win32/twain_32            # Synced to WineStaging-1.9.11
 reactos/dll/win32/updspapi            # Synced to WineStaging-1.9.11
 reactos/dll/win32/url                 # Synced to WineStaging-1.9.11
 reactos/dll/win32/urlmon              # Synced to WineStaging-1.9.23
-reactos/dll/win32/usp10               # Synced to WineStaging-1.9.16
+reactos/dll/win32/usp10               # Synced to WineStaging-1.9.23
 reactos/dll/win32/uxtheme             # Forked
 reactos/dll/win32/vbscript            # Synced to WineStaging-1.9.11
 reactos/dll/win32/version             # Synced to WineStaging-1.9.11