shithub: freetype+ttf2subf

Download patch

ref: 332da87d99947c47db93def43b50fdbe63a1bef6
parent: dcdb3167dcd4bd3ffc98b47062109e6b2fca1272
author: Werner Lemberg <[email protected]>
date: Sun Jan 23 07:42:23 EST 2011

[autofit] Some formatting and clean-ups.

git/fs: mount .git/fs: mount/attach disallowed
--- a/src/autofit/afangles.c
+++ b/src/autofit/afangles.c
@@ -5,7 +5,7 @@
 /*    Routines used to compute vector angles with limited accuracy         */
 /*    and very high speed.  It also contains sorting routines (body).      */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006 by                                    */
+/*  Copyright 2003-2006, 2011 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -77,7 +77,7 @@
       return 1 - 2 * ( delta < 0 );
   }
 
-#endif
+#endif /* 0 */
 
 
   /*
--- a/src/autofit/afdummy.c
+++ b/src/autofit/afdummy.c
@@ -5,7 +5,7 @@
 /*    Auto-fitter dummy routines to be used if no hinting should be        */
 /*    performed (body).                                                    */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005 by                                          */
+/*  Copyright 2003-2005, 2011 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -27,7 +27,7 @@
   {
     af_glyph_hints_rescale( hints,
                             metrics );
-    return 0;
+    return AF_Err_Ok;
   }
 
 
@@ -38,11 +38,11 @@
     FT_UNUSED( hints );
     FT_UNUSED( outline );
 
-    return 0;
+    return AF_Err_Ok;
   }
 
 
-  AF_DEFINE_SCRIPT_CLASS(af_dummy_script_class,
+  AF_DEFINE_SCRIPT_CLASS( af_dummy_script_class,
     AF_SCRIPT_NONE,
     NULL,
 
--- a/src/autofit/afdummy.h
+++ b/src/autofit/afdummy.h
@@ -5,7 +5,7 @@
 /*    Auto-fitter dummy routines to be used if no hinting should be        */
 /*    performed (specification).                                           */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005 by                                          */
+/*  Copyright 2003-2005, 2011 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -29,7 +29,7 @@
   *  be performed.  This is the default for non-latin glyphs!
   */
 
-  AF_DECLARE_SCRIPT_CLASS(af_dummy_script_class)
+  AF_DECLARE_SCRIPT_CLASS( af_dummy_script_class )
 
 /* */
 
--- a/src/autofit/afglobal.c
+++ b/src/autofit/afglobal.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter routines to compute global hinting values (body).        */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by            */
+/*  Copyright 2003-2011 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -31,8 +31,8 @@
 
 #ifndef FT_CONFIG_OPTION_PIC
 
-/* when updating this table, don't forget to update 
-  AF_SCRIPT_CLASSES_COUNT and autofit_module_class_pic_init */
+  /* when updating this table, don't forget to update          */
+  /* AF_SCRIPT_CLASSES_COUNT and autofit_module_class_pic_init */
 
   /* populate this list when you add new scripts */
   static AF_ScriptClass const  af_script_classes[] =
@@ -47,7 +47,7 @@
     NULL  /* do not remove */
   };
 
-#endif /* FT_CONFIG_OPTION_PIC */
+#endif /* !FT_CONFIG_OPTION_PIC */
 
   /* index of default script in `af_script_classes' */
 #define AF_SCRIPT_LIST_DEFAULT  2
@@ -85,7 +85,7 @@
     FT_UInt     ss, i;
 
 
-    /* the value 255 means `uncovered glyph' */
+    /* the value AF_SCRIPT_LIST_NONE means `uncovered glyph' */
     FT_MEM_SET( globals->glyph_scripts,
                 AF_SCRIPT_LIST_NONE,
                 globals->glyph_count );
@@ -126,9 +126,7 @@
         if ( gindex != 0                             &&
              gindex < (FT_ULong)globals->glyph_count &&
              gscripts[gindex] == AF_SCRIPT_LIST_NONE )
-        {
           gscripts[gindex] = (FT_Byte)ss;
-        }
 
         for (;;)
         {
@@ -139,9 +137,7 @@
 
           if ( gindex < (FT_ULong)globals->glyph_count &&
                gscripts[gindex] == AF_SCRIPT_LIST_NONE )
-          {
             gscripts[gindex] = (FT_Byte)ss;
-          }
         }
       }
     }
