shithub: freetype+ttf2subf

Download patch

ref: 40bb0964f2885a2cf5dcc4881448c4089761b577
parent: 7760595f84a8edc365f280a9358d4075d42d51ea
author: Werner Lemberg <[email protected]>
date: Sat Nov 1 09:36:20 EST 2003

* src/base/fttype1.c (FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names):
Fix parameter order in calls to FT_FACE_FIND_SERVICE.

* include/freetype/internal/ftserv.h
(FT_SERVICE_POSTSCRIPT_NAMES_H): Removed.  Unused.

* src/type42/t42drivr.c (t42_services): Updated.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,27 +1,82 @@
+2003-10-31  Detlef W�rkner  <[email protected]>
+
+	* src/base/fttype1.c (FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names):
+	Fix parameter order in calls to FT_FACE_FIND_SERVICE.
+
+2003-10-31  Werner Lemberg  <[email protected]>
+
+	* include/freetype/internal/ftserv.h
+	(FT_SERVICE_POSTSCRIPT_NAMES_H): Removed.  Unused.
+
+	* src/type42/t42drivr.c (t42_services): Updated.
+
 2003-10-29  David Turner  <[email protected]>
 
-        * include/freetype/internal/bdftypes.h: removed obsolete header
+	* include/freetype/internal/bdftypes.h: Removed.  Obsolete.
+	* src/base/ftbdf.c: Updated.
 
-        * include/freetype/internal/cfftypes.h, src/cff/cfftypes.h,
-        src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h,
-        include/freetype/internal/services/svbdf.h: moving "cfftypes.h" from
-        'include/freetype/internal' to 'src/cff' since no other modules needs
-        to known about these types
+	* include/freetype/internal/cfftypes.h: Moved to...
+	* src/cff/cfftypes.h: This place since no other module needs to
+	know about those types.
 
-        * include/freetype/internal/t42types.h,
-        include/freetype/internal/internal.h, src/type42/t42objs.h,
-        src/type42/t42drivr.c, src/type42/t42types.h: moving "t42types.h" from
-        'include/freetype/internal' to 'src/type42' since no other modules needs
-        to known about these types
+	* include/freetype/internal/t42types.h: Moved to...
+	* src/type42/t42types.h: This place since no other module needs to
+	know about those types.
 
-        * src/gzip/infblock.c: removing compiler warning
+	* include/freetype/internal/services/svbdf.h: Include FT_BDF_H.
 
-        * include/freetype/internal/services/svpsinfo.h,
-        include/freetype/internal/ftserv.h, src/cff/cffdrivr.c,
-        src/cid/ciddrivr.c, src/type1/t1driver.c, src/type42/t42drivr.c,
-        src/base/fttype1.c: migrating to FT_SERVICE_ID_POSTSCRIPT_INFO defined
-        in "svpsinfo.h", removing some sad hacks.
+	* include/freetype/internal/services/svpsname.h: Renamed to...
+	* include/freetype/internal/services/svpscmap.h: This.
+	Updated `FT_Service_PsNames' -> `FT_Service_PsCMaps' and
+	`POSTSCRIPT_NAMES' -> `POSTSCRIPT_CMAPS' everywhere.
 
+	* include/freetype/internal/services/svpsinfo.h: New file, providing
+	PostScript info service.
+
+	* include/freetype/internal/ftserv.h (FT_SERVICE_POSTSCRIPT_CMAPS_H,
+	FT_SERVICE_POSTSCRIPT_INFO_H): New macros for svpscmap.h and
+	svpsinfo.h.
+	* include/freetype/internal/internal.h (FT_INTERNAL_TYPE42_TYPES_H,
+	FT_INTERNAL_CFF_TYPES_H, FT_INTERNAL_BDF_TYPES_H): Removed.
+
+	* src/base/fttype1.c: Don't include FT_INTERNAL_TYPE1_TYPES_H and
+	FT_INTERNAL_TYPE42_TYPES_H but FT_INTERNAL_SERVICE_H and
+	FT_SERVICE_POSTSCRIPT_INFO_H.
+	(FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names): Use new
+	POSTSCRIPT_INFO service.
+
+	* src/cff/cffdrivr.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
+	(cff_ps_has_glyph_names): New function.
+	(cff_service_ps_info): New service.
+	(cff_services): Updated.
+
+	* src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h: Don't
+	include FT_INTERNAL_CFF_TYPES_H but cfftypes.h directly.
+
+	* src/cif/cidriver.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
+	(cid_ps_get_font_info): New function.
+	(cid_service_ps_info): New service.
+	(cid_services): Updated.
+
+	* src/type1/t1driver.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
+	(t1_ps_get_font_info, t1_ps_has_glyph_names): New functions.
+	(t1_service_ps_info): New service.
+	(t1_services): Updated.
+
+	* src/type42/t42drivr.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
+	(t42_ps_get_font_info, t42_ps_has_glyph_names): New functions.
+	(t42_service_ps_info): New service.
+
+	* src/type42/t42objs.h: Don't include FT_INTERNAL_TYPE42_TYPES_H
+	but t42types.h directly.
+
+	* src/psnames/psmodule.c (psnames_interface, psnames_services):
+	Renamed to...
+	(pscmaps_interface, pscmaps_services): This.
+	Updated all users.
+
+
+	* src/gzip/infblock.c (inflate_blocks): Remove compiler warning.
 
 2003-10-22  Werner Lemberg  <[email protected]>
 
