[FREETYPE] Update to v2.9.0 and use this as a chance to slim down our lib a bit....
[reactos.git] / sdk / lib / 3rdparty / freetype / src / psaux / psfont.c
similarity index 91%
rename from sdk/lib/3rdparty/freetype/src/cff/cf2font.c
rename to sdk/lib/3rdparty/freetype/src/psaux/psfont.c
index 4ac71a8..dde67a7 100644 (file)
@@ -1,6 +1,6 @@
 /***************************************************************************/
 /*                                                                         */
-/*  cf2font.c                                                              */
+/*  psfont.c                                                               */
 /*                                                                         */
 /*    Adobe's code for font instances (body).                              */
 /*                                                                         */
 #include <ft2build.h>
 #include FT_INTERNAL_CALC_H
 
-#include "cf2ft.h"
+#include "psft.h"
 
-#include "cf2glue.h"
-#include "cf2font.h"
-#include "cf2error.h"
-#include "cf2intrp.h"
+#include "psglue.h"
+#include "psfont.h"
+#include "pserror.h"
+#include "psintrp.h"
 
 
   /* Compute a stem darkening amount in character space. */
                   const CF2_Matrix*  transform )
   {
     /* pointer to parsed font object */
-    CFF_Decoder*  decoder = font->decoder;
+    PS_Decoder*  decoder = font->decoder;
 
     FT_Bool  needExtraSetup = FALSE;
 
     CF2_UInt   lenNormalizedV = 0;
     FT_Fixed*  normalizedV    = NULL;
 
-
     /* clear previous error */
     font->error = FT_Err_Ok;
 
       needExtraSetup    = TRUE;
     }
 
-    /* check for variation vectors */
-    vstore        = cf2_getVStore( decoder );
-    hasVariations = ( vstore->dataCount != 0 );
-
-    if ( hasVariations )
+    if ( !font->isT1 )
     {
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-      /* check whether Private DICT in this subfont needs to be reparsed */
-      font->error = cf2_getNormalizedVector( decoder,
-                                             &lenNormalizedV,
-                                             &normalizedV );
-      if ( font->error )
-        return;
+      FT_Service_CFFLoad  cffload = (FT_Service_CFFLoad)font->cffload;
+
+
+      /* check for variation vectors */
+      vstore        = cf2_getVStore( decoder );
+      hasVariations = ( vstore->dataCount != 0 );
 
-      if ( cff_blend_check_vector( &subFont->blend,
-                                   subFont->private_dict.vsindex,
-                                   lenNormalizedV,
-                                   normalizedV ) )
+      if ( hasVariations )
       {
-        /* blend has changed, reparse */
-        cff_load_private_dict( decoder->cff,
-                               subFont,
-                               lenNormalizedV,
-                               normalizedV );
-        needExtraSetup = TRUE;
-      }
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+        /* check whether Private DICT in this subfont needs to be reparsed */
+        font->error = cf2_getNormalizedVector( decoder,
+                                               &lenNormalizedV,
+                                               &normalizedV );
+        if ( font->error )
+          return;
+
+        if ( cffload->blend_check_vector( &subFont->blend,
+                                          subFont->private_dict.vsindex,
+                                          lenNormalizedV,
+                                          normalizedV ) )
+        {
+          /* blend has changed, reparse */
+          cffload->load_private_dict( decoder->cff,
+                                      subFont,
+                                      lenNormalizedV,
+                                      normalizedV );
+          needExtraSetup = TRUE;
+        }
 #endif
 
-      /* copy from subfont */
-      font->blend.font = subFont->blend.font;
+        /* copy from subfont */
+        font->blend.font = subFont->blend.font;
 
-      /* clear state of charstring blend */
-      font->blend.usedBV = FALSE;
+        /* clear state of charstring blend */
+        font->blend.usedBV = FALSE;
 
-      /* initialize value for charstring */
-      font->vsindex = subFont->private_dict.vsindex;
+        /* initialize value for charstring */
+        font->vsindex = subFont->private_dict.vsindex;
 
-      /* store vector inputs for blends in charstring */
-      font->lenNDV = lenNormalizedV;
-      font->NDV    = normalizedV;
+        /* store vector inputs for blends in charstring */
+        font->lenNDV = lenNormalizedV;
+        font->NDV    = normalizedV;
+      }
     }
 
     /* if ppem has changed, we need to recompute some cached data         */