[NtGDI] Change TextOut
[reactos.git] / win32ss / gdi / ntgdi / font.c
index 7d1aebb..a48904c 100644 (file)
@@ -109,7 +109,7 @@ GreGetKerningPairs(
   currently selected font. If not valid, GetCharacterPlacement ignores the
   value.
 
-  M$ must use a preset "compiled in" support for each language based releases.
+  MS must use a preset "compiled in" support for each language based releases.
   ReactOS uses FreeType, this will need to be supported. ATM this is hard coded
   for GCPCLASS_LATIN!
 
@@ -293,7 +293,22 @@ FASTCALL
 FontGetObject(PTEXTOBJ plfont, ULONG cjBuffer, PVOID pvBuffer)
 {
     ULONG cjMaxSize;
-    ENUMLOGFONTEXDVW *plf = &plfont->logfont;
+    ENUMLOGFONTEXDVW *plf;
+
+    ASSERT(plfont);
+    plf = &plfont->logfont;
+
+    if (!(plfont->fl & TEXTOBJECT_INIT))
+    {
+        NTSTATUS Status;
+        DPRINT1("FontGetObject font not initialized!\n");
+
+        Status = TextIntRealizeFont(plfont->BaseObject.hHmgr, plfont);
+        if (!NT_SUCCESS(Status))
+        {
+            DPRINT1("FontGetObject(TextIntRealizeFont) Status = 0x%lx\n", Status);
+        }
+    }
 
     /* If buffer is NULL, only the size is requested */
     if (pvBuffer == NULL) return sizeof(LOGFONTW);
@@ -395,7 +410,7 @@ IntGetFontLanguageInfo(PDC Dc)
   pdcattr = Dc->pdcattr;
 
   /* This might need a test for a HEBREW- or ARABIC_CHARSET as well */
-  if ( pdcattr->lTextAlign & TA_RTLREADING )
+  if ( pdcattr->flTextAlign & TA_RTLREADING )
      if( (fontsig.fsCsb[0]&GCP_REORDER_MASK)!=0 )
                     result|=GCP_REORDER;
 
@@ -1069,6 +1084,7 @@ NtGdiGetRealizationInfo(
   }
   pdcattr = pDc->pdcattr;
   pTextObj = RealizeFontInit(pdcattr->hlfntNew);
+  ASSERT(pTextObj != NULL);
   pFontGdi = ObjToGDI(pTextObj->Font, FONT);
   TEXTOBJ_UnlockText(pTextObj);
   DC_UnlockDc(pDc);