--- a/include/freetype/internal/ftserv.h
+++ b/include/freetype/internal/ftserv.h
@@ -240,7 +240,6 @@
 
 #define FT_SERVICE_MULTIPLE_MASTERS_H  <freetype/internal/services/svmm.h>
 #define FT_SERVICE_POSTSCRIPT_NAME_H   <freetype/internal/services/svpostnm.h>
-#define FT_SERVICE_POSTSCRIPT_NAMES_H  <freetype/internal/services/svpsname.h>
 #define FT_SERVICE_POSTSCRIPT_CMAPS_H  <freetype/internal/services/svpscmap.h>
 #define FT_SERVICE_POSTSCRIPT_INFO_H   <freetype/internal/services/svpsinfo.h>
 #define FT_SERVICE_GLYPH_DICT_H        <freetype/internal/services/svgldict.h>
--- a/include/freetype/internal/services/svpscmap.h
+++ b/include/freetype/internal/services/svpscmap.h
@@ -2,7 +2,7 @@
 /*                                                                         */
 /*  svpscmap.h                                                             */
 /*                                                                         */
-/*    The FreeType PostScript charmap service (specification)              */
+/*    The FreeType PostScript charmap service (specification).             */
 /*                                                                         */
 /*  Copyright 2003 by                                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
@@ -33,7 +33,7 @@
   (*PS_Unicode_ValueFunc)( const char*  glyph_name );
 
   /*
-   *  Unicode value to Adobe glyph name index. 0xFFFF if not found
+   *  Unicode value to Adobe glyph name index.  0xFFFF if not found.
    */
   typedef FT_UInt
   (*PS_Unicode_Index_Func)( FT_UInt       num_glyphs,
@@ -41,13 +41,13 @@
                             FT_ULong      unicode );
 
   /*
-   *  Macintosh name id to glyph name, NULL if invalid index
+   *  Macintosh name id to glyph name.  NULL if invalid index.
    */
   typedef const char*
   (*PS_Macintosh_Name_Func)( FT_UInt  name_index );
 
   /*
-   *  Adobe standard string id to glyph name, NULL if invalid index
+   *  Adobe standard string ID to glyph name.  NULL if invalid index.
    */
   typedef const char*
   (*PS_Adobe_Std_Strings_Func)( FT_UInt  string_index );
@@ -101,10 +101,13 @@
     const unsigned short*      adobe_expert_encoding;
   };
 
- /* */
+  /* */
 
 
 FT_END_HEADER
 
 
