shithub: freetype+ttf2subf

Download patch

ref: ab4fc4da58d0ac9ed662a5856034112af9647aaf
parent: 9657ef0598f29d50344956e6c7e2923ad9137bd3
author: David Turner <[email protected]>
date: Thu Mar 14 03:57:10 EST 2002

* include/freetype/internal/cfftypes.h, src/cff/*.c: updating the
        type definitions of the CFF font driver

        (i.e. CFF_Font  => CFF_FontRec
              CFF_Font* => CFF_Font, etc...)

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,11 @@
         (i.e. FT_AutoHinter_Interface  => FT_AutoHinter_ServiceRec, 
               FT_AutoHinter_Interface* => FT_AutoHinter_Service, etc..)
 
+        * include/freetype/internal/cfftypes.h, src/cff/*.c: updating the
+        type definitions of the CFF font driver
+        
+        (i.e. CFF_Font  => CFF_FontRec
+              CFF_Font* => CFF_Font, etc...)
 
 
 2002-03-13  Antoine Leca    <[email protected]>
--- a/include/freetype/internal/cfftypes.h
+++ b/include/freetype/internal/cfftypes.h
@@ -74,7 +74,7 @@
   } CFF_EncodingRec, *CFF_Encoding;
 
 
-  typedef struct  CFF_Charset_
+  typedef struct  CFF_CharsetRec_
   {
 
     FT_UInt     format;
@@ -82,10 +82,10 @@
 
     FT_UShort*  sids;
 
-  } CFF_Charset;
+  } CFF_CharsetRec, *CFF_Charset;
 
 
-  typedef struct  CFF_Font_Dict_
+  typedef struct  CFF_FontRecDictRec_
   {
     FT_UInt    version;
     FT_UInt    notice;
@@ -129,7 +129,7 @@
     FT_ULong   cid_fd_select_offset;
     FT_UInt    cid_font_name;
 
-  } CFF_Font_Dict;
+  } CFF_FontRecDictRec, *CFF_FontRecDict;
 
 
   typedef struct  CFF_PrivateRec_
@@ -167,7 +167,7 @@
   } CFF_PrivateRec, *CFF_Private;
 
 
-  typedef struct  CFF_FD_Select_
+  typedef struct  CFF_FDSelectRec_
   {
     FT_Byte   format;
     FT_UInt   range_count;
@@ -181,21 +181,21 @@
     FT_UInt   cache_count;
     FT_Byte   cache_fd;
 
-  } CFF_FD_Select;
+  } CFF_FDSelectRec, *CFF_FDSelect;
 
 
   /* A SubFont packs a font dict and a private dict together. They are */
   /* needed to support CID-keyed CFF fonts.                            */
-  typedef struct  CFF_SubFont_
+  typedef struct  CFF_SubFontRec_
   {
-    CFF_Font_Dict  font_dict;
-    CFF_PrivateRec    private_dict;
+    CFF_FontRecDictRec  font_dict;
+    CFF_PrivateRec   private_dict;
 
-    CFF_IndexRec      local_subrs_index;
-    FT_UInt        num_local_subrs;
-    FT_Byte**      local_subrs;
+    CFF_IndexRec     local_subrs_index;
+    FT_UInt          num_local_subrs;
+    FT_Byte**        local_subrs;
 
-  } CFF_SubFont;
+  } CFF_SubFontRec, *CFF_SubFont;
 
 
   /* maximum number of sub-fonts in a CID-keyed file */
@@ -202,46 +202,46 @@
 #define CFF_MAX_CID_FONTS  16
 
 
