shithub: freetype+ttf2subf

Download patch

ref: d22f5ec56304540fe5bc8be147150e39c5078778
parent: 467b026cd509b497c2d8bfd2ce350b62466f6964
author: Werner Lemberg <[email protected]>
date: Sat Feb 18 05:43:10 EST 2017

Formatting.

git/fs: mount .git/fs: mount/attach disallowed
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -342,12 +342,6 @@
   /*      this data when first opened.  This field exists only if          */
   /*      @FT_CONFIG_OPTION_INCREMENTAL is defined.                        */
   /*                                                                       */
-  /*    refcount ::                                                        */
-  /*      A counter initialized to~1 at the time an @FT_Face structure is  */
-  /*      created.  @FT_Reference_Face increments this counter, and        */
-  /*      @FT_Done_Face only destroys a face if the counter is~1,          */
-  /*      otherwise it simply decrements it.                               */
-  /*                                                                       */
   /*    no_stem_darkening ::                                               */
   /*      Overrides the module-level default, see @stem-darkening[cff],    */
   /*      for example.  FALSE and TRUE toggle stem darkening on and off,   */
@@ -357,11 +351,17 @@
   /*      Overrides the library default with custom weights for the 5-tap  */
   /*      FIR filter.  `{0, 0, 0, 0, 0}' means to use the library default. */
   /*                                                                       */
+  /*    refcount ::                                                        */
+  /*      A counter initialized to~1 at the time an @FT_Face structure is  */
+  /*      created.  @FT_Reference_Face increments this counter, and        */
+  /*      @FT_Done_Face only destroys a face if the counter is~1,          */
+  /*      otherwise it simply decrements it.                               */
+  /*                                                                       */
   typedef struct  FT_Face_InternalRec_
   {
-    FT_Matrix           transform_matrix;
-    FT_Vector           transform_delta;
-    FT_Int              transform_flags;
+    FT_Matrix  transform_matrix;
+    FT_Vector  transform_delta;
+    FT_Int     transform_flags;
 
     FT_ServiceCacheRec  services;
 
@@ -369,14 +369,13 @@
     FT_Incremental_InterfaceRec*  incremental_interface;
 #endif
 
-    FT_Int              refcount;
-
-    FT_Char             no_stem_darkening;
-
+    FT_Char              no_stem_darkening;
 #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
     FT_LcdFiveTapFilter  lcd_weights;  /* preset or custom filter weights */
 #endif
 
+    FT_Int  refcount;
+
   } FT_Face_InternalRec;
 
 
@@ -843,7 +842,7 @@
   /*                        handle to the current renderer for the         */
   /*                        FT_GLYPH_FORMAT_OUTLINE format.                */
   /*                                                                       */
-  /*    auto_hinter      :: XXX                                            */
+  /*    auto_hinter      :: The auto-hinter module interface.              */
   /*                                                                       */
   /*    raster_pool      :: The raster object's render pool.  This can     */
   /*                        ideally be changed dynamically at run-time.    */
@@ -850,7 +849,10 @@
   /*                                                                       */
   /*    raster_pool_size :: The size of the render pool in bytes.          */
   /*                                                                       */
-  /*    debug_hooks      :: XXX                                            */
+  /*    debug_hooks      :: An array of four function pointers that allow  */
+  /*                        debuggers to hook into a font format's         */
+  /*                        interpreter.  Currently, only the TrueType     */
+  /*                        bytecode debugger uses this.                   */
   /*                                                                       */
   /*    lcd_filter       :: If subpixel rendering is activated, the        */
   /*                        selected LCD filter mode.                      */
--- a/include/freetype/internal/tttypes.h
+++ b/include/freetype/internal/tttypes.h
@@ -1457,7 +1457,7 @@
 
     /***********************************************************************/
     /*                                                                     */
