shithub: freetype+ttf2subf

Download patch

ref: 17439423f8a62e508647d5427c8171c0b229a081
parent: 963cfcd01250d787f76ba20f64e1bdb9623fb50f
author: Werner Lemberg <[email protected]>
date: Wed Aug 11 01:25:37 EDT 2004

* src/base/ftstream.c (FT_Stream_Close): Don't reset stream->close
to NULL.  This allows custom close functions to delete the FT_STREAM
object.


Add API to get information about SFNT tables.

* include/freetype/internal/services/svsfnt.h
(FT_SFNT_Table_Info_Func): New typedef.
(SFNT_Table): Add it.

* src/base/ftobjs (FT_Sfnt_Table_Info): New function.

* include/freetype/tttables.h: Updated.

* src/sfnt/sfdriver.c (sfnt_table_info): New function.
(sfnt_service_sfnt_table): Add it.

* docs/CHANGES: Updated.


* include/freetype/freetype.h (FREETYPE_PATCH): Set to 10.

* builds/unix/configure.ac (version_info): Set to 9:8:3.
* builds/unix/configure: Updated.

* builds/win32/visualc/index.html,
builds/win32/visualc/freetype.dsp,
builds/win32/visualc/freetype.vcproj: s/219/2110/, s/2.1.9/2.1.10/.

* builds/freetype.mk (refdoc), README, Jamfile (RefDoc):
s/2.1.8/2.1.9/.

* docs/CHANGES, docs/VERSION.DLL: Updated.


* src/base/ftrfork.c (FT_Raccess_Guess)
[!FT_CONFIG_OPTION_GUESSING_EMBEDDED_FORK]: Remove compiler
warnings.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,47 @@
+2004-08-11  Danny  <[email protected]>
+
+	* src/base/ftstream.c (FT_Stream_Close): Don't reset stream->close
+	to NULL.  This allows custom close functions to delete the FT_STREAM
+	object.
+
+2004-08-11  Werner Lemberg  <[email protected]>
+
+	Add API to get information about SFNT tables.
+
+	* include/freetype/internal/services/svsfnt.h
+	(FT_SFNT_Table_Info_Func): New typedef.
+	(SFNT_Table): Add it.
+
+	* src/base/ftobjs (FT_Sfnt_Table_Info): New function.
+
+	* include/freetype/tttables.h: Updated.
+
+	* src/sfnt/sfdriver.c (sfnt_table_info): New function.
+	(sfnt_service_sfnt_table): Add it.
+
+	* docs/CHANGES: Updated.
+
+
+	* include/freetype/freetype.h (FREETYPE_PATCH): Set to 10.
+
+	* builds/unix/configure.ac (version_info): Set to 9:8:3.
+	* builds/unix/configure: Updated.
+
+	* builds/win32/visualc/index.html,
+	builds/win32/visualc/freetype.dsp,
+	builds/win32/visualc/freetype.vcproj: s/219/2110/, s/2.1.9/2.1.10/.
+
+	* builds/freetype.mk (refdoc), README, Jamfile (RefDoc):
+	s/2.1.8/2.1.9/.
+
+	* docs/CHANGES, docs/VERSION.DLL: Updated.
+
+2004-08-11  Detlef W�rkner  <[email protected]>
+
+	* src/base/ftrfork.c (FT_Raccess_Guess)
+	[!FT_CONFIG_OPTION_GUESSING_EMBEDDED_FORK]: Remove compiler
+	warnings.
+
 2004-08-06  Adam Piotrowski  <[email protected]>
 
 	* src/pfr/pfrload.c (pfr_sort_kerning_pairs): Single-byte
