src/java.desktop/share/native/libfreetype/src/sfnt/sfdriver.c
changeset 54876 da3834261f0c
parent 49234 3375a8039fde
equal deleted inserted replaced
54875:bcfedddcf4ce 54876:da3834261f0c
     1 /***************************************************************************/
     1 /****************************************************************************
     2 /*                                                                         */
     2  *
     3 /*  sfdriver.c                                                             */
     3  * sfdriver.c
     4 /*                                                                         */
     4  *
     5 /*    High-level SFNT driver interface (body).                             */
     5  *   High-level SFNT driver interface (body).
     6 /*                                                                         */
     6  *
     7 /*  Copyright 1996-2018 by                                                 */
     7  * Copyright (C) 1996-2019 by
     8 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
     8  * David Turner, Robert Wilhelm, and Werner Lemberg.
     9 /*                                                                         */
     9  *
    10 /*  This file is part of the FreeType project, and may only be used,       */
    10  * This file is part of the FreeType project, and may only be used,
    11 /*  modified, and distributed under the terms of the FreeType project      */
    11  * modified, and distributed under the terms of the FreeType project
    12 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
    12  * license, LICENSE.TXT.  By continuing to use, modify, or distribute
    13 /*  this file you indicate that you have read the license and              */
    13  * this file you indicate that you have read the license and
    14 /*  understand and accept it fully.                                        */
    14  * understand and accept it fully.
    15 /*                                                                         */
    15  *
    16 /***************************************************************************/
    16  */
    17 
    17 
    18 
    18 
    19 #include <ft2build.h>
    19 #include <ft2build.h>
    20 #include FT_INTERNAL_DEBUG_H
    20 #include FT_INTERNAL_DEBUG_H
    21 #include FT_INTERNAL_SFNT_H
    21 #include FT_INTERNAL_SFNT_H
    23 #include FT_TRUETYPE_IDS_H
    23 #include FT_TRUETYPE_IDS_H
    24 
    24 
    25 #include "sfdriver.h"
    25 #include "sfdriver.h"
    26 #include "ttload.h"
    26 #include "ttload.h"
    27 #include "sfobjs.h"
    27 #include "sfobjs.h"
    28 #include "sfntpic.h"
       
    29 
    28 
    30 #include "sferrors.h"
    29 #include "sferrors.h"
    31 
    30 
    32 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
    31 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
    33 #include "ttsbit.h"
    32 #include "ttsbit.h"
       
    33 #endif
       
    34 
       
    35 #ifdef TT_CONFIG_OPTION_COLOR_LAYERS
       
    36 #include "ttcolr.h"
       
    37 #include "ttcpal.h"
    34 #endif
    38 #endif
    35 
    39 
    36 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
    40 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
    37 #include "ttpost.h"
    41 #include "ttpost.h"
    38 #endif
    42 #endif
    55 #include FT_MULTIPLE_MASTERS_H
    59 #include FT_MULTIPLE_MASTERS_H
    56 #include FT_SERVICE_MULTIPLE_MASTERS_H
    60 #include FT_SERVICE_MULTIPLE_MASTERS_H
    57 #endif
    61 #endif
    58 
    62 
    59 
    63 
    60   /*************************************************************************/
    64   /**************************************************************************
    61   /*                                                                       */
    65    *
    62   /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
    66    * The macro FT_COMPONENT is used in trace mode.  It is an implicit
    63   /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
    67    * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
    64   /* messages during execution.                                            */
    68    * messages during execution.
    65   /*                                                                       */
    69    */
    66 #undef  FT_COMPONENT
    70 #undef  FT_COMPONENT
    67 #define FT_COMPONENT  trace_sfdriver
    71 #define FT_COMPONENT  sfdriver
    68 
    72 
    69 
    73 
    70   /*
    74   /*
    71    *  SFNT TABLE SERVICE
    75    * SFNT TABLE SERVICE
    72    *
    76    *
    73    */
    77    */
    74 
    78 
    75   static void*
    79   static void*
    76   get_sfnt_table( TT_Face      face,
    80   get_sfnt_table( TT_Face      face,
   153 
   157 
   154 
   158 
   155 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
   159 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
   156 
   160 
   157   /*
   161   /*
   158    *  GLYPH DICT SERVICE
   162    * GLYPH DICT SERVICE
   159    *
   163    *
   160    */
   164    */
   161 
   165 
   162   static FT_Error
   166   static FT_Error
   163   sfnt_get_glyph_name( FT_Face     face,
   167   sfnt_get_glyph_name( FT_Face     face,
   220 
   224 
   221 #endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
   225 #endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
   222 
   226 
   223 
   227 
   224   /*
   228   /*
   225    *  POSTSCRIPT NAME SERVICE
   229    * POSTSCRIPT NAME SERVICE
   226    *
   230    *
   227    */
   231    */
   228 
   232 
   229   /* an array representing allowed ASCII characters in a PS string */
   233   /* an array representing allowed ASCII characters in a PS string */
   230   static const unsigned char sfnt_ps_map[16] =
   234   static const unsigned char sfnt_ps_map[16] =
   458 
   462 
   459 
   463 
   460   typedef int (*char_type_func)( int  c );
   464   typedef int (*char_type_func)( int  c );
   461 
   465 
   462 
   466 
   463   /* handling of PID/EID 3/0 and 3/1 is the same */
   467   /* Handling of PID/EID 3/0 and 3/1 is the same. */
   464 #define IS_WIN( n )  ( (n)->platformID == 3                             && \
   468 #define IS_WIN( n )  ( (n)->platformID == 3                             && \
   465                        ( (n)->encodingID == 1 || (n)->encodingID == 0 ) && \
   469                        ( (n)->encodingID == 1 || (n)->encodingID == 0 ) )
   466                        (n)->languageID == 0x409                         )
       
   467 
   470 
   468 #define IS_APPLE( n )  ( (n)->platformID == 1 && \
   471 #define IS_APPLE( n )  ( (n)->platformID == 1 && \
   469                          (n)->encodingID == 0 && \
   472                          (n)->encodingID == 0 )
   470                          (n)->languageID == 0 )
       
   471 
   473 
   472   static char*
   474   static char*
   473   get_win_string( FT_Memory       memory,
   475   get_win_string( FT_Memory       memory,
   474                   FT_Stream       stream,
   476                   FT_Stream       stream,
   475                   TT_Name         entry,
   477                   TT_Name         entry,
   489     if ( FT_ALLOC( result, entry->stringLength / 2 + 1 ) )
   491     if ( FT_ALLOC( result, entry->stringLength / 2 + 1 ) )
   490       return NULL;
   492       return NULL;
   491 
   493 
   492     if ( FT_STREAM_SEEK( entry->stringOffset ) ||
   494     if ( FT_STREAM_SEEK( entry->stringOffset ) ||
   493          FT_FRAME_ENTER( entry->stringLength ) )
   495          FT_FRAME_ENTER( entry->stringLength ) )
   494     {
   496       goto get_win_string_error;
   495       FT_FREE( result );
       
   496       entry->stringLength = 0;
       
   497       entry->stringOffset = 0;
       
   498       FT_FREE( entry->string );
       
   499 
       
   500       return NULL;
       
   501     }
       
   502 
   497 
   503     r = (FT_String*)result;
   498     r = (FT_String*)result;
   504     p = (FT_Char*)stream->cursor;
   499     p = (FT_Char*)stream->cursor;
   505 
   500 
   506     for ( len = entry->stringLength / 2; len > 0; len--, p += 2 )
   501     for ( len = entry->stringLength / 2; len > 0; len--, p += 2 )
   507     {
   502     {
   508       if ( p[0] == 0 )
   503       if ( p[0] == 0 && char_type( p[1] ) )
       
   504         *r++ = p[1];
       
   505       else
   509       {
   506       {
   510         if ( char_type( p[1] ) )
   507         if ( report_invalid_characters )
   511           *r++ = p[1];
   508           FT_TRACE0(( "get_win_string:"
   512         else
   509                       " Character 0x%X invalid in PS name string\n",
   513         {
   510                       ((unsigned)p[0])*256 + (unsigned)p[1] ));
   514           if ( report_invalid_characters )
   511         break;
   515           {
       
   516             FT_TRACE0(( "get_win_string:"
       
   517                         " Character `%c' (0x%X) invalid in PS name string\n",
       
   518                         p[1], p[1] ));
       
   519             /* it's not the job of FreeType to correct PS names... */
       
   520             *r++ = p[1];
       
   521           }
       
   522         }
       
   523       }
   512       }
   524     }
   513     }
   525     *r = '\0';
   514     if ( !len )
       
   515       *r = '\0';
   526 
   516 
   527     FT_FRAME_EXIT();
   517     FT_FRAME_EXIT();
   528 
   518 
   529     return result;
   519     if ( !len )
       
   520       return result;
       
   521 
       
   522   get_win_string_error:
       
   523     FT_FREE( result );
       
   524 
       
   525     entry->stringLength = 0;
       
   526     entry->stringOffset = 0;
       
   527     FT_FREE( entry->string );
       
   528 
       
   529     return NULL;
   530   }
   530   }
   531 
   531 
   532 
   532 
   533   static char*
   533   static char*
   534   get_apple_string( FT_Memory       memory,
   534   get_apple_string( FT_Memory       memory,
   550     if ( FT_ALLOC( result, entry->stringLength + 1 ) )
   550     if ( FT_ALLOC( result, entry->stringLength + 1 ) )
   551       return NULL;
   551       return NULL;
   552 
   552 
   553     if ( FT_STREAM_SEEK( entry->stringOffset ) ||
   553     if ( FT_STREAM_SEEK( entry->stringOffset ) ||
   554          FT_FRAME_ENTER( entry->stringLength ) )
   554          FT_FRAME_ENTER( entry->stringLength ) )
   555     {
   555       goto get_apple_string_error;
   556       FT_FREE( result );
       
   557       entry->stringOffset = 0;
       
   558       entry->stringLength = 0;
       
   559       FT_FREE( entry->string );
       
   560 
       
   561       return NULL;
       
   562     }
       
   563 
   556 
   564     r = (FT_String*)result;
   557     r = (FT_String*)result;
   565     p = (FT_Char*)stream->cursor;
   558     p = (FT_Char*)stream->cursor;
   566 
   559 
   567     for ( len = entry->stringLength; len > 0; len--, p++ )
   560     for ( len = entry->stringLength; len > 0; len--, p++ )
   569       if ( char_type( *p ) )
   562       if ( char_type( *p ) )
   570         *r++ = *p;
   563         *r++ = *p;
   571       else
   564       else
   572       {
   565       {
   573         if ( report_invalid_characters )
   566         if ( report_invalid_characters )
   574         {
       
   575           FT_TRACE0(( "get_apple_string:"
   567           FT_TRACE0(( "get_apple_string:"
   576                       " Character `%c' (0x%X) invalid in PS name string\n",
   568                       " Character `%c' (0x%X) invalid in PS name string\n",
   577                       *p, *p ));
   569                       *p, *p ));
   578           /* it's not the job of FreeType to correct PS names... */
   570         break;
   579           *r++ = *p;
       
   580         }
       
   581       }
   571       }
   582     }
   572     }
   583     *r = '\0';
   573     if ( !len )
       
   574       *r = '\0';
   584 
   575 
   585     FT_FRAME_EXIT();
   576     FT_FRAME_EXIT();
   586 
   577 
   587     return result;
   578     if ( !len )
       
   579       return result;
       
   580 
       
   581   get_apple_string_error:
       
   582     FT_FREE( result );
       
   583 
       
   584     entry->stringOffset = 0;
       
   585     entry->stringLength = 0;
       
   586     FT_FREE( entry->string );
       
   587 
       
   588     return NULL;
   588   }
   589   }
   589 
   590 
   590 
   591 
   591   static FT_Bool
   592   static FT_Bool
   592   sfnt_get_name_id( TT_Face    face,
   593   sfnt_get_name_id( TT_Face    face,
   605       TT_Name  name = face->name_table.names + n;
   606       TT_Name  name = face->name_table.names + n;
   606 
   607 
   607 
   608 
   608       if ( name->nameID == id && name->stringLength > 0 )
   609       if ( name->nameID == id && name->stringLength > 0 )
   609       {
   610       {
   610         if ( IS_WIN( name ) )
   611         if ( IS_WIN( name ) && ( name->languageID == 0x409 || *win == -1 ) )
   611           *win = n;
   612           *win = n;
   612 
   613 
   613         if ( IS_APPLE( name ) )
   614         if ( IS_APPLE( name ) && ( name->languageID == 0 || *apple == -1 ) )
   614           *apple = n;
   615           *apple = n;
   615       }
   616       }
   616     }
   617     }
   617 
   618 
   618     return ( *win >= 0 ) || ( *apple >= 0 );
   619     return ( *win >= 0 ) || ( *apple >= 0 );
   641   /* the maximum length of PostScript font names */
   642   /* the maximum length of PostScript font names */
   642 #define MAX_PS_NAME_LEN  127
   643 #define MAX_PS_NAME_LEN  127
   643 
   644 
   644 
   645 
   645   /*
   646   /*
   646    *  Find the shortest decimal representation of a 16.16 fixed point
   647    * Find the shortest decimal representation of a 16.16 fixed point
   647    *  number.  The function fills `buf' with the result, returning a pointer
   648    * number.  The function fills `buf' with the result, returning a pointer
   648    *  to the position after the representation's last byte.
   649    * to the position after the representation's last byte.
   649    */
   650    */
   650 
   651 
   651   static char*
   652   static char*
   652   fixed2float( FT_Int  fixed,
   653   fixed2float( FT_Int  fixed,
   653                char*   buf )
   654                char*   buf )
   671     }
   672     }
   672 
   673 
   673     if ( fixed < 0 )
   674     if ( fixed < 0 )
   674     {
   675     {
   675       *p++ = '-';
   676       *p++ = '-';
   676       fixed = -fixed;
   677       fixed = NEG_INT( fixed );
   677     }
   678     }
   678 
   679 
   679     int_part  = ( fixed >> 16 ) & 0xFFFF;
   680     int_part  = ( fixed >> 16 ) & 0xFFFF;
   680     frac_part = fixed & 0xFFFF;
   681     frac_part = fixed & 0xFFFF;
   681 
   682 
   826         result = get_win_string( face->root.memory,
   827         result = get_win_string( face->root.memory,
   827                                  face->name_table.stream,
   828                                  face->name_table.stream,
   828                                  face->name_table.names + win,
   829                                  face->name_table.names + win,
   829                                  sfnt_is_alphanumeric,
   830                                  sfnt_is_alphanumeric,
   830                                  0 );
   831                                  0 );
   831       else
   832       if ( !result && apple != -1 )
   832         result = get_apple_string( face->root.memory,
   833         result = get_apple_string( face->root.memory,
   833                                    face->name_table.stream,
   834                                    face->name_table.stream,
   834                                    face->name_table.names + apple,
   835                                    face->name_table.names + apple,
   835                                    sfnt_is_alphanumeric,
   836                                    sfnt_is_alphanumeric,
   836                                    0 );
   837                                    0 );
       
   838 
       
   839       if ( !result )
       
   840       {
       
   841         FT_TRACE0(( "sfnt_get_var_ps_name:"
       
   842                     " No valid PS name prefix for font instances found\n" ));
       
   843         return NULL;
       
   844       }
   837 
   845 
   838       len = ft_strlen( result );
   846       len = ft_strlen( result );
   839 
   847 
   840       /* sanitize if necessary; we reserve space for 36 bytes (a 128bit  */
   848       /* sanitize if necessary; we reserve space for 36 bytes (a 128bit  */
   841       /* checksum as a hex number, preceded by `-' and followed by three */
   849       /* checksum as a hex number, preceded by `-' and followed by three */
  1050       result = get_win_string( face->root.memory,
  1058       result = get_win_string( face->root.memory,
  1051                                face->name_table.stream,
  1059                                face->name_table.stream,
  1052                                face->name_table.names + win,
  1060                                face->name_table.names + win,
  1053                                sfnt_is_postscript,
  1061                                sfnt_is_postscript,
  1054                                1 );
  1062                                1 );
  1055     else
  1063     if ( !result && apple != -1 )
  1056       result = get_apple_string( face->root.memory,
  1064       result = get_apple_string( face->root.memory,
  1057                                  face->name_table.stream,
  1065                                  face->name_table.stream,
  1058                                  face->name_table.names + apple,
  1066                                  face->name_table.names + apple,
  1059                                  sfnt_is_postscript,
  1067                                  sfnt_is_postscript,
  1060                                  1 );
  1068                                  1 );
  1071     (FT_PsName_GetFunc)sfnt_get_ps_name       /* get_ps_font_name */
  1079     (FT_PsName_GetFunc)sfnt_get_ps_name       /* get_ps_font_name */
  1072   )
  1080   )
  1073 
  1081 
  1074 
  1082 
  1075   /*
  1083   /*
  1076    *  TT CMAP INFO
  1084    * TT CMAP INFO
  1077    */
  1085    */
  1078   FT_DEFINE_SERVICE_TTCMAPSREC(
  1086   FT_DEFINE_SERVICE_TTCMAPSREC(
  1079     tt_service_get_cmap_info,
  1087     tt_service_get_cmap_info,
  1080 
  1088 
  1081     (TT_CMap_Info_GetFunc)tt_get_cmap_info    /* get_cmap_info */
  1089     (TT_CMap_Info_GetFunc)tt_get_cmap_info    /* get_cmap_info */
  1130 
  1138 
  1131 #endif /* TT_CONFIG_OPTION_BDF */
  1139 #endif /* TT_CONFIG_OPTION_BDF */
  1132 
  1140 
  1133 
  1141 
  1134   /*
  1142   /*
  1135    *  SERVICE LIST
  1143    * SERVICE LIST
  1136    */
  1144    */
  1137 
  1145 
  1138 #if defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES && defined TT_CONFIG_OPTION_BDF
  1146 #if defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES && defined TT_CONFIG_OPTION_BDF
  1139   FT_DEFINE_SERVICEDESCREC5(
  1147   FT_DEFINE_SERVICEDESCREC5(
  1140     sfnt_services,
  1148     sfnt_services,
  1141 
  1149 
  1142     FT_SERVICE_ID_SFNT_TABLE,           &SFNT_SERVICE_SFNT_TABLE_GET,
  1150     FT_SERVICE_ID_SFNT_TABLE,           &sfnt_service_sfnt_table,
  1143     FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
  1151     FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
  1144     FT_SERVICE_ID_GLYPH_DICT,           &SFNT_SERVICE_GLYPH_DICT_GET,
  1152     FT_SERVICE_ID_GLYPH_DICT,           &sfnt_service_glyph_dict,
  1145     FT_SERVICE_ID_BDF,                  &SFNT_SERVICE_BDF_GET,
  1153     FT_SERVICE_ID_BDF,                  &sfnt_service_bdf,
  1146     FT_SERVICE_ID_TT_CMAP,              &TT_SERVICE_CMAP_INFO_GET )
  1154     FT_SERVICE_ID_TT_CMAP,              &tt_service_get_cmap_info )
  1147 #elif defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES
  1155 #elif defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES
  1148   FT_DEFINE_SERVICEDESCREC4(
  1156   FT_DEFINE_SERVICEDESCREC4(
  1149     sfnt_services,
  1157     sfnt_services,
  1150 
  1158 
  1151     FT_SERVICE_ID_SFNT_TABLE,           &SFNT_SERVICE_SFNT_TABLE_GET,
  1159     FT_SERVICE_ID_SFNT_TABLE,           &sfnt_service_sfnt_table,
  1152     FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
  1160     FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
  1153     FT_SERVICE_ID_GLYPH_DICT,           &SFNT_SERVICE_GLYPH_DICT_GET,
  1161     FT_SERVICE_ID_GLYPH_DICT,           &sfnt_service_glyph_dict,
  1154     FT_SERVICE_ID_TT_CMAP,              &TT_SERVICE_CMAP_INFO_GET )
  1162     FT_SERVICE_ID_TT_CMAP,              &tt_service_get_cmap_info )
  1155 #elif defined TT_CONFIG_OPTION_BDF
  1163 #elif defined TT_CONFIG_OPTION_BDF
  1156   FT_DEFINE_SERVICEDESCREC4(
  1164   FT_DEFINE_SERVICEDESCREC4(
  1157     sfnt_services,
  1165     sfnt_services,
  1158 
  1166 
  1159     FT_SERVICE_ID_SFNT_TABLE,           &SFNT_SERVICE_SFNT_TABLE_GET,
  1167     FT_SERVICE_ID_SFNT_TABLE,           &sfnt_service_sfnt_table,
  1160     FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
  1168     FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
  1161     FT_SERVICE_ID_BDF,                  &SFNT_SERVICE_BDF_GET,
  1169     FT_SERVICE_ID_BDF,                  &sfnt_service_bdf,
  1162     FT_SERVICE_ID_TT_CMAP,              &TT_SERVICE_CMAP_INFO_GET )
  1170     FT_SERVICE_ID_TT_CMAP,              &tt_service_get_cmap_info )
  1163 #else
  1171 #else
  1164   FT_DEFINE_SERVICEDESCREC3(
  1172   FT_DEFINE_SERVICEDESCREC3(
  1165     sfnt_services,
  1173     sfnt_services,
  1166 
  1174 
  1167     FT_SERVICE_ID_SFNT_TABLE,           &SFNT_SERVICE_SFNT_TABLE_GET,
  1175     FT_SERVICE_ID_SFNT_TABLE,           &sfnt_service_sfnt_table,
  1168     FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,
  1176     FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name,
  1169     FT_SERVICE_ID_TT_CMAP,              &TT_SERVICE_CMAP_INFO_GET )
  1177     FT_SERVICE_ID_TT_CMAP,              &tt_service_get_cmap_info )
  1170 #endif
  1178 #endif
  1171 
  1179 
  1172 
  1180 
  1173   FT_CALLBACK_DEF( FT_Module_Interface )
  1181   FT_CALLBACK_DEF( FT_Module_Interface )
  1174   sfnt_get_interface( FT_Module    module,
  1182   sfnt_get_interface( FT_Module    module,
  1175                       const char*  module_interface )
  1183                       const char*  module_interface )
  1176   {
  1184   {
  1177     /* SFNT_SERVICES_GET dereferences `library' in PIC mode */
       
  1178 #ifdef FT_CONFIG_OPTION_PIC
       
  1179     FT_Library  library;
       
  1180 
       
  1181 
       
  1182     if ( !module )
       
  1183       return NULL;
       
  1184     library = module->library;
       
  1185     if ( !library )
       
  1186       return NULL;
       
  1187 #else
       
  1188     FT_UNUSED( module );
  1185     FT_UNUSED( module );
  1189 #endif
  1186 
  1190 
  1187     return ft_service_list_lookup( sfnt_services, module_interface );
  1191     return ft_service_list_lookup( SFNT_SERVICES_GET, module_interface );
       
  1192   }
  1188   }
  1193 
  1189 
  1194 
  1190 
  1195 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
  1191 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
  1196 #define PUT_EMBEDDED_BITMAPS( a )  a
  1192 #define PUT_EMBEDDED_BITMAPS( a )  a
  1197 #else
  1193 #else
  1198 #define PUT_EMBEDDED_BITMAPS( a )  NULL
  1194 #define PUT_EMBEDDED_BITMAPS( a )  NULL
       
  1195 #endif
       
  1196 
       
  1197 #ifdef TT_CONFIG_OPTION_COLOR_LAYERS
       
  1198 #define PUT_COLOR_LAYERS( a )  a
       
  1199 #else
       
  1200 #define PUT_COLOR_LAYERS( a )  NULL
  1199 #endif
  1201 #endif
  1200 
  1202 
  1201 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
  1203 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
  1202 #define PUT_PS_NAMES( a )  a
  1204 #define PUT_PS_NAMES( a )  a
  1203 #else
  1205 #else
  1254                             /* TT_Load_Table_Func      load_eblc       */
  1256                             /* TT_Load_Table_Func      load_eblc       */
  1255     PUT_EMBEDDED_BITMAPS( tt_face_free_sbit ),
  1257     PUT_EMBEDDED_BITMAPS( tt_face_free_sbit ),
  1256                             /* TT_Free_Table_Func      free_eblc       */
  1258                             /* TT_Free_Table_Func      free_eblc       */
  1257 
  1259 
  1258     PUT_EMBEDDED_BITMAPS( tt_face_set_sbit_strike     ),
  1260     PUT_EMBEDDED_BITMAPS( tt_face_set_sbit_strike     ),
  1259                             /* TT_Set_SBit_Strike_Func set_sbit_strike */
  1261                    /* TT_Set_SBit_Strike_Func      set_sbit_strike     */
  1260     PUT_EMBEDDED_BITMAPS( tt_face_load_strike_metrics ),
  1262     PUT_EMBEDDED_BITMAPS( tt_face_load_strike_metrics ),
  1261                     /* TT_Load_Strike_Metrics_Func load_strike_metrics */
  1263                    /* TT_Load_Strike_Metrics_Func  load_strike_metrics */
       
  1264 
       
  1265     PUT_COLOR_LAYERS( tt_face_load_cpal ),
       
  1266                             /* TT_Load_Table_Func      load_cpal       */
       
  1267     PUT_COLOR_LAYERS( tt_face_load_colr ),
       
  1268                             /* TT_Load_Table_Func      load_colr       */
       
  1269     PUT_COLOR_LAYERS( tt_face_free_cpal ),
       
  1270                             /* TT_Free_Table_Func      free_cpal       */
       
  1271     PUT_COLOR_LAYERS( tt_face_free_colr ),
       
  1272                             /* TT_Free_Table_Func      free_colr       */
       
  1273     PUT_COLOR_LAYERS( tt_face_palette_set ),
       
  1274                             /* TT_Set_Palette_Func     set_palette     */
       
  1275     PUT_COLOR_LAYERS( tt_face_get_colr_layer ),
       
  1276                             /* TT_Get_Colr_Layer_Func  get_colr_layer  */
       
  1277     PUT_COLOR_LAYERS( tt_face_colr_blend_layer ),
       
  1278                             /* TT_Blend_Colr_Func      colr_blend      */
  1262 
  1279 
  1263     tt_face_get_metrics,    /* TT_Get_Metrics_Func     get_metrics     */
  1280     tt_face_get_metrics,    /* TT_Get_Metrics_Func     get_metrics     */
  1264 
  1281 
  1265     tt_face_get_name,       /* TT_Get_Name_Func        get_name        */
  1282     tt_face_get_name,       /* TT_Get_Name_Func        get_name        */
  1266     sfnt_get_name_id        /* TT_Get_Name_ID_Func     get_name_id     */
  1283     sfnt_get_name_id        /* TT_Get_Name_ID_Func     get_name_id     */
  1275 
  1292 
  1276     "sfnt",     /* driver name                            */
  1293     "sfnt",     /* driver name                            */
  1277     0x10000L,   /* driver version 1.0                     */
  1294     0x10000L,   /* driver version 1.0                     */
  1278     0x20000L,   /* driver requires FreeType 2.0 or higher */
  1295     0x20000L,   /* driver requires FreeType 2.0 or higher */
  1279 
  1296 
  1280     (const void*)&SFNT_INTERFACE_GET,  /* module specific interface */
  1297     (const void*)&sfnt_interface,  /* module specific interface */
  1281 
  1298 
  1282     (FT_Module_Constructor)NULL,               /* module_init   */
  1299     (FT_Module_Constructor)NULL,               /* module_init   */
  1283     (FT_Module_Destructor) NULL,               /* module_done   */
  1300     (FT_Module_Destructor) NULL,               /* module_done   */
  1284     (FT_Module_Requester)  sfnt_get_interface  /* get_interface */
  1301     (FT_Module_Requester)  sfnt_get_interface  /* get_interface */
  1285   )
  1302   )