-#endif /* __SVPSNAME_H__ */
+#endif /* __SVPSCMAP_H__ */
+
+
+/* END */
--- a/include/freetype/internal/services/svpsinfo.h
+++ b/include/freetype/internal/services/svpsinfo.h
@@ -1,30 +1,55 @@
-#ifndef __SVPSINFO_H__
-#define __SVPSINFO_H__
-
-#include FT_INTERNAL_SERVICE_H
-#include FT_INTERNAL_TYPE1_TYPES_H
-
-FT_BEGIN_HEADER
-
-
-#define FT_SERVICE_ID_POSTSCRIPT_INFO  "postscript-info"
-
-  typedef FT_Error  (*PS_GetFontInfoFunc)( FT_Face          face,
-                                           PS_FontInfoRec*  afont_info );
-
-  typedef FT_Int    (*PS_HasGlyphNamesFunc)( FT_Face   face );
-
-  FT_DEFINE_SERVICE( PsInfo )
-  {
-    PS_GetFontInfoFunc    ps_get_font_info;
-    PS_HasGlyphNamesFunc  ps_has_glyph_names;
-  };
-
-  /* */
-
-
-FT_END_HEADER
-
-
-
-#endif /* __SVPSINFO_H__ */
+/***************************************************************************/
+/*                                                                         */
+/*  svpsinfo.h                                                             */
+/*                                                                         */
+/*    The FreeType PostScript info service (specification).                */
+/*                                                                         */
+/*  Copyright 2003 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 __SVPSINFO_H__
+#define __SVPSINFO_H__
+
+#include FT_INTERNAL_SERVICE_H
+#include FT_INTERNAL_TYPE1_TYPES_H
+
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_POSTSCRIPT_INFO  "postscript-info"
+
+
+  typedef FT_Error
+  (*PS_GetFontInfoFunc)( FT_Face          face,
+                         PS_FontInfoRec*  afont_info );
+
+  typedef FT_Int
+  (*PS_HasGlyphNamesFunc)( FT_Face   face );
+
+
+  FT_DEFINE_SERVICE( PsInfo )
+  {
+    PS_GetFontInfoFunc    ps_get_font_info;
+    PS_HasGlyphNamesFunc  ps_has_glyph_names;
+  };
+
+  /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVPSINFO_H__ */
+
+
+/* END */
--- a/include/freetype/internal/services/svsfnt.h
+++ b/include/freetype/internal/services/svsfnt.h
@@ -53,8 +53,8 @@
  
   FT_DEFINE_SERVICE( SFNT_Table )
   {
-    FT_SFNT_TableLoadFunc    load_table;
-    FT_SFNT_TableGetFunc     get_table;
+    FT_SFNT_TableLoadFunc  load_table;
+    FT_SFNT_TableGetFunc   get_table;
   };
 
   /* */
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -2480,8 +2480,8 @@
   FT_Get_Sfnt_Table( FT_Face      face,
                      FT_Sfnt_Tag  tag )
   {
-    void*                   table = 0;
-    FT_Service_SFNT_Table   service;
+    void*                  table = 0;
+    FT_Service_SFNT_Table  service;
 
 
     if ( face && FT_IS_SFNT( face ) )
--- a/src/base/fttype1.c
+++ b/src/base/fttype1.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility file for PS names support (body).                   */
 /*                                                                         */
-/*  Copyright 2002 by                                                      */
+/*  Copyright 2002, 2003 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -30,15 +30,18 @@
   {
     FT_Error  error = FT_Err_Invalid_Argument;
 
+
     if ( face )
     {
-      FT_Service_PsInfo   service = NULL;
+      FT_Service_PsInfo  service = NULL;
 
-      FT_FACE_FIND_SERVICE( service, face, POSTSCRIPT_INFO );
 
+      FT_FACE_FIND_SERVICE( face, face, POSTSCRIPT_INFO );
+
       if ( service && service->ps_get_font_info )
         error = service->ps_get_font_info( face, afont_info );
     }
+
     return error;
   }
 
@@ -51,13 +54,15 @@
     FT_Int             result  = 0;
     FT_Service_PsInfo  service = NULL;
 
+
     if ( face )
     {
-      FT_FACE_FIND_SERVICE( service, face, POSTSCRIPT_INFO );
+      FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
 
       if ( service && service->ps_has_glyph_names )
         result = service->ps_has_glyph_names( face );
     }
+
     return result;
   }
 
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -315,6 +315,7 @@
     (FT_GlyphDict_NameIndexFunc)cff_get_name_index,
   };
 
+
  /*
   *  POSTSCRIPT INFO SERVICE
   *
@@ -327,14 +328,14 @@
     return 1;
   }
 
+
   static const FT_Service_PsInfoRec  cff_service_ps_info =
   {
-    (PS_GetFontInfoFunc)    NULL,  /* unsupported with CFF fonts */
-    (PS_HasGlyphNamesFunc)  cff_ps_has_glyph_names
+    (PS_GetFontInfoFunc)  NULL,         /* unsupported with CFF fonts */
+    (PS_HasGlyphNamesFunc)cff_ps_has_glyph_names
   };
 
 
-
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
@@ -362,14 +363,15 @@
   cff_get_interface( CFF_Driver   driver,
                      const char*  module_interface )
   {
-    FT_Module  sfnt;
+    FT_Module            sfnt;
     FT_Module_Interface  result;
 
+
     result = ft_service_list_lookup( cff_services, module_interface );
     if ( result != NULL )
       return  result;
 
-    /* we simply pass our request to the `sfnt' module */
+    /* we pass our request to the `sfnt' module */
     sfnt = FT_Get_Module( driver->root.root.library, "sfnt" );
 
     return sfnt ? sfnt->clazz->get_interface( sfnt, module_interface ) : 0;
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -324,7 +324,7 @@
         /* FreeType 2                                                */
       }
 
