shithub: freetype+ttf2subf

Download patch

ref: 6ce03efb12909f239fe139e7ec609fa7e9654dbd
parent: 8d3a401fa808a8c70bd6a9ce17d5a840fb0ae2db
author: David Turner <[email protected]>
date: Tue Mar 20 09:50:04 EST 2001

* include/freetype/config/ftheader.h, include/freetype/ftsnames.h:
	renamed "ftnames.h" to "ftsnames.h", and FT_NAMES_H to FT_SFNT_NAMES_H

	* docs/docmaker.py: added generation of INDEX link in table of contents

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2001-03-20  David Turner    <[email protected]>
 
+	* include/freetype/config/ftheader.h, include/freetype/ftsnames.h:
+	renamed "ftnames.h" to "ftsnames.h", and FT_NAMES_H to FT_SFNT_NAMES_H
+
+	* docs/docmaker.py: added generation of INDEX link in table of contents
+
+	* INSTALL, docs/BUILD: updated documentation to indicate that the
+	compilation process has changed slightly (no more 'src' required in
+	the include path).
+
 	* builds/*/*-def.mk: changed the objects directory from "obj" to "objs"
 
 	* include/freetype/config/ftheader.h: removed obsolete macros like
--- a/INSTALL
+++ b/INSTALL
@@ -7,7 +7,7 @@
 
   You need  to have  GNU Make (version  3.78.1 or newer)  installed on
   your system to compile the library from the command line.  This will
-  _not_ work with other make tools (including BSD make)!
+  _NOT_ work with other make tools (including BSD make)!
 
   [Well, this is not  really correct.  Recently, a perl implementation
   of make called `makepp' has appeared which can also build FreeType 2
@@ -60,10 +60,14 @@
 II. In your own environment (IDE)
 ---------------------------------
 
-  You   need   to   add   the  directories   "freetype2/include"   and
-  "freetype2/src" to your include path when compiling the library.
+  You   need   to   add   the  directories   "freetype2/include" to
+  your include path when compiling the library.
   
-  Compile each library component through the following files:
+  FreeType 2 is made of several components, each one of them is located
+  in a subdirectory of "freetype2/src". For example, 'freetype2/src/truetype/'
+  contains the TrueType font driver.
+  
+  DO NOT COMPILE ALL C FILES !! Rather, compile the following ones:
   
     -- base components (required)
      
--- a/docs/BUILD
+++ b/docs/BUILD
@@ -13,6 +13,9 @@
 I. QUICK COMMAND-LINE GUIDE
 ---------------------------
 
+  THE FOLLOWING WILL ONLY WORK WITH GNU MAKE, IT WILL FAIL MISERABLY
+  WITH OTHER MAKE TOOLS, FOR EXAMPLE "BSD MAKE"..
+
   Install GNU Make  (version 3.78.1 or newer), then  try the following
   on Unix or any system with gcc:
 
@@ -59,6 +62,9 @@
     Make -- trying to build the  library with any other Make tool will
     *fail*.
 
+    NEARLY ALL OTHER MAKE TOOLS WILL FAIL, INCLUDING "BSD MAKE", SO REALLY
+    INSTALL A RECENT VERSION OF GNU MAKE ON YOUR SYSTEM !!
+
     Make sure that you are invoking GNU Make from the command line, by
     typing something like:
 
@@ -66,7 +72,7 @@
 
     to display its version number.
 
-    Version 3.78.1 or newer is needed.
+    VERSION 3.78.1 OR NEWER IS NEEDED !!.
 
   b. Invoke `make'
 
@@ -177,12 +183,12 @@
   However, you can  create a single object file  by compiling the file
   `src/base/ftbase.c', which basically contains
 
-      #include <base/ftcalc.c>
-      #include <base/ftobjs.c>
-      #include <base/ftstream.c>
-      #include <base/ftlist.c>
-      #include <base/ftoutln.c>
-      #include <base/ftextend.c>
+      #include "ftcalc.c"
+      #include "ftobjs.c"
+      #include "ftstream.c"
+      #include "ftlist.c"
+      #include "ftoutln.c"
+      #include "ftextend.c"
 
   Similarly, each component has a single `englobing' C file to compile
   it as a stand-alone object:
@@ -202,7 +208,7 @@
     src/truetype/truetype.c   - the TrueType font driver
     src/type1/type1.c         - the Type 1 font driver
 
-  The last module of FreeType 2, winfonts (implementing support for
+  The last module of FreeType 2, "winfonts" (implementing support for
   Windows FNT format), is a single file.
 
   To compile one component, do the following:
@@ -210,21 +216,23 @@
     - Add  the  top-level  `include'  directory  to  your  compilation
       include path
 
-    - Add the `src' directory to your compilation include path.
+    - Add the `src/<component>' directory to your compilation include path,
+      or simply 'cd' to the component's source directory
 
     - Compile the component `source'  file (see list below); you don't
-      need to be in the component's directory.
+      need to be in the component's directory if you added `src/<component>'
+      to your include path..
 
   For example, the following line  can be used to compile the truetype
   driver on Unix:
 
      cd freetype2/
-     cc -c -Iinclude -Isrc  src/truetype/truetype.c
+     cc -c -Iinclude -Isrc/truetype  src/truetype/truetype.c
 
   Alternatively:
 
      cd freetype2/src/truetype
-     cc -c -I../../include -I.. truetype.c
+     cc -c -I../../include truetype.c
 
   Finally, FreeType 2 contains some other components:
 
@@ -244,13 +252,9 @@
 IV. Support for flat-directory compilation
 ------------------------------------------
 
-  It is now possible to put  all FreeType 2 source files into a single
+  It is possible to put  all FreeType 2 source files into a single
   directory, with the exception of the `include' hierarchy.
 
-  Note  that you  still need  to  only compile  the `wrapper'  sources
-  described   above.   Define   the   `FT_FLAT_COMPILE'   macro   when
-  compiling.  Here an example:
-
     1. Copy all files in current directory:
 
         cp freetype2/src/base/*.[hc] .
@@ -260,11 +264,13 @@
 
     2. Compile sources:
 
-        cc -c -DFT_FLAT_COMPILE -Ifreetype2/include ftsystem.c
-        cc -c -DFT_FLAT_COMPILE -Ifreetype2/include ftinit.c
-        cc -c -DFT_FLAT_COMPILE -Ifreetype2/include ftdebug.c
-        cc -c -DFT_FLAT_COMPILE -Ifreetype2/include ftbase.c
+        cc -c -Ifreetype2/include ftsystem.c
+        cc -c -Ifreetype2/include ftinit.c
+        cc -c -Ifreetype2/include ftdebug.c
+        cc -c -Ifreetype2/include ftbase.c
         etc.
 
+   You don't need to define the FT_FLAT_COMPILATION macro (as this was required
+   in previous releases of FreeType 2)
 
 End of file
--- a/docs/docmaker.py
+++ b/docs/docmaker.py
@@ -901,7 +901,7 @@
                 # provide a new one.
                 #
                 if abstract:
-                    print_error( "duplicate section definition for " +
+                    section.block.print_error( "duplicate section definition for " +
                                  "'" + name + "'\n" +
                                  "previous definition in " +
                                  "'" + section.block.location() + "'\n" +
@@ -1191,6 +1191,9 @@
             print "</table>"
 
             print chapter_footer
+
+        # index
+        print chapter_header + '<a href="' + self.section_list.index_filename + '">Index</a>' + chapter_footer
 
         print html_footer
 
--- a/include/freetype/config/ftheader.h
+++ b/include/freetype/config/ftheader.h
@@ -245,7 +245,7 @@
 
 /*************************************************************************
  *
- * @macro: FT_TRUETYPE_NAMES_H
+ * @macro: FT_TRUETYPE_IDS_H
  *
  * @description:
  *    a macro used in #include statements to name the file containing
@@ -254,7 +254,7 @@
  *    constant macro definitions, taken from the TrueType and OpenType
  *    specs..
  */
