src/java.desktop/share/native/libfreetype/src/psaux/t1decode.c
changeset 54876 da3834261f0c
parent 49234 3375a8039fde
equal deleted inserted replaced
54875:bcfedddcf4ce 54876:da3834261f0c
     1 /***************************************************************************/
     1 /****************************************************************************
     2 /*                                                                         */
     2  *
     3 /*  t1decode.c                                                             */
     3  * t1decode.c
     4 /*                                                                         */
     4  *
     5 /*    PostScript Type 1 decoding routines (body).                          */
     5  *   PostScript Type 1 decoding routines (body).
     6 /*                                                                         */
     6  *
     7 /*  Copyright 2000-2018 by                                                 */
     7  * Copyright (C) 2000-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_CALC_H
    20 #include FT_INTERNAL_CALC_H
    21 #include FT_INTERNAL_DEBUG_H
    21 #include FT_INTERNAL_DEBUG_H
    29 #include "psauxerr.h"
    29 #include "psauxerr.h"
    30 
    30 
    31 /* ensure proper sign extension */
    31 /* ensure proper sign extension */
    32 #define Fix2Int( f )  ( (FT_Int)(FT_Short)( (f) >> 16 ) )
    32 #define Fix2Int( f )  ( (FT_Int)(FT_Short)( (f) >> 16 ) )
    33 
    33 
    34   /*************************************************************************/
    34   /**************************************************************************
    35   /*                                                                       */
    35    *
    36   /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
    36    * The macro FT_COMPONENT is used in trace mode.  It is an implicit
    37   /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
    37    * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
    38   /* messages during execution.                                            */
    38    * messages during execution.
    39   /*                                                                       */
    39    */
    40 #undef  FT_COMPONENT
    40 #undef  FT_COMPONENT
    41 #define FT_COMPONENT  trace_t1decode
    41 #define FT_COMPONENT  t1decode
    42 
    42 
    43 
    43 
    44   typedef enum  T1_Operator_
    44   typedef enum  T1_Operator_
    45   {
    45   {
    46     op_none = 0,
    46     op_none = 0,
   107     2, /* setcurrentpoint */
   107     2, /* setcurrentpoint */
   108     2  /* opcode 15 (undocumented and obsolete) */
   108     2  /* opcode 15 (undocumented and obsolete) */
   109   };
   109   };
   110 
   110 
   111 
   111 
   112   /*************************************************************************/
   112   /**************************************************************************
   113   /*                                                                       */
   113    *
   114   /* <Function>                                                            */
   114    * @Function:
   115   /*    t1_lookup_glyph_by_stdcharcode_ps                                  */
   115    *   t1_lookup_glyph_by_stdcharcode_ps
   116   /*                                                                       */
   116    *
   117   /* <Description>                                                         */
   117    * @Description:
   118   /*    Looks up a given glyph by its StandardEncoding charcode.  Used to  */
   118    *   Looks up a given glyph by its StandardEncoding charcode.  Used to
   119   /*    implement the SEAC Type 1 operator in the Adobe engine             */
   119    *   implement the SEAC Type 1 operator in the Adobe engine
   120   /*                                                                       */
   120    *
   121   /* <Input>                                                               */
   121    * @Input:
   122   /*    face     :: The current face object.                               */
   122    *   face ::
   123   /*                                                                       */
   123    *     The current face object.
   124   /*    charcode :: The character code to look for.                        */
   124    *
   125   /*                                                                       */
   125    *   charcode ::
   126   /* <Return>                                                              */
   126    *     The character code to look for.
   127   /*    A glyph index in the font face.  Returns -1 if the corresponding   */
   127    *
   128   /*    glyph wasn't found.                                                */
   128    * @Return:
   129   /*                                                                       */
   129    *   A glyph index in the font face.  Returns -1 if the corresponding
       
   130    *   glyph wasn't found.
       
   131    */
   130   FT_LOCAL_DEF( FT_Int )
   132   FT_LOCAL_DEF( FT_Int )
   131   t1_lookup_glyph_by_stdcharcode_ps( PS_Decoder*  decoder,
   133   t1_lookup_glyph_by_stdcharcode_ps( PS_Decoder*  decoder,
   132                                      FT_Int       charcode )
   134                                      FT_Int       charcode )
   133   {
   135   {
   134     FT_UInt             n;
   136     FT_UInt             n;
   157     return -1;
   159     return -1;
   158   }
   160   }
   159 
   161 
   160 
   162 
   161 #ifdef T1_CONFIG_OPTION_OLD_ENGINE
   163 #ifdef T1_CONFIG_OPTION_OLD_ENGINE
   162   /*************************************************************************/
   164 
   163   /*                                                                       */
   165   /**************************************************************************
   164   /* <Function>                                                            */
   166    *
   165   /*    t1_lookup_glyph_by_stdcharcode                                     */
   167    * @Function:
   166   /*                                                                       */
   168    *   t1_lookup_glyph_by_stdcharcode
   167   /* <Description>                                                         */
   169    *
   168   /*    Looks up a given glyph by its StandardEncoding charcode.  Used to  */
   170    * @Description:
   169   /*    implement the SEAC Type 1 operator.                                */
   171    *   Looks up a given glyph by its StandardEncoding charcode.  Used to
   170   /*                                                                       */
   172    *   implement the SEAC Type 1 operator.
   171   /* <Input>                                                               */
   173    *
   172   /*    face     :: The current face object.                               */
   174    * @Input:
   173   /*                                                                       */
   175    *   face ::
   174   /*    charcode :: The character code to look for.                        */
   176    *     The current face object.
   175   /*                                                                       */
   177    *
   176   /* <Return>                                                              */
   178    *   charcode ::
   177   /*    A glyph index in the font face.  Returns -1 if the corresponding   */
   179    *     The character code to look for.
   178   /*    glyph wasn't found.                                                */
   180    *
   179   /*                                                                       */
   181    * @Return:
       
   182    *   A glyph index in the font face.  Returns -1 if the corresponding
       
   183    *   glyph wasn't found.
       
   184    */
   180   static FT_Int
   185   static FT_Int
   181   t1_lookup_glyph_by_stdcharcode( T1_Decoder  decoder,
   186   t1_lookup_glyph_by_stdcharcode( T1_Decoder  decoder,
   182                                   FT_Int      charcode )
   187                                   FT_Int      charcode )
   183   {
   188   {
   184     FT_UInt             n;
   189     FT_UInt             n;
   215   {
   220   {
   216     return decoder->parse_callback( decoder, glyph );
   221     return decoder->parse_callback( decoder, glyph );
   217   }
   222   }
   218 
   223 
   219 
   224 
   220   /*************************************************************************/
   225   /**************************************************************************
   221   /*                                                                       */
   226    *
   222   /* <Function>                                                            */
   227    * @Function:
   223   /*    t1operator_seac                                                    */
   228    *   t1operator_seac
   224   /*                                                                       */
   229    *
   225   /* <Description>                                                         */
   230    * @Description:
   226   /*    Implements the `seac' Type 1 operator for a Type 1 decoder.        */
   231    *   Implements the `seac' Type 1 operator for a Type 1 decoder.
   227   /*                                                                       */
   232    *
   228   /* <Input>                                                               */
   233    * @Input:
   229   /*    decoder :: The current CID decoder.                                */
   234    *   decoder ::
   230   /*                                                                       */
   235    *     The current CID decoder.
   231   /*    asb     :: The accent's side bearing.                              */
   236    *
   232   /*                                                                       */
   237    *   asb ::
   233   /*    adx     :: The horizontal offset of the accent.                    */
   238    *     The accent's side bearing.
   234   /*                                                                       */
   239    *
   235   /*    ady     :: The vertical offset of the accent.                      */
   240    *   adx ::
   236   /*                                                                       */
   241    *     The horizontal offset of the accent.
   237   /*    bchar   :: The base character's StandardEncoding charcode.         */
   242    *
   238   /*                                                                       */
   243    *   ady ::
   239   /*    achar   :: The accent character's StandardEncoding charcode.       */
   244    *     The vertical offset of the accent.
   240   /*                                                                       */
   245    *
   241   /* <Return>                                                              */
   246    *   bchar ::
   242   /*    FreeType error code.  0 means success.                             */
   247    *     The base character's StandardEncoding charcode.
   243   /*                                                                       */
   248    *
       
   249    *   achar ::
       
   250    *     The accent character's StandardEncoding charcode.
       
   251    *
       
   252    * @Return:
       
   253    *   FreeType error code.  0 means success.
       
   254    */
   244   static FT_Error
   255   static FT_Error
   245   t1operator_seac( T1_Decoder  decoder,
   256   t1operator_seac( T1_Decoder  decoder,
   246                    FT_Pos      asb,
   257                    FT_Pos      asb,
   247                    FT_Pos      adx,
   258                    FT_Pos      adx,
   248                    FT_Pos      ady,
   259                    FT_Pos      ady,
   397   Exit:
   408   Exit:
   398     return error;
   409     return error;
   399   }
   410   }
   400 
   411 
   401 
   412 
   402   /*************************************************************************/
   413   /**************************************************************************
   403   /*                                                                       */
   414    *
   404   /* <Function>                                                            */
   415    * @Function:
   405   /*    t1_decoder_parse_charstrings                                       */
   416    *   t1_decoder_parse_charstrings
   406   /*                                                                       */
   417    *
   407   /* <Description>                                                         */
   418    * @Description:
   408   /*    Parses a given Type 1 charstrings program.                         */
   419    *   Parses a given Type 1 charstrings program.
   409   /*                                                                       */
   420    *
   410   /* <Input>                                                               */
   421    * @Input:
   411   /*    decoder         :: The current Type 1 decoder.                     */
   422    *   decoder ::
   412   /*                                                                       */
   423    *     The current Type 1 decoder.
   413   /*    charstring_base :: The base address of the charstring stream.      */
   424    *
   414   /*                                                                       */
   425    *   charstring_base ::
   415   /*    charstring_len  :: The length in bytes of the charstring stream.   */
   426    *     The base address of the charstring stream.
   416   /*                                                                       */
   427    *
   417   /* <Return>                                                              */
   428    *   charstring_len ::
   418   /*    FreeType error code.  0 means success.                             */
   429    *     The length in bytes of the charstring stream.
   419   /*                                                                       */
   430    *
       
   431    * @Return:
       
   432    *   FreeType error code.  0 means success.
       
   433    */
   420   FT_LOCAL_DEF( FT_Error )
   434   FT_LOCAL_DEF( FT_Error )
   421   t1_decoder_parse_charstrings( T1_Decoder  decoder,
   435   t1_decoder_parse_charstrings( T1_Decoder  decoder,
   422                                 FT_Byte*    charstring_base,
   436                                 FT_Byte*    charstring_base,
   423                                 FT_UInt     charstring_len )
   437                                 FT_UInt     charstring_len )
   424   {
   438   {
   464                ( decoder->buildchar == NULL )  );
   478                ( decoder->buildchar == NULL )  );
   465 
   479 
   466     if ( decoder->buildchar && decoder->len_buildchar > 0 )
   480     if ( decoder->buildchar && decoder->len_buildchar > 0 )
   467       FT_ARRAY_ZERO( decoder->buildchar, decoder->len_buildchar );
   481       FT_ARRAY_ZERO( decoder->buildchar, decoder->len_buildchar );
   468 
   482 
   469     FT_TRACE4(( "\n"
       
   470                 "Start charstring\n" ));
       
   471 
       
   472     zone->base           = charstring_base;
   483     zone->base           = charstring_base;
   473     limit = zone->limit  = charstring_base + charstring_len;
   484     limit = zone->limit  = charstring_base + charstring_len;
   474     ip    = zone->cursor = zone->base;
   485     ip    = zone->cursor = zone->base;
   475 
   486 
   476     error = FT_Err_Ok;
   487     error = FT_Err_Ok;
   501         FT_TRACE5(( " (%d)", decoder->top - decoder->stack ));
   512         FT_TRACE5(( " (%d)", decoder->top - decoder->stack ));
   502         bol = FALSE;
   513         bol = FALSE;
   503       }
   514       }
   504 #endif
   515 #endif
   505 
   516 
   506       /*********************************************************************/
   517       /**********************************************************************
   507       /*                                                                   */
   518        *
   508       /* Decode operator or operand                                        */
   519        * Decode operator or operand
   509       /*                                                                   */
   520        *
   510       /*                                                                   */
   521        */
   511 
   522 
   512       /* first of all, decompress operator or value */
   523       /* first of all, decompress operator or value */
   513       switch ( *ip++ )
   524       switch ( *ip++ )
   514       {
   525       {
   515       case 1:
   526       case 1:
   708                    " no `div' after large integer\n" ));
   719                    " no `div' after large integer\n" ));
   709 
   720 
   710         large_int = FALSE;
   721         large_int = FALSE;
   711       }
   722       }
   712 
   723 
   713       /*********************************************************************/
   724       /**********************************************************************
   714       /*                                                                   */
   725        *
   715       /*  Push value on stack, or process operator                         */
   726        * Push value on stack, or process operator
   716       /*                                                                   */
   727        *
   717       /*                                                                   */
   728        */
   718       if ( op == op_none )
   729       if ( op == op_none )
   719       {
   730       {
   720         if ( top - decoder->stack >= T1_MAX_CHARSTRINGS_OPERANDS )
   731         if ( top - decoder->stack >= T1_MAX_CHARSTRINGS_OPERANDS )
   721         {
   732         {
   722           FT_ERROR(( "t1_decoder_parse_charstrings: stack overflow\n" ));
   733           FT_ERROR(( "t1_decoder_parse_charstrings: stack overflow\n" ));
   750         top -= 2;
   761         top -= 2;
   751 
   762 
   752         subr_no = Fix2Int( top[1] );
   763         subr_no = Fix2Int( top[1] );
   753         arg_cnt = Fix2Int( top[0] );
   764         arg_cnt = Fix2Int( top[0] );
   754 
   765 
   755         /***********************************************************/
   766         /************************************************************
   756         /*                                                         */
   767          *
   757         /* remove all operands to callothersubr from the stack     */
   768          * remove all operands to callothersubr from the stack
   758         /*                                                         */
   769          *
   759         /* for handled othersubrs, where we know the number of     */
   770          * for handled othersubrs, where we know the number of
   760         /* arguments, we increase the stack by the value of        */
   771          * arguments, we increase the stack by the value of
   761         /* known_othersubr_result_cnt                              */
   772          * known_othersubr_result_cnt
   762         /*                                                         */
   773          *
   763         /* for unhandled othersubrs the following pops adjust the  */
   774          * for unhandled othersubrs the following pops adjust the
   764         /* stack pointer as necessary                              */
   775          * stack pointer as necessary
       
   776          */
   765 
   777 
   766         if ( arg_cnt > top - decoder->stack )
   778         if ( arg_cnt > top - decoder->stack )
   767           goto Stack_Underflow;
   779           goto Stack_Underflow;
   768 
   780 
   769         top -= arg_cnt;
   781         top -= arg_cnt;
  1221 
  1233 
  1222           /* the `metrics_only' indicates that we only want to compute */
  1234           /* the `metrics_only' indicates that we only want to compute */
  1223           /* the glyph's metrics (lsb + advance width), not load the   */
  1235           /* the glyph's metrics (lsb + advance width), not load the   */
  1224           /* rest of it; so exit immediately                           */
  1236           /* rest of it; so exit immediately                           */
  1225           if ( builder->metrics_only )
  1237           if ( builder->metrics_only )
       
  1238           {
       
  1239             FT_TRACE4(( "\n" ));
  1226             return FT_Err_Ok;
  1240             return FT_Err_Ok;
       
  1241           }
  1227 
  1242 
  1228           break;
  1243           break;
  1229 
  1244 
  1230         case op_seac:
  1245         case op_seac:
  1231           return t1operator_seac( decoder,
  1246           return t1operator_seac( decoder,
  1253 
  1268 
  1254           /* the `metrics_only' indicates that we only want to compute */
  1269           /* the `metrics_only' indicates that we only want to compute */
  1255           /* the glyph's metrics (lsb + advance width), not load the   */
  1270           /* the glyph's metrics (lsb + advance width), not load the   */
  1256           /* rest of it; so exit immediately                           */
  1271           /* rest of it; so exit immediately                           */
  1257           if ( builder->metrics_only )
  1272           if ( builder->metrics_only )
       
  1273           {
       
  1274             FT_TRACE4(( "\n" ));
  1258             return FT_Err_Ok;
  1275             return FT_Err_Ok;
       
  1276           }
  1259 
  1277 
  1260           break;
  1278           break;
  1261 
  1279 
  1262         case op_closepath:
  1280         case op_closepath:
  1263           FT_TRACE4(( " closepath" ));
  1281           FT_TRACE4(( " closepath" ));
  1636 
  1654 
  1637   Stack_Underflow:
  1655   Stack_Underflow:
  1638     return FT_THROW( Stack_Underflow );
  1656     return FT_THROW( Stack_Underflow );
  1639   }
  1657   }
  1640 
  1658 
  1641 #else /* T1_CONFIG_OPTION_OLD_ENGINE */
  1659 
  1642 
  1660 #else /* !T1_CONFIG_OPTION_OLD_ENGINE */
  1643   /*************************************************************************/
  1661 
  1644   /*                                                                       */
  1662 
  1645   /* <Function>                                                            */
  1663   /**************************************************************************
  1646   /*    t1_decoder_parse_metrics                                           */
  1664    *
  1647   /*                                                                       */
  1665    * @Function:
  1648   /* <Description>                                                         */
  1666    *   t1_decoder_parse_metrics
  1649   /*    Parses a given Type 1 charstrings program to extract width         */
  1667    *
  1650   /*                                                                       */
  1668    * @Description:
  1651   /* <Input>                                                               */
  1669    *   Parses a given Type 1 charstrings program to extract width
  1652   /*    decoder         :: The current Type 1 decoder.                     */
  1670    *
  1653   /*                                                                       */
  1671    * @Input:
  1654   /*    charstring_base :: The base address of the charstring stream.      */
  1672    *   decoder ::
  1655   /*                                                                       */
  1673    *     The current Type 1 decoder.
  1656   /*    charstring_len  :: The length in bytes of the charstring stream.   */
  1674    *
  1657   /*                                                                       */
  1675    *   charstring_base ::
  1658   /* <Return>                                                              */
  1676    *     The base address of the charstring stream.
  1659   /*    FreeType error code.  0 means success.                             */
  1677    *
  1660   /*                                                                       */
  1678    *   charstring_len ::
       
  1679    *     The length in bytes of the charstring stream.
       
  1680    *
       
  1681    * @Return:
       
  1682    *   FreeType error code.  0 means success.
       
  1683    */
  1661   FT_LOCAL_DEF( FT_Error )
  1684   FT_LOCAL_DEF( FT_Error )
  1662   t1_decoder_parse_metrics( T1_Decoder  decoder,
  1685   t1_decoder_parse_metrics( T1_Decoder  decoder,
  1663                             FT_Byte*    charstring_base,
  1686                             FT_Byte*    charstring_base,
  1664                             FT_UInt     charstring_len )
  1687                             FT_UInt     charstring_len )
  1665   {
  1688   {
  1678     decoder->zone = decoder->zones;
  1701     decoder->zone = decoder->zones;
  1679     zone          = decoder->zones;
  1702     zone          = decoder->zones;
  1680 
  1703 
  1681     builder->parse_state = T1_Parse_Start;
  1704     builder->parse_state = T1_Parse_Start;
  1682 
  1705 
  1683     FT_TRACE4(( "\n"
       
  1684                 "Start charstring: get width\n" ));
       
  1685 
       
  1686     zone->base           = charstring_base;
  1706     zone->base           = charstring_base;
  1687     limit = zone->limit  = charstring_base + charstring_len;
  1707     limit = zone->limit  = charstring_base + charstring_len;
  1688     ip    = zone->cursor = zone->base;
  1708     ip    = zone->cursor = zone->base;
  1689 
  1709 
  1690     /* now, execute loop */
  1710     /* now, execute loop */
  1701         FT_TRACE5(( " (%d)", decoder->top - decoder->stack ));
  1721         FT_TRACE5(( " (%d)", decoder->top - decoder->stack ));
  1702         bol = FALSE;
  1722         bol = FALSE;
  1703       }
  1723       }
  1704 #endif
  1724 #endif
  1705 
  1725 
  1706       /*********************************************************************/
  1726       /**********************************************************************
  1707       /*                                                                   */
  1727        *
  1708       /* Decode operator or operand                                        */
  1728        * Decode operator or operand
  1709       /*                                                                   */
  1729        *
  1710       /*                                                                   */
  1730        */
  1711 
  1731 
  1712       /* first of all, decompress operator or value */
  1732       /* first of all, decompress operator or value */
  1713       switch ( *ip++ )
  1733       switch ( *ip++ )
  1714       {
  1734       {
  1715       case 1:
  1735       case 1:
  1815                      " invalid byte (%d)\n", ip[-1] ));
  1835                      " invalid byte (%d)\n", ip[-1] ));
  1816           goto Syntax_Error;
  1836           goto Syntax_Error;
  1817         }
  1837         }
  1818       }
  1838       }
  1819 
  1839 
  1820       /*********************************************************************/
  1840       /**********************************************************************
  1821       /*                                                                   */
  1841        *
  1822       /*  Push value on stack, or process operator                         */
  1842        * Push value on stack, or process operator
  1823       /*                                                                   */
  1843        *
  1824       /*                                                                   */
  1844        */
  1825       if ( op == op_none )
  1845       if ( op == op_none )
  1826       {
  1846       {
  1827         if ( top - decoder->stack >= T1_MAX_CHARSTRINGS_OPERANDS )
  1847         if ( top - decoder->stack >= T1_MAX_CHARSTRINGS_OPERANDS )
  1828         {
  1848         {
  1829           FT_ERROR(( "t1_decoder_parse_metrics: stack overflow\n" ));
  1849           FT_ERROR(( "t1_decoder_parse_metrics: stack overflow\n" ));
  1873           builder->advance.y = 0;
  1893           builder->advance.y = 0;
  1874 
  1894 
  1875           /* we only want to compute the glyph's metrics */
  1895           /* we only want to compute the glyph's metrics */
  1876           /* (lsb + advance width), not load the rest of */
  1896           /* (lsb + advance width), not load the rest of */
  1877           /* it; so exit immediately                     */
  1897           /* it; so exit immediately                     */
       
  1898           FT_TRACE4(( "\n" ));
  1878           return FT_Err_Ok;
  1899           return FT_Err_Ok;
  1879 
  1900 
  1880         case op_sbw:
  1901         case op_sbw:
  1881           FT_TRACE4(( " sbw" ));
  1902           FT_TRACE4(( " sbw" ));
  1882 
  1903 
  1891           builder->advance.y = top[3];
  1912           builder->advance.y = top[3];
  1892 
  1913 
  1893           /* we only want to compute the glyph's metrics */
  1914           /* we only want to compute the glyph's metrics */
  1894           /* (lsb + advance width), not load the rest of */
  1915           /* (lsb + advance width), not load the rest of */
  1895           /* it; so exit immediately                     */
  1916           /* it; so exit immediately                     */
       
  1917           FT_TRACE4(( "\n" ));
  1896           return FT_Err_Ok;
  1918           return FT_Err_Ok;
  1897 
  1919 
  1898         default:
  1920         default:
  1899           FT_ERROR(( "t1_decoder_parse_metrics:"
  1921           FT_ERROR(( "t1_decoder_parse_metrics:"
  1900                      " unhandled opcode %d\n", op ));
  1922                      " unhandled opcode %d\n", op ));
  1915     return FT_THROW( Syntax_Error );
  1937     return FT_THROW( Syntax_Error );
  1916 
  1938 
  1917   Stack_Underflow:
  1939   Stack_Underflow:
  1918     return FT_THROW( Stack_Underflow );
  1940     return FT_THROW( Stack_Underflow );
  1919   }
  1941   }
  1920 #endif /* T1_CONFIG_OPTION_OLD_ENGINE */
  1942 
       
  1943 #endif /* !T1_CONFIG_OPTION_OLD_ENGINE */
  1921 
  1944 
  1922 
  1945 
  1923   /* initialize T1 decoder */
  1946   /* initialize T1 decoder */
  1924   FT_LOCAL_DEF( FT_Error )
  1947   FT_LOCAL_DEF( FT_Error )
  1925   t1_decoder_init( T1_Decoder           decoder,
  1948   t1_decoder_init( T1_Decoder           decoder,
  1932                    FT_Render_Mode       hint_mode,
  1955                    FT_Render_Mode       hint_mode,
  1933                    T1_Decoder_Callback  parse_callback )
  1956                    T1_Decoder_Callback  parse_callback )
  1934   {
  1957   {
  1935     FT_ZERO( decoder );
  1958     FT_ZERO( decoder );
  1936 
  1959 
  1937     /* retrieve PSNames interface from list of current modules */
  1960     /* retrieve `psnames' interface from list of current modules */
  1938     {
  1961     {
  1939       FT_Service_PsCMaps  psnames;
  1962       FT_Service_PsCMaps  psnames;
  1940 
  1963 
  1941 
  1964 
  1942       FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
  1965       FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );