Commit 314f35ad2e8931f9061566fa224f6fbec8dfdb41

Werner Lemberg 2009-04-04T09:20:14

ftnames.c -> ftsnames.c * src/base/ftnames.c: Rename to... * src/base/ftsnames.c: This. * src/base/Jamfile, src/base/rules.mk, src/base/ftbase.c: Updated.

diff --git a/ChangeLog b/ChangeLog
index dfc0552..b48436c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2009-04-04  Werner Lemberg  <wl@gnu.org>
 
+	ftnames.c -> ftsnames.c
+
+	* src/base/ftnames.c: Rename to...
+	* src/base/ftsnames.c: This.
+	* src/base/Jamfile, src/base/rules.mk, src/base/ftbase.c: Updated.
+
+2009-04-04  Werner Lemberg  <wl@gnu.org>
+
 	Add support for cmap type 13.
 
 	* devel/ftoption.h, include/freetype/config/ftoption.h
diff --git a/devel/ftoption.h b/devel/ftoption.h
index d415e28..2021011 100644
--- a/devel/ftoption.h
+++ b/devel/ftoption.h
@@ -439,7 +439,7 @@ FT_BEGIN_HEADER
   /* does not contain any glyph name though.                               */
   /*                                                                       */
   /* Accessing SFNT names is done through the functions declared in        */
-  /* `freetype/ftnames.h'.                                                 */
+  /* `freetype/ftsnames.h'.                                                */
   /*                                                                       */
 #define TT_CONFIG_OPTION_SFNT_NAMES
 
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index 9470f72..b5bc769 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -439,7 +439,7 @@ FT_BEGIN_HEADER
   /* does not contain any glyph name though.                               */
   /*                                                                       */
   /* Accessing SFNT names is done through the functions declared in        */
-  /* `freetype/ftnames.h'.                                                 */
+  /* `freetype/ftsnames.h'.                                                */
   /*                                                                       */
 #define TT_CONFIG_OPTION_SFNT_NAMES
 
diff --git a/src/base/Jamfile b/src/base/Jamfile
index aba60fb..de327bd 100644
--- a/src/base/Jamfile
+++ b/src/base/Jamfile
@@ -18,7 +18,7 @@ SubDir  FT2_TOP $(FT2_SRC_DIR) base ;
   if $(FT2_MULTI)
   {
     _sources = ftadvanc ftcalc   ftdbgmem ftgloadr
-               ftnames  ftobjs   ftoutln  ftrfork
+               ftobjs   ftoutln  ftrfork  ftsnames
                ftstream fttrigon ftutil
                ;
   }
diff --git a/src/base/ftbase.c b/src/base/ftbase.c
index d1fe6e6..b666c7d 100644
--- a/src/base/ftbase.c
+++ b/src/base/ftbase.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Single object library component (body only).                         */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008 by             */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -24,10 +24,10 @@
 #include "ftcalc.c"
 #include "ftdbgmem.c"
 #include "ftgloadr.c"
-#include "ftnames.c"
 #include "ftobjs.c"
 #include "ftoutln.c"
 #include "ftrfork.c"
+#include "ftsnames.c"
 #include "ftstream.c"
 #include "fttrigon.c"
 #include "ftutil.c"