--- a/Jamfile
+++ b/Jamfile
@@ -148,7 +148,7 @@
 
 actions RefDoc
 {
-  python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.1.9 --output=$(DOC_DIR)  $(FT2_INCLUDE)/freetype/*.h  $(FT2_INCLUDE)/freetype/config/*.h  $(FT2_INCLUDE)/freetype/cache/*.h
+  python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.1.10 --output=$(DOC_DIR)  $(FT2_INCLUDE)/freetype/*.h  $(FT2_INCLUDE)/freetype/config/*.h  $(FT2_INCLUDE)/freetype/cache/*.h
 }
 
 RefDoc  refdoc ;
--- a/README
+++ b/README
@@ -9,8 +9,8 @@
   is called `libttf'.  They are *not* compatible!
 
 
-  FreeType 2.1.9
-  ==============
+  FreeType 2.1.10
+  ===============
 
   Please read the docs/CHANGES file, it contains IMPORTANT INFORMATION.
 
@@ -19,9 +19,9 @@
   Note  that  the FreeType  2  documentation  is  now available  as  a
   separate package from our sites.  See:
 
-    ftp://ftp.freetype.org/freetype/freetype2/ftdocs-2.1.9.tar.bz2
-    ftp://ftp.freetype.org/freetype/freetype2/ftdocs-2.1.9.tar.gz
-    ftp://ftp.freetype.org/freetype/freetype2/ftdoc219.zip
+    ftp://ftp.freetype.org/freetype/freetype2/ftdocs-2.1.10.tar.bz2
+    ftp://ftp.freetype.org/freetype/freetype2/ftdocs-2.1.10.tar.gz
+    ftp://ftp.freetype.org/freetype/freetype2/ftdoc2110.zip
 
 
   Bugs
--- a/builds/freetype.mk
+++ b/builds/freetype.mk
@@ -254,7 +254,7 @@
 refdoc:
 	python $(SRC_DIR)/tools/docmaker/docmaker.py \
                --prefix=ft2                          \
-               --title=FreeType-2.1.9                \
+               --title=FreeType-2.1.10               \
                --output=$(DOC_DIR)                   \
                $(PUBLIC_DIR)/*.h                     \
                $(PUBLIC_DIR)/config/*.h              \
--- a/builds/unix/configure
+++ b/builds/unix/configure
@@ -1720,7 +1720,7 @@
 
 # Don't forget to update docs/VERSION.DLL!
 
-version_info='9:7:3'
+version_info='9:8:3'
 
 ft_version=`echo $version_info | tr : .`
 
--- a/builds/unix/configure.ac
+++ b/builds/unix/configure.ac
@@ -8,7 +8,7 @@
 
 # Don't forget to update docs/VERSION.DLL!
 
-version_info='9:7:3'
+version_info='9:8:3'
 AC_SUBST([version_info])
 ft_version=`echo $version_info | tr : .`
 AC_SUBST([ft_version])
--- a/builds/win32/visualc/freetype.dsp
+++ b/builds/win32/visualc/freetype.dsp
@@ -54,7 +54,7 @@
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug"
 
@@ -78,7 +78,7 @@
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219_D.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110_D.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug Multithreaded"
 
@@ -103,7 +103,7 @@
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"lib\freetype200b8_D.lib"
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219MT_D.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110MT_D.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Release Multithreaded"
 
@@ -127,7 +127,7 @@
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"lib\freetype200b8.lib"
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219MT.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110MT.lib"
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Release Singlethreaded"
 
@@ -152,7 +152,7 @@
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206.lib"
-# ADD LIB32 /out:"..\..\..\objs\freetype219ST.lib"
+# ADD LIB32 /out:"..\..\..\objs\freetype2110ST.lib"
 # SUBTRACT LIB32 /nologo
 
 !ELSEIF  "$(CFG)" == "freetype - Win32 Debug Singlethreaded"
@@ -178,7 +178,7 @@
 # ADD BSC32 /nologo
 LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206_D.lib"
-# ADD LIB32 /nologo /out:"..\..\..\objs\freetype219ST_D.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype2110ST_D.lib"
 
 !ENDIF 
 
--- a/builds/win32/visualc/freetype.vcproj
+++ b/builds/win32/visualc/freetype.vcproj
@@ -41,7 +41,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\..\..\objs\freetype219.lib"
+				OutputFile="..\..\..\objs\freetype2110.lib"
 				SuppressStartupBanner="TRUE"/>
 			<Tool
 				Name="VCMIDLTool"/>
@@ -94,7 +94,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\..\..\objs\freetype219MT.lib"
+				OutputFile="..\..\..\objs\freetype2110MT.lib"
 				SuppressStartupBanner="TRUE"/>
 			<Tool
 				Name="VCMIDLTool"/>
@@ -147,7 +147,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\..\..\objs\freetype219ST.lib"/>
+				OutputFile="..\..\..\objs\freetype2110ST.lib"/>
 			<Tool
 				Name="VCMIDLTool"/>
 			<Tool
@@ -197,7 +197,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\..\..\objs\freetype219_D.lib"
+				OutputFile="..\..\..\objs\freetype2110_D.lib"
 				SuppressStartupBanner="TRUE"/>
 			<Tool
 				Name="VCMIDLTool"/>
@@ -248,7 +248,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\..\..\objs\freetype219ST_D.lib"
+				OutputFile="..\..\..\objs\freetype2110ST_D.lib"
 				SuppressStartupBanner="TRUE"/>
 			<Tool
 				Name="VCMIDLTool"/>
@@ -299,7 +299,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLibrarianTool"
-				OutputFile="..\..\..\objs\freetype219MT_D.lib"
+				OutputFile="..\..\..\objs\freetype2110MT_D.lib"
 				SuppressStartupBanner="TRUE"/>
 			<Tool
 				Name="VCMIDLTool"/>
--- a/builds/win32/visualc/index.html
+++ b/builds/win32/visualc/index.html
@@ -12,14 +12,14 @@
 
 <p>This directory contains a project files for Visual C++, named
 <tt>freetype.dsp</tt>, and Visual Studio, called <tt>freetype.sln</tt>.  It
-will compile the following libraries from the FreeType 2.1.9 sources:</p>
+will compile the following libraries from the FreeType 2.1.10 sources:</p>
 
 <ul>
   <pre>
-    freetype219.lib     - release build; single threaded
-    freetype219_D.lib   - debug build;   single threaded
-    freetype219MT.lib   - release build; multi-threaded
-    freetype219MT_D.lib - debug build;   multi-threaded</pre>
+    freetype2110.lib     - release build; single threaded
+    freetype2110_D.lib   - debug build;   single threaded
+    freetype2110MT.lib   - release build; multi-threaded
+    freetype2110MT_D.lib - debug build;   multi-threaded</pre>
 </ul>
 
 <p>Be sure to extract the files with the Windows (CR+LF) line endings. ZIP
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -20,6 +20,9 @@
       setting  family  and  style in SFNT  fonts  (patch from Kornfeld
       Eliyahu Peter).
 
+    - A  new  API `FT_Sfnt_Table_Info'  (in FT_TRUETYPE_TABLES_H)  has
+      been added to retrieve name and size information of SFNT tables.
+
 
 LATEST CHANGES BETWEEN 2.1.9 and 2.1.8
 
--- a/docs/VERSION.DLL
+++ b/docs/VERSION.DLL
@@ -52,6 +52,7 @@
 
     release    libtool      so
   -------------------------------
+     2.1.10     9.8.3     6.3.8
      2.1.9      9.7.3     6.3.7
      2.1.8      9.6.3     6.3.6
      2.1.7      9.5.3     6.3.5
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -44,7 +44,7 @@
   /*                                                                       */
 #define FREETYPE_MAJOR 2
 #define FREETYPE_MINOR 1
-#define FREETYPE_PATCH 9
+#define FREETYPE_PATCH 10
 
 
 #include <ft2build.h>
--- a/include/freetype/internal/services/svsfnt.h
+++ b/include/freetype/internal/services/svsfnt.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType PostScript name services (specification).               */
 /*                                                                         */
-/*  Copyright 2003 by                                                      */
+/*  Copyright 2003, 2004 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -50,11 +50,22 @@
   (*FT_SFNT_TableGetFunc)( FT_Face      face,
                            FT_Sfnt_Tag  tag );
 
- 
+
+  /*
+   * Used to implement FT_Sfnt_Table_Info().
+   */
+  typedef FT_Error
+  (*FT_SFNT_TableInfoFunc)( FT_Face    face,
+                            FT_UInt    idx,
+                            FT_ULong  *tag,
+                            FT_ULong  *length );
+
+
   FT_DEFINE_SERVICE( SFNT_Table )
   {
     FT_SFNT_TableLoadFunc  load_table;
     FT_SFNT_TableGetFunc   get_table;
+    FT_SFNT_TableInfoFunc  table_info;
   };
 
   /* */
--- a/include/freetype/tttables.h
+++ b/include/freetype/tttables.h
@@ -663,6 +663,43 @@
                       FT_ULong*  length );
 
 