--- a/src/autofit/aftypes.h
+++ b/src/autofit/aftypes.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter types (specification only).                              */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by                  */
+/*  Copyright 2003-2009, 2011 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -241,7 +241,7 @@
   /*************************************************************************/
 
   /*
-   *  The list of know scripts.  Each different script corresponds to the
+   *  The list of known scripts.  Each different script corresponds to the
    *  following information:
    *
    *   - A set of Unicode ranges to test whether the face supports the
@@ -342,55 +342,57 @@
 
   } AF_ScriptClassRec;
 
-/* Declare and define vtables for classes */
+
+  /* Declare and define vtables for classes */
 #ifndef FT_CONFIG_OPTION_PIC
 
-#define AF_DECLARE_SCRIPT_CLASS(script_class)                                \
-  FT_CALLBACK_TABLE const AF_ScriptClassRec                                  \
+#define AF_DECLARE_SCRIPT_CLASS( script_class ) \
+  FT_CALLBACK_TABLE const AF_ScriptClassRec     \
   script_class;
 
-#define AF_DEFINE_SCRIPT_CLASS(script_class, script_, ranges, m_size,        \
-                               m_init, m_scale, m_done, h_init, h_apply)     \
-  FT_CALLBACK_TABLE_DEF const AF_ScriptClassRec                              \
-  script_class =                                                             \
-  {                                                                          \
-    script_,                                                                 \
-    ranges,                                                                  \
-                                                                             \
-    m_size,                                                                  \
-                                                                             \
-    m_init,                                                                  \
-    m_scale,                                                                 \
-    m_done,                                                                  \
-                                                                             \
-    h_init,                                                                  \
-    h_apply                                                                  \
+#define AF_DEFINE_SCRIPT_CLASS( script_class, script_, ranges, m_size,     \
+                                m_init, m_scale, m_done, h_init, h_apply ) \
+  FT_CALLBACK_TABLE_DEF const AF_ScriptClassRec                            \
+  script_class =                                                           \
+  {                                                                        \
+    script_,                                                               \
+    ranges,                                                                \
+                                                                           \
+    m_size,                                                                \
+                                                                           \
+    m_init,                                                                \
+    m_scale,                                                               \
+    m_done,                                                                \
+                                                                           \
+    h_init,                                                                \
+    h_apply                                                                \
   };
 
-#else 
+#else /* FT_CONFIG_OPTION_PIC */
 
-#define AF_DECLARE_SCRIPT_CLASS(script_class)                                \
-  FT_LOCAL(void)                                                             \
-  FT_Init_Class_##script_class(AF_ScriptClassRec* ac);
+#define AF_DECLARE_SCRIPT_CLASS( script_class )          \
+  FT_LOCAL( void )                                       \
+  FT_Init_Class_##script_class( AF_ScriptClassRec* ac );
 
-#define AF_DEFINE_SCRIPT_CLASS(script_class, script_, ranges, m_size,        \
-                               m_init, m_scale, m_done, h_init, h_apply)     \
-  FT_LOCAL_DEF(void)                                                         \
-  FT_Init_Class_##script_class(AF_ScriptClassRec* ac)                        \
-  {                                                                          \
-    ac->script                = script_;                                     \
-    ac->script_uni_ranges     = ranges;                                      \
-                                                                             \
-    ac->script_metrics_size   = m_size;                                      \
-                                                                             \
-    ac->script_metrics_init   = m_init;                                      \
-    ac->script_metrics_scale  = m_scale;                                     \
-    ac->script_metrics_done   = m_done;                                      \
-                                                                             \
-    ac->script_hints_init     = h_init;                                      \
-    ac->script_hints_apply    = h_apply;                                     \
+#define AF_DEFINE_SCRIPT_CLASS( script_class, script_, ranges, m_size,     \
+                                m_init, m_scale, m_done, h_init, h_apply ) \
+  FT_LOCAL_DEF( void )                                                     \
+  FT_Init_Class_##script_class( AF_ScriptClassRec* ac )                    \
+  {                                                                        \
+    ac->script               = script_;                                    \
+    ac->script_uni_ranges    = ranges;                                     \
+                                                                           \
+    ac->script_metrics_size  = m_size;                                     \
+                                                                           \
+    ac->script_metrics_init  = m_init;                                     \
+    ac->script_metrics_scale = m_scale;                                    \
+    ac->script_metrics_done  = m_done;                                     \
+                                                                           \
+    ac->script_hints_init    = h_init;                                     \
+    ac->script_hints_apply   = h_apply;                                    \
   }
-#endif
+
+#endif /* FT_CONFIG_OPTION_PIC */
 
 
 /* */