diff --git a/src/base/ftnames.c b/src/base/ftnames.c
deleted file mode 100644
index 6a6417a..0000000
--- a/src/base/ftnames.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ftnames.c                                                              */
-/*                                                                         */
-/*    Simple interface to access SFNT name tables (which are used          */
-/*    to hold font names, copyright info, notices, etc.) (body).           */
-/*                                                                         */
-/*    This is _not_ used to retrieve glyph names!                          */
-/*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
-/*                                                                         */
-/*  This file is part of the FreeType project, and may only be used,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#include <ft2build.h>
-#include FT_SFNT_NAMES_H
-#include FT_INTERNAL_TRUETYPE_TYPES_H
-#include FT_INTERNAL_STREAM_H
-
-
-#ifdef TT_CONFIG_OPTION_SFNT_NAMES
-
-
-  /* documentation is in ftnames.h */
-
-  FT_EXPORT_DEF( FT_UInt )
-  FT_Get_Sfnt_Name_Count( FT_Face  face )
-  {
-    return ( face && FT_IS_SFNT( face ) ) ? ((TT_Face)face)->num_names : 0;
-  }
-
-
-  /* documentation is in ftnames.h */
-
-  FT_EXPORT_DEF( FT_Error )
-  FT_Get_Sfnt_Name( FT_Face       face,
-                    FT_UInt       idx,
-                    FT_SfntName  *aname )
-  {
-    FT_Error  error = FT_Err_Invalid_Argument;
-
-
-    if ( aname && face && FT_IS_SFNT( face ) )
-    {
-      TT_Face  ttface = (TT_Face)face;
-
-
-      if ( idx < (FT_UInt)ttface->num_names )
-      {
-        TT_NameEntryRec*  entry = ttface->name_table.names + idx;
-
-
-        /* load name on demand */
-        if ( entry->stringLength > 0 && entry->string == NULL )
-        {
-          FT_Memory  memory = face->memory;
-          FT_Stream  stream = face->stream;
-
-
-          if ( FT_NEW_ARRAY  ( entry->string, entry->stringLength ) ||
-               FT_STREAM_SEEK( entry->stringOffset )                ||
-               FT_STREAM_READ( entry->string, entry->stringLength ) )
-          {
-            FT_FREE( entry->string );
-            entry->stringLength = 0;
-          }
-        }
-
-        aname->platform_id = entry->platformID;
-        aname->encoding_id = entry->encodingID;
-        aname->language_id = entry->languageID;
-        aname->name_id     = entry->nameID;
-        aname->string      = (FT_Byte*)entry->string;
-        aname->string_len  = entry->stringLength;
-
-        error = FT_Err_Ok;
-      }
-    }
-
-    return error;
-  }
-
-
-#endif /* TT_CONFIG_OPTION_SFNT_NAMES */
-
-
-/* END */
diff --git a/src/base/ftsnames.c b/src/base/ftsnames.c
new file mode 100644
index 0000000..3447888
--- /dev/null
+++ b/src/base/ftsnames.c
@@ -0,0 +1,94 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ftsnames.c                                                             */
+/*                                                                         */
+/*    Simple interface to access SFNT name tables (which are used          */
+/*    to hold font names, copyright info, notices, etc.) (body).           */
+/*                                                                         */
+/*    This is _not_ used to retrieve glyph names!                          */
+/*                                                                         */
+/*  Copyright 1996-2001, 2002, 2009 by                                     */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#include <ft2build.h>
+#include FT_SFNT_NAMES_H
+#include FT_INTERNAL_TRUETYPE_TYPES_H
+#include FT_INTERNAL_STREAM_H
+
+
+#ifdef TT_CONFIG_OPTION_SFNT_NAMES
+
+
+  /* documentation is in ftsnames.h */
+
+  FT_EXPORT_DEF( FT_UInt )
+  FT_Get_Sfnt_Name_Count( FT_Face  face )
+  {
+    return ( face && FT_IS_SFNT( face ) ) ? ((TT_Face)face)->num_names : 0;
+  }
+
+
+  /* documentation is in ftsnames.h */
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Get_Sfnt_Name( FT_Face       face,
+                    FT_UInt       idx,
+                    FT_SfntName  *aname )
+  {
+    FT_Error  error = FT_Err_Invalid_Argument;
+
+
+    if ( aname && face && FT_IS_SFNT( face ) )
+    {
+      TT_Face  ttface = (TT_Face)face;
+
+
+      if ( idx < (FT_UInt)ttface->num_names )
+      {
+        TT_NameEntryRec*  entry = ttface->name_table.names + idx;
+
+
+        /* load name on demand */
+        if ( entry->stringLength > 0 && entry->string == NULL )
+        {
+          FT_Memory  memory = face->memory;
+          FT_Stream  stream = face->stream;
+
+
+          if ( FT_NEW_ARRAY  ( entry->string, entry->stringLength ) ||
+               FT_STREAM_SEEK( entry->stringOffset )                ||
+               FT_STREAM_READ( entry->string, entry->stringLength ) )
+          {
+            FT_FREE( entry->string );
+            entry->stringLength = 0;
+          }
+        }
+
+        aname->platform_id = entry->platformID;
+        aname->encoding_id = entry->encodingID;
+        aname->language_id = entry->languageID;
+        aname->name_id     = entry->nameID;
+        aname->string      = (FT_Byte*)entry->string;
+        aname->string_len  = entry->stringLength;
+
+        error = FT_Err_Ok;
+      }
+    }
+
+    return error;
+  }
+
+
+#endif /* TT_CONFIG_OPTION_SFNT_NAMES */
+
+
+/* END */
diff --git a/src/base/rules.mk b/src/base/rules.mk
index 66260e6..10f578a 100644
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -37,10 +37,10 @@ BASE_SRC := $(BASE_DIR)/ftadvanc.c \
             $(BASE_DIR)/ftcalc.c   \
             $(BASE_DIR)/ftdbgmem.c \
             $(BASE_DIR)/ftgloadr.c \
-            $(BASE_DIR)/ftnames.c  \
             $(BASE_DIR)/ftobjs.c   \
             $(BASE_DIR)/ftoutln.c  \
             $(BASE_DIR)/ftrfork.c  \
+            $(BASE_DIR)/ftsnames.c \
             $(BASE_DIR)/ftstream.c \
             $(BASE_DIR)/fttrigon.c \
             $(BASE_DIR)/ftutil.c