freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master c5a8a53 1/2: Provide dummy functions if `TT_CONFIG_OP


From: Werner LEMBERG
Subject: [freetype2] master c5a8a53 1/2: Provide dummy functions if `TT_CONFIG_OPTION_SFNT_NAMES' is not set.
Date: Mon, 14 May 2018 03:45:49 -0400 (EDT)

branch: master
commit c5a8a5350a572cac399643ec8cacdb3330dc79df
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    Provide dummy functions if `TT_CONFIG_OPTION_SFNT_NAMES' is not set.
    
    * src/base/ftsnames.c [!TT_CONFIG_OPTION_SFNT_NAMES]: Implement it.
---
 ChangeLog                   |  6 ++++++
 include/freetype/ftsnames.h | 10 ++++++++++
 src/base/ftsnames.c         | 40 +++++++++++++++++++++++++++++++++++++++-
 3 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 03978b0..2f94ffc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-05-14  Werner Lemberg  <address@hidden>
+
+       Provide dummy functions if `TT_CONFIG_OPTION_SFNT_NAMES' is not set.
+
+       * src/base/ftsnames.c [!TT_CONFIG_OPTION_SFNT_NAMES]: Implement it.
+
 2018-05-13  Werner Lemberg  <address@hidden>
 
        * src/base/ftobjs.c (FT_Load_Glyph): Improve tracing.
diff --git a/include/freetype/ftsnames.h b/include/freetype/ftsnames.h
index 8eb8d70..3aa0d08 100644
--- a/include/freetype/ftsnames.h
+++ b/include/freetype/ftsnames.h
@@ -130,6 +130,10 @@ FT_BEGIN_HEADER
   /* <Return>                                                              */
   /*    The number of strings in the `name' table.                         */
   /*                                                                       */
+  /* <Note>                                                                */
+  /*    This function always returns an error if the config macro          */
+  /*    `TT_CONFIG_OPTION_SFNT_NAMES' is not defined in `ftoption.h'.      */
+  /*                                                                       */
   FT_EXPORT( FT_UInt )
   FT_Get_Sfnt_Name_Count( FT_Face  face );
 
@@ -165,6 +169,9 @@ FT_BEGIN_HEADER
   /*    `name' table format~1 entries can use language tags also, see      */
   /*    @FT_Get_Sfnt_LangTag.                                              */
   /*                                                                       */
+  /*    This function always returns an error if the config macro          */
+  /*    `TT_CONFIG_OPTION_SFNT_NAMES' is not defined in `ftoption.h'.      */
+  /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Get_Sfnt_Name( FT_Face       face,
                     FT_UInt       idx,
@@ -233,6 +240,9 @@ FT_BEGIN_HEADER
   /*    invalid format~1 language ID values, FT_Err_Invalid_Argument is    */
   /*    returned.                                                          */
   /*                                                                       */
+  /*    This function always returns an error if the config macro          */
+  /*    `TT_CONFIG_OPTION_SFNT_NAMES' is not defined in `ftoption.h'.      */
+  /*                                                                       */
   /* <Since>                                                               */
   /*    2.8                                                                */
   /*                                                                       */
diff --git a/src/base/ftsnames.c b/src/base/ftsnames.c
index 90ea1e2..fd747ed 100644
--- a/src/base/ftsnames.c
+++ b/src/base/ftsnames.c
@@ -142,7 +142,45 @@
   }
 
 
-#endif /* TT_CONFIG_OPTION_SFNT_NAMES */
+#else /* !TT_CONFIG_OPTION_SFNT_NAMES */
+
+
+  FT_EXPORT_DEF( FT_UInt )
+  FT_Get_Sfnt_Name_Count( FT_Face  face )
+  {
+    FT_UNUSED( face );
+
+    return 0;
+  }
+
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Get_Sfnt_Name( FT_Face       face,
+                    FT_UInt       idx,
+                    FT_SfntName  *aname )
+  {
+    FT_UNUSED( face );
+    FT_UNUSED( idx );
+    FT_UNUSED( aname );
+
+    return FT_THROW( Unimplemented_Feature );
+  }
+
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Get_Sfnt_LangTag( FT_Face          face,
+                       FT_UInt          langID,
+                       FT_SfntLangTag  *alangTag )
+  {
+    FT_UNUSED( face );
+    FT_UNUSED( langID );
+    FT_UNUSED( alangTag );
+
+    return FT_THROW( Unimplemented_Feature );
+  }
+
+
+#endif /* !TT_CONFIG_OPTION_SFNT_NAMES */
 
 
 /* END */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]