-     /* now, load the CFF part of the file */
+      /* now, load the CFF part of the file */
       error = face->goto_table( face, TTAG_CFF, stream, 0 );
       if ( error )
         goto Exit;
--- a/src/cid/cidriver.c
+++ b/src/cid/cidriver.c
@@ -75,10 +75,11 @@
     return 0;
   }
 
+
   static const FT_Service_PsInfoRec  cid_service_ps_info =
   {
-    (PS_GetFontInfoFunc)    cid_ps_get_font_info,
-    (PS_HasGlyphNamesFunc)  NULL  /* unsupported with CID fonts */
+    (PS_GetFontInfoFunc)  cid_ps_get_font_info,
+    (PS_HasGlyphNamesFunc)NULL          /* unsupported with CID fonts */
   };
 
 
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -241,7 +241,7 @@
     return result;
   }
 
-  static const FT_Service_PsFontNameRec   sfnt_service_ps_name =
+  static const FT_Service_PsFontNameRec  sfnt_service_ps_name =
   {
     (FT_PsName_GetFunc)sfnt_get_ps_name
   };
@@ -255,9 +255,9 @@
 
   static const FT_ServiceDescRec  sfnt_services[] =
   {
-    { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, & sfnt_service_ps_name },
+    { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name },
 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
-    { FT_SERVICE_ID_GLYPH_DICT,           & sfnt_service_glyph_dict },
+    { FT_SERVICE_ID_GLYPH_DICT,           &sfnt_service_glyph_dict },
 #endif
 
     { NULL, NULL }
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -149,6 +149,7 @@
     return 0;
   }
 
+
   static FT_Int
   t1_ps_has_glyph_names( FT_Face  face )
   {
@@ -156,11 +157,13 @@
     return 1;
   }
 
+
   static const FT_Service_PsInfoRec  t1_service_ps_info =
   {
-    (PS_GetFontInfoFunc)    t1_ps_get_font_info,
-    (PS_HasGlyphNamesFunc)  t1_ps_has_glyph_names
+    (PS_GetFontInfoFunc)  t1_ps_get_font_info,
+    (PS_HasGlyphNamesFunc)t1_ps_has_glyph_names
   };
+
 
  /*
   *  SERVICE LIST
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -275,11 +275,11 @@
                 FT_Int         num_params,
                 FT_Parameter*  params )
   {
-    FT_Error         error;
+    FT_Error            error;
     FT_Service_PsCMaps  psnames;
-    PSAux_Service    psaux;
-    T1_Font          type1 = &face->type1;
-    PS_FontInfo      info = &type1->font_info;
+    PSAux_Service       psaux;
+    T1_Font             type1 = &face->type1;
+    PS_FontInfo         info = &type1->font_info;
 
     FT_UNUSED( num_params );
     FT_UNUSED( params );
--- a/src/type42/t42drivr.c
+++ b/src/type42/t42drivr.c
@@ -129,6 +129,7 @@
 
 
  /*
+  *
   *  POSTSCRIPT INFO SERVICE
   *
   */
@@ -141,6 +142,7 @@
     return 0;
   }
 
+
   static FT_Int
   t42_ps_has_glyph_names( FT_Face  face )
   {
@@ -148,10 +150,11 @@
     return 1;
   }
 
+
   static const FT_Service_PsInfoRec  t42_service_ps_info =
   {
-    (PS_GetFontInfoFunc)    t42_ps_get_font_info,
-    (PS_HasGlyphNamesFunc)  t42_ps_has_glyph_names
+    (PS_GetFontInfoFunc)  t42_ps_get_font_info,
+    (PS_HasGlyphNamesFunc)t42_ps_has_glyph_names
   };
 
 
@@ -165,6 +168,7 @@
   {
     { FT_SERVICE_ID_GLYPH_DICT,           &t42_service_glyph_dict },
     { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t42_service_ps_font_name },
+    { FT_SERVICE_ID_POSTSCRIPT_INFO,      &t42_service_ps_info },
     { FT_SERVICE_ID_XF86_NAME,            FT_XF86_FORMAT_TYPE_42 },
     { NULL, NULL }
   };