[USP10] Sync with Wine Staging 2.16. CORE-13762
[reactos.git] / reactos / dll / win32 / usp10 / usp10.c
index a563b85..89e85df 100644 (file)
@@ -952,7 +952,7 @@ static enum usp10_script get_char_script(const WCHAR *str, unsigned int index,
 
     if (!(range = bsearch(&ch, script_ranges, ARRAY_SIZE(script_ranges),
             sizeof(*script_ranges), usp10_compare_script_range)))
-        return Script_Undefined;
+        return (*consumed == 2) ? Script_Surrogates : Script_Undefined;
 
     if (range->numericScript && (type & C1_DIGIT || type2 == C2_ARABICNUMBER))
         return range->numericScript;
@@ -1817,7 +1817,12 @@ static inline int getGivenTabWidth(ScriptCache *psc, SCRIPT_TABDEF *pTabdef, int
         cTabStops = 0;
     }
     else
-        defWidth = 8 * psc->tm.tmAveCharWidth;
+    {
+        if (pTabdef->iScale)
+            defWidth = (32 * pTabdef->iScale) / 4;
+        else
+            defWidth = 8 * psc->tm.tmAveCharWidth;
+    }
 
     for (; cTabStops>0 ; lpTabPos++, cTabStops--)
     {
@@ -1831,10 +1836,10 @@ static inline int getGivenTabWidth(ScriptCache *psc, SCRIPT_TABDEF *pTabdef, int
 
         if( nTabOrg + position > current_x)
         {
-            if( *lpTabPos >= 0)
+            if( position >= 0)
             {
                 /* a left aligned tab */
-                x = (nTabOrg + *lpTabPos) - current_x;
+                x = (nTabOrg + position) - current_x;
                 break;
             }
             else