-#define FT_TRUETYPE_NAMES_H    <freetype/ttnameid.h>
+#define FT_TRUETYPE_IDS_H    <freetype/ttnameid.h>
 
 /*************************************************************************
  *
@@ -362,7 +362,7 @@
 
 /*************************************************************************
  *
- * @macro: FT_NAMES_H
+ * @macro: FT_SFNT_NAMES_H
  *
  * @description:
  *    a macro used in #include statements to name the file containing
@@ -369,7 +369,7 @@
  *    the optional FreeType 2 API used to access embedded "name" strings
  *    in SFNT-based font formats (i.e. TrueType and OpenType)
  */
-#define FT_NAMES_H              <freetype/ftnames.h>
+#define FT_SFNT_NAMES_H              <freetype/ftnames.h>
 
  /* */
  
--- a/include/freetype/ftchapters.h
+++ b/include/freetype/ftchapters.h
@@ -51,3 +51,4 @@
 /*    raster                                                               */
 /*                                                                         */
 /***************************************************************************/
+
--- a/include/freetype/ftmm.h
+++ b/include/freetype/ftmm.h
@@ -98,6 +98,7 @@
 
   } FT_Multi_Master;
 
+  /* */
 
   typedef FT_Error  (*FT_Get_MM_Func)( FT_Face           face,
                                        FT_Multi_Master*  master );