+ /**************************************************************************
+  *
+  * <Function>
+  *    FT_Sfnt_Table_Info
+  *
+  * <Description>
+  *   Returns information on an SFNT table.
+  *
+  * <Input>
+  *   face ::
+  *     A handle to the source face.
+  *
+  *   table_index ::
+  *     The index of an SFNT table.  The function returns
+  *     FT_Err_Table_Missing for an invalid value.
+  *
+  * <Output>
+  *   tag ::
+  *     The name tag of the SFNT table.
+  *
+  *   length ::
+  *     The length of the SFNT table.
+  *
+  * <Return>
+  *   FreeType error code.  0 means success.
+  *
+  * <Note>
+  *   SFNT tables with length zero are treated as missing by Windows.
+  *
+  */
+  FT_EXPORT( FT_Error )
+  FT_Sfnt_Table_Info( FT_Face    face,
+                      FT_UInt    table_index,
+                      FT_ULong  *tag,
+                      FT_ULong  *length );
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -2508,6 +2508,28 @@
   }
 
 
+  /* documentation is in tttables.h */
+
+  FT_EXPORT_DEF( FT_Error )
+  FT_Sfnt_Table_Info( FT_Face    face,
+                      FT_UInt    table_index,
+                      FT_ULong  *tag,
+                      FT_ULong  *length )
+  {
+    FT_Service_SFNT_Table  service;
+
+
+    if ( !face || !FT_IS_SFNT( face ) )
+      return FT_Err_Invalid_Face_Handle;
+
+    FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );
+    if ( service == NULL )
+      return FT_Err_Unimplemented_Feature;
+
+    return service->table_info( face, table_index, tag, length );
+  }
+
+
   FT_EXPORT_DEF( FT_ULong )
   FT_Get_CMap_Language_ID( FT_CharMap  charmap )
   {
--- a/src/base/ftrfork.c
+++ b/src/base/ftrfork.c
@@ -701,6 +701,10 @@
   {
     int  i;
 
+    FT_UNUSED( library );
+    FT_UNUSED( stream );
+    FT_UNUSED( base_name );
+
 
     for ( i = 0; i < FT_RACCESS_N_RULES; i++ )
     {
--- a/src/base/ftstream.c
+++ b/src/base/ftstream.c
@@ -49,10 +49,7 @@
   FT_Stream_Close( FT_Stream  stream )
   {
     if ( stream && stream->close )
-    {
       stream->close( stream );
-      stream->close = NULL;
-    }
   }
 
 
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -92,10 +92,30 @@
   }
 
 
+  static FT_Error
+  sfnt_table_info( TT_Face    face,
+                   FT_UInt    idx,
+                   FT_ULong  *tag,
+                   FT_ULong  *length )
+  {
+    if ( !tag || !length )
+      return SFNT_Err_Invalid_Argument;
+
+    if ( idx >= face->num_tables )
+      return SFNT_Err_Table_Missing;
+
+    *tag    = face->dir_tables[idx].Tag;
+    *length = face->dir_tables[idx].Length;
+
+    return SFNT_Err_Ok;
+  }
+
+
   static const FT_Service_SFNT_TableRec  sfnt_service_sfnt_table =
   {
     (FT_SFNT_TableLoadFunc)tt_face_load_any,
-    (FT_SFNT_TableGetFunc) get_sfnt_table
+    (FT_SFNT_TableGetFunc) get_sfnt_table,
+    (FT_SFNT_TableInfoFunc)sfnt_table_info
   };