-    /* TrueType-specific fields (ignored by the OTF-Type2 driver)          */
+    /* TrueType-specific fields (ignored by the CFF driver)                */
     /*                                                                     */
     /***********************************************************************/
 
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -833,6 +833,7 @@
       {
         FT_UInt*  hinting_engine = (FT_UInt*)value;
 
+
         if ( *hinting_engine == FT_CFF_HINTING_ADOBE
 #ifdef CFF_CONFIG_OPTION_OLD_ENGINE
              || *hinting_engine == FT_CFF_HINTING_FREETYPE
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -684,62 +684,56 @@
       }
 #endif /* FT_DEBUG_LEVEL_TRACE */
 
-
-
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-
-    {
-      FT_Service_MultiMasters  mm = (FT_Service_MultiMasters)face->mm;
-
-      FT_Int  instance_index = face_index >> 16;
-
-
-      if ( FT_HAS_MULTIPLE_MASTERS( cffface ) &&
-           mm                                 &&
-           instance_index > 0                 )
       {
-        FT_MM_Var*  mm_var;
+        FT_Service_MultiMasters  mm = (FT_Service_MultiMasters)face->mm;
 
+        FT_Int  instance_index = face_index >> 16;
 
-        error = mm->get_mm_var( cffface, NULL );
-        if ( error )
-          goto Exit;
 
-        mm->get_var_blend( cffface, NULL, NULL, &mm_var );
-
-        if ( mm_var->namedstyle )
+        if ( FT_HAS_MULTIPLE_MASTERS( cffface ) &&
+             mm                                 &&
+             instance_index > 0                 )
         {
-          FT_Var_Named_Style*  named_style;
-          FT_String*           style_name;
+          FT_MM_Var*  mm_var;
 
 
-          /* in `face_index', the instance index starts with value 1 */
-          named_style = mm_var->namedstyle + instance_index - 1;
-          error = sfnt->get_name( face,
-                                  (FT_UShort)named_style->strid,
-                                  &style_name );
+          error = mm->get_mm_var( cffface, NULL );
           if ( error )
             goto Exit;
 
-          /* set style name; if already set, replace it */
-          if ( face->root.style_name )
-            FT_FREE( face->root.style_name );
-          face->root.style_name = style_name;
+          mm->get_var_blend( cffface, NULL, NULL, &mm_var );
 
-          /* finally, select the named instance */
-          error = mm->set_var_design( cffface,
-                                      mm_var->num_axis,
-                                      named_style->coords );
-          if ( error )
-            goto Exit;
-        }
-      }
-    }
+          if ( mm_var->namedstyle )
+          {
+            FT_Var_Named_Style*  named_style;
+            FT_String*           style_name;
 
-#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
 
+            /* in `face_index', the instance index starts with value 1 */
+            named_style = mm_var->namedstyle + instance_index - 1;
+            error = sfnt->get_name( face,
+                                    (FT_UShort)named_style->strid,
+                                    &style_name );
+            if ( error )
+              goto Exit;
 
+            /* set style name; if already set, replace it */
+            if ( face->root.style_name )
+              FT_FREE( face->root.style_name );
+            face->root.style_name = style_name;
 
+            /* finally, select the named instance */
+            error = mm->set_var_design( cffface,
+                                        mm_var->num_axis,
+                                        named_style->coords );
+            if ( error )
+              goto Exit;
+          }
+        }
+      }
+#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
+
       if ( !dict->has_font_matrix )
         dict->units_per_em = pure_cff ? 1000 : face->root.units_per_EM;
 
@@ -1022,7 +1016,6 @@
         cffface->style_flags = flags;
       }
 
-
 #ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
       /* CID-keyed CFF fonts don't have glyph names -- the SFNT loader */
       /* has unset this flag because of the 3.0 `post' table.          */
@@ -1032,7 +1025,6 @@
 
       if ( dict->cid_registry != 0xFFFFU && pure_cff )
         cffface->face_flags |= FT_FACE_FLAG_CID_KEYED;
-
 
       /*******************************************************************/
       /*                                                                 */
--- a/src/cff/cffobjs.h
+++ b/src/cff/cffobjs.h
@@ -118,10 +118,9 @@
   {
     FT_DriverRec  root;
 
-    FT_UInt  hinting_engine;
-    FT_Bool  no_stem_darkening;
-
-    FT_Int  darken_params[8];
+    FT_UInt   hinting_engine;
+    FT_Bool   no_stem_darkening;
+    FT_Int    darken_params[8];
 
   } CFF_DriverRec;
 
--- a/src/cff/cfftypes.h
+++ b/src/cff/cfftypes.h
@@ -389,6 +389,7 @@
     /* since version 2.4.12 */
     FT_Generic       cf2_instance;
 
+    /* since version 2.7.1 */
     CFF_VStoreRec    vstore;        /* parsed vstore structure */
 
   } CFF_FontRec;