--- a/include/freetype/ftnames.h
+++ /dev/null
@@ -1,155 +1,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ftnames.h                                                              */
-/*                                                                         */
-/*    Simple interface to access SFNT name tables (which are used          */
-/*    to hold font names, copyright info, notices, etc.) (specification).  */
-/*                                                                         */
-/*    This is _not_ used to retrieve glyph names!                          */
-/*                                                                         */
-/*  Copyright 1996-2000 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.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#ifndef __FTNAMES_H__
-#define __FTNAMES_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-
-FT_BEGIN_HEADER
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Section>                                                             */
-  /*    sfnt_names                                                         */
-  /*                                                                       */
-  /* <Title>                                                               */
-  /*    SFNT Names                                                         */
-  /*                                                                       */
-  /* <Abstract>                                                            */
-  /*    Access the names embedded in TrueType and OpenType files.          */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    The TrueType and OpenType specification allow the inclusion of     */
-  /*    a special `names table' in font files.  This table contains        */
-  /*    textual (and internationalized) information regarding the font,    */
-  /*    like family name, copyright, version, etc.                         */
-  /*                                                                       */
-  /*    The definitions below are used to access them if available.        */
-  /*                                                                       */
-  /*    Note that this has nothing to do with glyph names!                 */
-  /*                                                                       */
-  /*************************************************************************/
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Struct>                                                              */
-  /*    FT_SfntName                                                        */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A structure used to model an SFNT `name' table entry.              */
-  /*                                                                       */
-  /* <Fields>                                                              */
-  /*    platform_id :: The platform ID for `string'.                       */
-  /*                                                                       */
-  /*    encoding_id :: The encoding ID for `string'.                       */
-  /*                                                                       */
-  /*    language_id :: The language ID for `string'.                       */
-  /*                                                                       */
-  /*    name_id     :: An identifier for `string'.                         */
-  /*                                                                       */
-  /*    string      :: The `name' string.  Note that this string is in     */
-  /*                   Pascal convention, i.e., the string hasn't a final  */
-  /*                   null byte.                                          */
-  /*                                                                       */
-  /*    string_len  :: The length of `string' in bytes.                    */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    Possible values for `platform_id', `encoding_id', `language_id',   */
-  /*    and `name_id' are given in the file `ttnameid.h'.  For details     */
-  /*    please refer to the TrueType or OpenType specification.            */
-  /*                                                                       */
-  typedef struct  FT_SfntName_
-  {
-    FT_UShort  platform_id;
-    FT_UShort  encoding_id;
-    FT_UShort  language_id;
-    FT_UShort  name_id;
-
-    FT_Byte*   string;      /* this string is *not* null-terminated! */
-    FT_UInt    string_len;  /* in bytes */
-
-  } FT_SfntName;
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    FT_Get_Sfnt_Name_Count                                             */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Retrieves the number of name strings in the SFNT `name' table.     */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face :: A handle to the source face.                               */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    The number of strings in the `name' table.                         */
-  /*                                                                       */
-  FT_EXPORT( FT_UInt )  FT_Get_Sfnt_Name_Count( FT_Face  face );
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    FT_Get_Sfnt_Name                                                   */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Retrieves a string of the SFNT `name' table for a given index.     */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face  :: A handle to the source face.                              */
-  /*                                                                       */
-  /*    index :: The index of the `name' string.                           */
-  /*                                                                       */
-  /* <Output>                                                              */
-  /*    aname :: The indexed FT_SfntName structure.                        */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    FreeType error code.  0 means success.                             */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    The `string' array returned in the `aname' structure is not        */
-  /*    null-terminated.                                                   */
-  /*                                                                       */
-  /*    Use FT_Get_Sfnt_Name_Count() to get the total number of available  */
-  /*    `name' table entries, then do a loop until you get the right       */
-  /*    platform, encoding, and name ID.                                   */
-  /*                                                                       */
-  FT_EXPORT( FT_Error )  FT_Get_Sfnt_Name( FT_Face       face,
-                                           FT_UInt       index,
-                                           FT_SfntName  *aname );
-
-
-  /* */
-
-
-FT_END_HEADER
-
-#endif /* __FTNAMES_H__ */
-
-
-/* END */
--- /dev/null
+++ b/include/freetype/ftsnames.h
@@ -1,0 +1,159 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ftsnames.h                                                             */
+/*                                                                         */
+/*    Simple interface to access SFNT name tables (which are used          */
+/*    to hold font names, copyright info, notices, etc.) (specification).  */
+/*                                                                         */
+/*    This is _not_ used to retrieve glyph names!                          */
+/*                                                                         */
+/*  Copyright 1996-2000 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.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __FT_SFNT_NAMES_H__
+#define __FT_SFNT_NAMES_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Section>                                                             */
+  /*    sfnt_names                                                         */
+  /*                                                                       */
+  /* <Title>                                                               */
+  /*    SFNT Names                                                         */
+  /*                                                                       */
+  /* <Abstract>                                                            */
+  /*    Access the names embedded in TrueType and OpenType files.          */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    The TrueType and OpenType specification allow the inclusion of     */
+  /*    a special `names table' in font files.  This table contains        */
+  /*    textual (and internationalized) information regarding the font,    */
+  /*    like family name, copyright, version, etc.                         */
+  /*                                                                       */
+  /*    The definitions below are used to access them if available.        */
+  /*                                                                       */
+  /*    Note that this has nothing to do with glyph names!                 */
+  /*                                                                       */
+  /*************************************************************************/
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Struct>                                                              */
+  /*    FT_SfntName                                                        */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    A structure used to model an SFNT `name' table entry.              */
+  /*                                                                       */
+  /* <Fields>                                                              */
+  /*    platform_id :: The platform ID for `string'.                       */
+  /*                                                                       */
+  /*    encoding_id :: The encoding ID for `string'.                       */
+  /*                                                                       */
+  /*    language_id :: The language ID for `string'.                       */
+  /*                                                                       */
+  /*    name_id     :: An identifier for `string'.                         */
+  /*                                                                       */
+  /*    string      :: The `name' string.  Note that its format differs    */
+  /*                   depending on the (platform,encoding) pair. It can   */
+  /*                   be a Pascal String, a UTF-16 one, etc..             */
+  /*                                                                       */
+  /*                   Generally speaking, the string is not               */
+  /*                   zero-terminated. Please refer to the TrueType       */
+  /*                   specification for details..                         */
+  /*                                                                       */
+  /*    string_len  :: The length of `string' in bytes.                    */
+  /*                                                                       */
+  /* <Note>                                                                */
+  /*    Possible values for `platform_id', `encoding_id', `language_id',   */
+  /*    and `name_id' are given in the file `ttnameid.h'.  For details     */
+  /*    please refer to the TrueType or OpenType specification.            */
+  /*                                                                       */
+  typedef struct  FT_SfntName_
+  {
+    FT_UShort  platform_id;
+    FT_UShort  encoding_id;
+    FT_UShort  language_id;
+    FT_UShort  name_id;
+
+    FT_Byte*   string;      /* this string is *not* null-terminated! */
+    FT_UInt    string_len;  /* in bytes */
+
+  } FT_SfntName;
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_Get_Sfnt_Name_Count                                             */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Retrieves the number of name strings in the SFNT `name' table.     */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    face :: A handle to the source face.                               */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    The number of strings in the `name' table.                         */
+  /*                                                                       */
+  FT_EXPORT( FT_UInt )  FT_Get_Sfnt_Name_Count( FT_Face  face );
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_Get_Sfnt_Name                                                   */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Retrieves a string of the SFNT `name' table for a given index.     */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    face  :: A handle to the source face.                              */
+  /*                                                                       */
+  /*    index :: The index of the `name' string.                           */
+  /*                                                                       */
+  /* <Output>                                                              */
+  /*    aname :: The indexed FT_SfntName structure.                        */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  /* <Note>                                                                */
+  /*    The `string' array returned in the `aname' structure is not        */
+  /*    null-terminated.                                                   */
+  /*                                                                       */
+  /*    Use FT_Get_Sfnt_Name_Count() to get the total number of available  */
+  /*    `name' table entries, then do a loop until you get the right       */
+  /*    platform, encoding, and name ID.                                   */
+  /*                                                                       */
+  FT_EXPORT( FT_Error )  FT_Get_Sfnt_Name( FT_Face       face,
+                                           FT_UInt       index,
+                                           FT_SfntName  *aname );
+
+
+  /* */
+
+
+FT_END_HEADER
+
+#endif /* __FT_SFNT_NAMES_H__ */
+
+
+/* END */
--- a/src/base/ftnames.c
+++ b/src/base/ftnames.c
@@ -20,7 +20,7 @@
 
 
 #include <ft2build.h>