-  typedef struct  CFF_Font_
+  typedef struct  CFF_FontRec_
   {
-    FT_Stream      stream;
-    FT_Memory      memory;
-    FT_UInt        num_faces;
-    FT_UInt        num_glyphs;
+    FT_Stream        stream;
+    FT_Memory        memory;
+    FT_UInt          num_faces;
+    FT_UInt          num_glyphs;
 
-    FT_Byte        version_major;
-    FT_Byte        version_minor;
-    FT_Byte        header_size;
-    FT_Byte        absolute_offsize;
+    FT_Byte          version_major;
+    FT_Byte          version_minor;
+    FT_Byte          header_size;
+    FT_Byte          absolute_offsize;
 
 
-    CFF_IndexRec      name_index;
-    CFF_IndexRec      top_dict_index;
-    CFF_IndexRec      string_index;
-    CFF_IndexRec      global_subrs_index;
+    CFF_IndexRec     name_index;
+    CFF_IndexRec     top_dict_index;
+    CFF_IndexRec     string_index;
+    CFF_IndexRec     global_subrs_index;
 
-    CFF_EncodingRec   encoding;
-    CFF_Charset    charset;
+    CFF_EncodingRec  encoding;
+    CFF_CharsetRec   charset;
 
-    CFF_IndexRec      charstrings_index;
-    CFF_IndexRec      font_dict_index;
-    CFF_IndexRec      private_index;
-    CFF_IndexRec      local_subrs_index;
+    CFF_IndexRec     charstrings_index;
+    CFF_IndexRec     font_dict_index;
+    CFF_IndexRec     private_index;
+    CFF_IndexRec     local_subrs_index;
 
-    FT_String*     font_name;
-    FT_UInt        num_global_subrs;
-    FT_Byte**      global_subrs;
+    FT_String*       font_name;
+    FT_UInt          num_global_subrs;
+    FT_Byte**        global_subrs;
 
-    CFF_SubFont    top_font;
-    FT_UInt        num_subfonts;
-    CFF_SubFont*   subfonts[CFF_MAX_CID_FONTS];
+    CFF_SubFontRec   top_font;
+    FT_UInt          num_subfonts;
+    CFF_SubFont      subfonts[CFF_MAX_CID_FONTS];
 
-    CFF_FD_Select  fd_select;
+    CFF_FDSelectRec  fd_select;
 
     /* interface to PostScript hinter */
-    void*          pshinter;
+    void*            pshinter;
 
-  } CFF_Font;
+  } CFF_FontRec, *CFF_Font;
 
 
 FT_END_HEADER
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -228,7 +228,7 @@
                       FT_Pointer  buffer,
                       FT_UInt     buffer_max )
   {
-    CFF_Font*           font   = (CFF_Font*)face->extra.data;
+    CFF_Font           font   = (CFF_Font)face->extra.data;
     FT_Memory           memory = FT_FACE_MEMORY( face );
     FT_String*          gname;
     FT_UShort           sid;
@@ -383,8 +383,8 @@
   cff_get_name_index( CFF_Face    face,
                       FT_String*  glyph_name )
   {
-    CFF_Font*        cff;
-    CFF_Charset*     charset;
+    CFF_Font        cff;
+    CFF_Charset     charset;
     PSNames_Service  psnames;
     FT_Memory        memory = FT_FACE_MEMORY( face );
     FT_String*       name;
@@ -393,7 +393,7 @@
     FT_Int           result;
 
 
-    cff     = (CFF_Font *)face->extra.data;
+    cff     = (CFF_FontRec *)face->extra.data;
     charset = &cff->charset;
 
     psnames = (PSNames_Service)FT_Get_Module_Interface(
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -352,7 +352,7 @@
                     CFF_GlyphSlot  slot,
                     FT_Bool        hinting )
   {
-    CFF_Font*  cff = (CFF_Font*)face->extra.data;
+    CFF_Font  cff = (CFF_Font)face->extra.data;
 
 
     /* clear everything */
@@ -373,8 +373,8 @@
   CFF_Prepare_Decoder( CFF_Decoder*  decoder,
                        FT_UInt       glyph_index )
   {
-    CFF_Font*     cff = (CFF_Font*)decoder->builder.face->extra.data;
-    CFF_SubFont*  sub = &cff->top_font;
+    CFF_Font     cff = (CFF_Font)decoder->builder.face->extra.data;
+    CFF_SubFont  sub = &cff->top_font;
 
 
     /* manage CID fonts */
@@ -532,7 +532,7 @@
 
 
   static FT_Int
-  cff_lookup_glyph_by_stdcharcode( CFF_Font*  cff,
+  cff_lookup_glyph_by_stdcharcode( CFF_Font  cff,
                                    FT_Int     charcode )
   {
     FT_UInt    n;
@@ -567,7 +567,7 @@
     FT_Int       bchar_index, achar_index, n_base_points;
     FT_Outline*  base = decoder->builder.base;
     TT_Face      face = decoder->builder.face;
-    CFF_Font*    cff  = (CFF_Font*)(face->extra.data);
+    CFF_Font    cff  = (CFF_Font)(face->extra.data);
     FT_Vector    left_bearing, advance;
     FT_Byte*     charstring;
     FT_ULong     charstring_len;
@@ -2115,7 +2115,7 @@
     FT_Error     error = 0;
     CFF_Decoder  decoder;
     FT_Int       glyph_index;
-    CFF_Font*    cff = (CFF_Font*)face->other;
+    CFF_Font    cff = (CFF_Font)face->other;
 
 
     *max_advance = 0;
@@ -2185,7 +2185,7 @@
     CFF_Decoder  decoder;
     TT_Face      face = (TT_Face)glyph->root.face;
     FT_Bool      hinting;
-    CFF_Font*    cff = (CFF_Font*)face->extra.data;
+    CFF_Font    cff = (CFF_Font)face->extra.data;
 
     FT_Matrix    font_matrix;
     FT_Vector    font_offset;
--- a/src/cff/cffgload.h
+++ b/src/cff/cffgload.h
@@ -132,7 +132,7 @@
   typedef struct  CFF_Decoder_
   {
     CFF_Builder        builder;
-    CFF_Font*          cff;
+    CFF_Font          cff;
 
     FT_Fixed           stack[CFF_MAX_OPERANDS + 1];
     FT_Fixed*          top;
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -1357,7 +1357,7 @@
 
 
   static void
-  CFF_Done_FD_Select( CFF_FD_Select*  select,
+  CFF_Done_FD_Select( CFF_FDSelect  select,
                       FT_Stream       stream )
   {
     if ( select->data )
@@ -1370,7 +1370,7 @@
 
 
   static FT_Error
-  CFF_Load_FD_Select( CFF_FD_Select*  select,
+  CFF_Load_FD_Select( CFF_FDSelect  select,
                       FT_UInt         num_glyphs,
                       FT_Stream       stream,
                       FT_ULong        offset )
@@ -1414,7 +1414,7 @@
 
 
   FT_LOCAL_DEF( FT_Byte )
-  CFF_Get_FD( CFF_FD_Select*  select,
+  CFF_Get_FD( CFF_FDSelect  select,
               FT_UInt         glyph_index )
   {
     FT_Byte  fd = 0;
@@ -1500,7 +1500,7 @@
 
 
   static void
-  CFF_Done_Charset( CFF_Charset*  charset,
+  CFF_Done_Charset( CFF_Charset  charset,
                     FT_Stream     stream )
   {
     FT_Memory  memory = stream->memory;
@@ -1514,7 +1514,7 @@
 
 
   static FT_Error
-  CFF_Load_Charset( CFF_Charset*  charset,
+  CFF_Load_Charset( CFF_Charset  charset,
                     FT_UInt       num_glyphs,
                     FT_Stream     stream,
                     FT_ULong      base_offset,
@@ -1694,7 +1694,7 @@
 
   static FT_Error
   CFF_Load_Encoding( CFF_Encoding  encoding,
-                     CFF_Charset*   charset,
+                     CFF_Charset   charset,
                      FT_UInt        num_glyphs,
                      FT_Stream      stream,
                      FT_ULong       base_offset,
@@ -1957,7 +1957,7 @@
 
 
   static FT_Error
-  CFF_Load_SubFont( CFF_SubFont*  font,
+  CFF_Load_SubFont( CFF_SubFont  font,
                     CFF_Index     idx,
                     FT_UInt       font_index,
                     FT_Stream     stream,
@@ -1967,7 +1967,7 @@
     CFF_Parser      parser;
     FT_Byte*        dict;
     FT_ULong        dict_len;
-    CFF_Font_Dict*  top  = &font->font_dict;
+    CFF_FontRecDict  top  = &font->font_dict;
     CFF_Private    priv = &font->private_dict;
 
 
@@ -2046,7 +2046,7 @@
 
   static void
   CFF_Done_SubFont( FT_Memory     memory,
-                    CFF_SubFont*  subfont )
+                    CFF_SubFont  subfont )
   {
     if ( subfont )
     {
@@ -2059,12 +2059,12 @@
   FT_LOCAL_DEF( FT_Error )
   CFF_Load_Font( FT_Stream  stream,
                  FT_Int     face_index,
-                 CFF_Font*  font )
+                 CFF_Font  font )
   {
     static const FT_Frame_Field  cff_header_fields[] =
     {
 #undef  FT_STRUCTURE
-#define FT_STRUCTURE  CFF_Font
+#define FT_STRUCTURE  CFF_FontRec
 
       FT_FRAME_START( 4 ),
         FT_FRAME_BYTE( version_major ),
@@ -2077,7 +2077,7 @@
     FT_Error        error;
     FT_Memory       memory = stream->memory;
     FT_ULong        base_offset;
-    CFF_Font_Dict*  dict;
+    CFF_FontRecDict  dict;
 
 
     MEM_Set( font, 0, sizeof ( *font ) );
@@ -2138,7 +2138,7 @@
     if ( dict->cid_registry )
     {
       CFF_IndexRec  fd_index;
-      CFF_SubFont*  sub;
+      CFF_SubFont  sub;
       FT_UInt       idx;
 
 
@@ -2159,7 +2159,7 @@
 
       /* allocate & read each font dict independently */
       font->num_subfonts = fd_index.count;
-      if ( ALLOC_ARRAY( sub, fd_index.count, CFF_SubFont ) )
+      if ( ALLOC_ARRAY( sub, fd_index.count, CFF_SubFontRec ) )
         goto Fail_CID;
 
       /* setup pointer table */
@@ -2240,7 +2240,7 @@
 
 
   FT_LOCAL_DEF( void )
-  CFF_Done_Font( CFF_Font*  font )
+  CFF_Done_Font( CFF_Font  font )
   {
     FT_Memory  memory = font->memory;
     FT_UInt    idx;
--- a/src/cff/cffload.h
+++ b/src/cff/cffload.h
@@ -55,14 +55,14 @@
   FT_LOCAL( FT_Error )
   CFF_Load_Font( FT_Stream  stream,
                  FT_Int     face_index,
-                 CFF_Font*  font );
+                 CFF_Font  font );
 
   FT_LOCAL( void )
-  CFF_Done_Font( CFF_Font*  font );
+  CFF_Done_Font( CFF_Font  font );
 
 
   FT_LOCAL( FT_Byte )
-  CFF_Get_FD( CFF_FD_Select*  select,
+  CFF_Get_FD( CFF_FDSelect  select,
               FT_UInt         glyph_index );
 
 
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -60,7 +60,7 @@
   CFF_Size_Get_Globals_Funcs( CFF_Size  size )
   {
     CFF_Face          face     = (CFF_Face)size->face;
-    CFF_Font*         font     = (CFF_Font *)face->extra.data;
+    CFF_Font         font     = (CFF_FontRec *)face->extra.data;
     PSHinter_Service  pshinter = (PSHinter_Service)font->pshinter;
     FT_Module         module;
 
@@ -101,8 +101,8 @@
     {
       PSH_Globals    globals;
       CFF_Face       face    = (CFF_Face)size->face;
-      CFF_Font*      font    = (CFF_Font *)face->extra.data;
-      CFF_SubFont*   subfont = &font->top_font;
+      CFF_Font      font    = (CFF_FontRec *)face->extra.data;
+      CFF_SubFont   subfont = &font->top_font;
 
       CFF_Private   cpriv   = &subfont->private_dict;
       PS_PrivateRec  priv;
@@ -196,7 +196,7 @@
   CFF_GlyphSlot_Init( CFF_GlyphSlot  slot )
   {
     CFF_Face          face     = (CFF_Face)slot->root.face;
-    CFF_Font*         font     = (CFF_Font *)face->extra.data;
+    CFF_Font         font     = (CFF_FontRec *)face->extra.data;
     PSHinter_Service  pshinter = (PSHinter_Service)font->pshinter;
 
 
@@ -257,12 +257,12 @@
                              FT_ULong            base_offset,
                              PSNames_Service  psnames )
   {
-    CFF_Font*       font = (CFF_Font*)face->extra.data;
+    CFF_Font       font = (CFF_Font)face->extra.data;
     FT_Memory       memory = FT_FACE_MEMORY(face);
     FT_UInt         n, num_glyphs = face->root.num_glyphs;
     const char**    glyph_names;
     FT_Error        error;
-    CFF_Font_Dict*  dict = &font->top_font.font_dict;
+    CFF_FontRecDict  dict = &font->top_font.font_dict;
     FT_ULong        charset_offset;
     FT_Byte         format;
     FT_Stream       stream = face->root.stream;
@@ -527,7 +527,7 @@
 
     /* now load and parse the CFF table in the file */
     {
-      CFF_Font*  cff;
+      CFF_Font  cff;
       FT_Memory  memory = face->root.memory;
       FT_Face    root;
       FT_UInt    flags;
@@ -551,7 +551,7 @@
 
       if ( pure_cff )
       {
-        CFF_Font_Dict*  dict = &cff->top_font.font_dict;
+        CFF_FontRecDict  dict = &cff->top_font.font_dict;
 
 
         /* we need the `PSNames' module for pure-CFF and CEF formats */
@@ -716,7 +716,7 @@
       sfnt->done_face( face );
 
     {
-      CFF_Font*  cff = (CFF_Font*)face->extra.data;
+      CFF_Font  cff = (CFF_Font)face->extra.data;
 
 
       if ( cff )
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -313,7 +313,7 @@
   static FT_Error
   cff_parse_font_matrix( CFF_Parser*  parser )
   {
-    CFF_Font_Dict*  dict   = (CFF_Font_Dict*)parser->object;
+    CFF_FontRecDict  dict   = (CFF_FontRecDict)parser->object;
     FT_Matrix*      matrix = &dict->font_matrix;
     FT_Vector*      offset = &dict->font_offset;
     FT_UShort*      upm    = &dict->units_per_em;
@@ -361,7 +361,7 @@
   static FT_Error
   cff_parse_font_bbox( CFF_Parser*  parser )
   {
-    CFF_Font_Dict*  dict = (CFF_Font_Dict*)parser->object;
+    CFF_FontRecDict  dict = (CFF_FontRecDict)parser->object;
     FT_BBox*        bbox = &dict->font_bbox;
     FT_Byte**       data = parser->stack;
     FT_Error        error;
@@ -385,7 +385,7 @@
   static FT_Error
   cff_parse_private_dict( CFF_Parser*  parser )
   {
-    CFF_Font_Dict*  dict = (CFF_Font_Dict*)parser->object;
+    CFF_FontRecDict  dict = (CFF_FontRecDict)parser->object;
     FT_Byte**       data = parser->stack;
     FT_Error        error;
 
@@ -406,7 +406,7 @@
   static FT_Error
   cff_parse_cid_ros( CFF_Parser*  parser )
   {
-    CFF_Font_Dict*  dict = (CFF_Font_Dict*)parser->object;
+    CFF_FontRecDict  dict = (CFF_FontRecDict)parser->object;
     FT_Byte**       data = parser->stack;
     FT_Error        error;
 
--- a/src/cff/cfftoken.h
+++ b/src/cff/cfftoken.h
@@ -17,7 +17,7 @@
 
 
 #undef  FT_STRUCTURE
-#define FT_STRUCTURE  CFF_Font_Dict
+#define FT_STRUCTURE  CFF_FontRecDictRec
 
 #undef  CFFCODE
 #define CFFCODE        CFFCODE_TOPDICT