[WIN32SS][NTGDI] Correctly get/update ptlCurrent about TA_UPDATECP
[reactos.git] / win32ss / gdi / ntgdi / freetype.c
index a613a9f..f73c1c0 100644 (file)
@@ -2821,7 +2821,13 @@ GetFontFamilyInfoForSubstitutes(const LOGFONTW *LogFont,
         GetFontFamilyInfoForList(&lf, Info, pFromW->Buffer, pCount, MaxCount,
                                  &Win32Process->PrivateFontListHead);
         IntUnLockProcessPrivateFonts(Win32Process);
-        break;
+
+        if (LogFont->lfFaceName[0] != UNICODE_NULL)
+        {
+            /* it's already matched to the exact name and charset if the name
+               was specified at here, then so don't scan more for another name */
+            break;
+        }
     }
 
     return TRUE;
@@ -3306,10 +3312,7 @@ IntRequestFontSize(PDC dc, PFONTGDI FontGDI, LONG lfWidth, LONG lfHeight)
     FontGDI->EmHeight = min(FontGDI->EmHeight, USHORT_MAX);
     FontGDI->Magic = FONTGDI_MAGIC;
 
-    if (lfHeight > 0)
-        EmHeight64 = (FontGDI->EmHeight << 6) + 31;
-    else
-        EmHeight64 = (FontGDI->EmHeight << 6);
+    EmHeight64 = (FontGDI->EmHeight << 6);
 
     req.type           = FT_SIZE_REQUEST_TYPE_NOMINAL;
     req.width          = 0;
@@ -4484,7 +4487,7 @@ GetFontPenalty(const LOGFONTW *               LogFont,
 
     ActualNameW = (WCHAR*)((ULONG_PTR)Otm + (ULONG_PTR)Otm->otmpFamilyName);
 
-    if (LogFont->lfFaceName[0])
+    if (LogFont->lfFaceName[0] != UNICODE_NULL)
     {
         BOOL Found = FALSE;
 
@@ -5664,9 +5667,10 @@ IntExtTextOutW(
 
     if (pdcattr->flTextAlign & TA_UPDATECP)
     {
-        Start.x = pdcattr->ptlCurrent.x;
-        Start.y = pdcattr->ptlCurrent.y;
-    } else {
+        IntGetCurrentPositionEx(dc, &Start);
+    }
+    else
+    {
         Start.x = XStart;
         Start.y = YStart;
     }
@@ -6303,8 +6307,13 @@ IntExtTextOutW(
             MouseSafetyOnDrawEnd(dc->ppdev);
     }
 
-    if (pdcattr->flTextAlign & TA_UPDATECP) {
-        pdcattr->ptlCurrent.x = DestRect.right - dc->ptlDCOrig.x;
+    if (pdcattr->flTextAlign & TA_UPDATECP)
+    {
+        pdcattr->ptlCurrent.x = vecs[2].x - dc->ptlDCOrig.x;
+        pdcattr->ptlCurrent.y = vecs[2].y - dc->ptlDCOrig.y;
+        IntDPtoLP(dc, &pdcattr->ptlCurrent, 1);
+        pdcattr->ulDirty_ &= ~DIRTY_PTLCURRENT;
+        pdcattr->ulDirty_ |= (DIRTY_PTFXCURRENT | DIRTY_STYLESTATE);
     }
 
     IntUnLockFreeType();