-#include FT_NAMES_H
+#include FT_SFNT_NAMES_H
 #include FT_INTERNAL_TRUETYPE_TYPES_H
 
 
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -21,7 +21,7 @@
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_SFNT_H
-#include FT_TRUETYPE_NAMES_H
+#include FT_TRUETYPE_IDS_H
 #include FT_INTERNAL_CFF_ERRORS_H
 
 #include "cffdrivr.h"
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -21,7 +21,7 @@
 #include FT_INTERNAL_CALC_H
 #include FT_INTERNAL_STREAM_H
 #include FT_ERRORS_H
-#include FT_TRUETYPE_NAMES_H
+#include FT_TRUETYPE_IDS_H
 #include FT_TRUETYPE_TAGS_H
 #include FT_INTERNAL_SFNT_H
 #include FT_INTERNAL_POSTSCRIPT_NAMES_H
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -21,7 +21,7 @@
 #include "ttload.h"
 #include FT_INTERNAL_SFNT_H
 #include FT_INTERNAL_POSTSCRIPT_NAMES_H
-#include FT_TRUETYPE_NAMES_H
+#include FT_TRUETYPE_IDS_H
 #include FT_TRUETYPE_TAGS_H
 #include FT_INTERNAL_TRUETYPE_ERRORS_H
 
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -20,7 +20,7 @@
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_STREAM_H
 #include FT_INTERNAL_SFNT_H
-#include FT_TRUETYPE_NAMES_H
+#include FT_TRUETYPE_IDS_H
 #include "ttdriver.h"
 #include "ttgload.h"
 
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -20,7 +20,7 @@
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_CALC_H
 #include FT_INTERNAL_STREAM_H
-#include FT_TRUETYPE_NAMES_H
+#include FT_TRUETYPE_IDS_H
 #include FT_TRUETYPE_TAGS_H
 #include FT_INTERNAL_SFNT_H
 #include FT_INTERNAL_POSTSCRIPT_NAMES_H