Commit d41aecdbc0c71a6660e5e037605529b9a0f6f4fe

Werner Lemberg 2006-02-21T08:08:14

formatting, doc improvements

diff --git a/ChangeLog b/ChangeLog
index 584668a..ad87fee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,14 +1,22 @@
 2006-02-20  David Turner  <david@freetype.org>
 
-        * include/freetype/internal/sfnt.h, src/sfnt/sfdriver.c,
-        src/sfnt/ttsbit.h, src/sfnt/ttsbit.c: moving the definition
-        of 'set_sbit_strike' and 'load_sbit_metrics' to their 2.1.8
-        location. This is used to support binary compatibility with
-        the X.Org server's libXfont library.
+	Support binary compatibility with the X.Org server's Xfont library. 
+	Note that this change unfortunately prevents memory optimizations
+	for the embedded bitmap loader.
 
-        note that this disables memory optimizations for the embedded
-        bitmap loader.Sigh....
+	* include/freetype/internal/sfnt.h (SFNT_Interface): Move
+	`set_sbit_strike' and `load_sbit_metrics' fields to the location of
+	version 2.1.8.
 
+	* src/sfnt/sfdriver.c (tt_face_set_sbit_strike_stub): Call
+	FT_Size_Request.
+	(sfnt_interface): Updated.
+
+	* src/sfnt/ttsbit.c [FT_CONFIG_OPTION_OLD_INTERNALS]: Don't load
+	ttsbit0.c.
+	(tt_load_sbit_metrics): Make `sbit_small_metrics_fields' static.
+
+	* src/sfnt/ttsbit.h: Updated.
 
 2006-02-17  David Turner  <david@freetype.org>
 
diff --git a/include/freetype/internal/sfnt.h b/include/freetype/internal/sfnt.h
index 63b421d..b88607a 100644
--- a/include/freetype/internal/sfnt.h
+++ b/include/freetype/internal/sfnt.h
@@ -690,24 +690,27 @@ FT_BEGIN_HEADER
     /* version 2.1.10                                                   */
     TT_Load_Table_Func           load_bhed;
 
-    /* see `ttsbit.h' */
 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
+
+    /* see `ttsbit.h' */
     TT_Set_SBit_Strike_OldFunc   set_sbit_strike_stub;
     TT_Load_Table_Func           load_sbits_stub;
 
-    /* The following two fields only appeared in 2.1.8, and were placed between
-     * 'load_sbits' and 'load_sbit_image'. We support them as a special exception
-     * since they're used by libXfont within the X.Org xserver, and because the
-     * probability that other rogue clients use the other 2.1.7 fields below
-     * is _extremely_ low.
+    /*
+     *  The following two fields appeared in version 2.1.8, and were placed
+     *  between `load_sbits' and `load_sbit_image'.  We support them as a
+     *  special exception since they are used by Xfont library within the
+     *  X.Org xserver, and because the probability that other rogue clients
+     *  use the other version 2.1.7 fields below is _extremely_ low.
      *
-     * Note that this forces us to disable an interesting memory-saving optimization
-     * though...
+     *  Note that this forces us to disable an interesting memory-saving
+     *  optimization though...
      */
+
     TT_Find_SBit_Image_Func      find_sbit_image;
     TT_Load_SBit_Metrics_Func    load_sbit_metrics;
-#endif
 
+#endif
 
     TT_Load_SBit_Image_Func      load_sbit_image;
 
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index e394b31..9f4bbcf 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -430,17 +430,20 @@
                                 FT_UInt    y_ppem,
                                 FT_ULong*  astrike_index )
   {
-    /* we simply forge a FT_Size_Request and call the real function
-     * that does all the work
+    /*
+     * We simply forge a FT_Size_Request and call the real function
+     * that does all the work.
      *
-     * this stub might be called by libXfont in the X.Org Xserver
-     * that was compiled against FT 2.1.8 or later.
+     * This stub might be called by libXfont in the X.Org Xserver,
+     * compiled against version 2.1.8 or newer.
      */
+
     FT_Size_RequestRec  req;
 
+
     req.type           = FT_SIZE_REQUEST_TYPE_NOMINAL;
-    req.width          = (FT_F26Dot6) x_ppem;
-    req.height         = (FT_F26Dot6) y_ppem;
+    req.width          = (FT_F26Dot6)x_ppem;
+    req.height         = (FT_F26Dot6)y_ppem;
     req.horiResolution = 0;
     req.vertResolution = 0;
 
@@ -457,11 +460,12 @@
     FT_UNUSED( face );
     FT_UNUSED( stream );
     
-   /* this function was originally implemented to load the sbit
-    * table. However, it has been replaced by 'tt_face_load_eblc'
-    * and this stub is only there for crazy rogue clients who
-    * would want to call it directly (which would be stupid)
-    */
+    /*
+     *  This function was originally implemented to load the sbit table. 
+     *  However, it has been replaced by `tt_face_load_eblc', and this stub
+     *  is only there for some rogue clients which would want to call it
+     *  directly (which doesn't make much sense).
+     */
     return FT_Err_Unimplemented_Feature;
   }                          
 
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index fc050cc..21f30ef 100644
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -20,11 +20,14 @@
 #include FT_INTERNAL_STREAM_H
 #include FT_TRUETYPE_TAGS_H
 
-/* Alas, the memory-optimized sbit loader can't be used when implementing
- * the 'old internals' hack !!
- */
+  /*
+   *  Alas, the memory-optimized sbit loader can't be used when implementing
+   *  the `old internals' hack
+   */
 #if defined FT_OPTIMIZE_MEMORY && !defined FT_CONFIG_OPTION_OLD_INTERNALS
+
 #include "ttsbit0.c"
+
 #else /* !OPTIMIZE_MEMORY || OLD_INTERNALS */
 
 #include <ft2build.h>