[WIN32SS:NTGDI] Fix missing text in labels and buttons for .NET apps. CORE-15000
[reactos.git] / win32ss / gdi / ntgdi / freetype.c
index 7aa65f2..5f9b221 100644 (file)
@@ -50,16 +50,6 @@ static const FT_Matrix identityMat = {(1 << 16), 0, 0, (1 << 16)};
 
 FT_Library  g_FreeTypeLibrary;
 
-typedef struct
-{
-    FT_Int major;
-    FT_Int minor;
-    FT_Int patch;
-} FT_Version_t;
-static FT_Version_t FT_Version;
-static DWORD FT_SimpleVersion;
-#define FT_VERSION_VALUE(major, minor, patch) (((major) << 16) | ((minor) << 8) | (patch))
-
 /* special font names */
 static const UNICODE_STRING g_MarlettW = RTL_CONSTANT_STRING(L"Marlett");
 
@@ -651,13 +641,6 @@ InitFontSupport(VOID)
         return FALSE;
     }
 
-    FT_Library_Version(g_FreeTypeLibrary,&FT_Version.major,&FT_Version.minor,&FT_Version.patch);
-
-    DPRINT1("FreeType version is %d.%d.%d\n",FT_Version.major,FT_Version.minor,FT_Version.patch);
-    FT_SimpleVersion = ((FT_Version.major << 16) & 0xff0000) |
-                       ((FT_Version.minor <<  8) & 0x00ff00) |
-                       ((FT_Version.patch      ) & 0x0000ff);
-
     IntLoadSystemFonts();
     IntLoadFontSubstList(&g_FontSubstListHead);
 
@@ -1655,40 +1638,10 @@ IntGdiCleanupPrivateFontsForProcess(VOID)
     } while (Entry);
 }
 
-static BOOL is_hinting_enabled(void)
-{
-    static int enabled = -1;
-
-    if (enabled == -1)
-    {
-        /* Use the >= 2.2.0 function if available */
-        FT_TrueTypeEngineType type = FT_Get_TrueType_Engine_Type(g_FreeTypeLibrary);
-        enabled = (type == FT_TRUETYPE_ENGINE_TYPE_PATENTED);
-
-        DPRINT1("hinting is %senabled\n", enabled ? "" : "NOT ");
-    }
-    return enabled;
-}
-
-static BOOL is_subpixel_rendering_enabled( void )
-{
-    static int enabled = -1;
-    if (enabled == -1)
-    {
-        /* FreeType >= 2.8.1 offers LCD-optimezed rendering without lcd filters. */
-        if (FT_SimpleVersion >= FT_VERSION_VALUE(2, 8, 1))
-            enabled = TRUE;
-        else enabled = FALSE;
-
-        DPRINT1("subpixel rendering is %senabled\n", enabled ? "" : "NOT ");
-    }
-    return enabled;
-}
-
 BOOL FASTCALL
 IntIsFontRenderingEnabled(VOID)
 {
-    return is_hinting_enabled() && is_subpixel_rendering_enabled() && g_RenderingEnabled;
+    return (gpsi->BitsPixel > 8) && g_RenderingEnabled;
 }
 
 VOID FASTCALL
@@ -3740,6 +3693,7 @@ ftGdiGetGlyphOutline(
     switch (iFormat)
     {
     case GGO_BITMAP:
+    {
         width = gm.gmBlackBoxX;
         height = gm.gmBlackBoxY;
         pitch = ((width + 31) >> 5) << 2;
@@ -3767,6 +3721,7 @@ ftGdiGetGlyphOutline(
         }
 
         case ft_glyph_format_outline:
+        {
             ft_bitmap.width = width;
             ft_bitmap.rows = height;
             ft_bitmap.pitch = pitch;
@@ -3784,12 +3739,15 @@ ftGdiGetGlyphOutline(
             FT_Outline_Get_Bitmap(g_FreeTypeLibrary, &ft_face->glyph->outline, &ft_bitmap);
             IntUnLockFreeType();
             break;
+        }
 
         default:
             DPRINT1("Loaded glyph format %x\n", ft_face->glyph->format);
             return GDI_ERROR;
         }
+
         break;
+    }
 
     case GGO_GRAY2_BITMAP:
     case GGO_GRAY4_BITMAP:
@@ -3875,6 +3833,8 @@ ftGdiGetGlyphOutline(
             DPRINT1("Loaded glyph format %x\n", ft_face->glyph->format);
             return GDI_ERROR;
         }
+
+        break;
     }
 
     case GGO_NATIVE:
@@ -3902,6 +3862,7 @@ ftGdiGetGlyphOutline(
         IntUnLockFreeType();
         break;
     }
+
     case GGO_BEZIER:
     {
         FT_Outline *outline = &ft_face->glyph->outline;
@@ -5616,7 +5577,6 @@ IntExtTextOutW(
                               String,
                               Count,
                               (const INT *)Dx);
-        DC_UnlockDc(dc);
         return bResult;
     }
 
@@ -5862,7 +5822,7 @@ IntExtTextOutW(
     if ((fuOptions & ETO_OPAQUE) && (dc->pdcattr->ulDirty_ & DIRTY_BACKGROUND))
         DC_vUpdateBackgroundBrush(dc) ;
 
-    if(dc->pdcattr->ulDirty_ & DIRTY_TEXT)
+    if (dc->pdcattr->ulDirty_ & DIRTY_TEXT)
         DC_vUpdateTextBrush(dc) ;
 
     thickness = 1;