src/java.desktop/share/native/libfreetype/include/freetype/ftmac.h
changeset 54876 da3834261f0c
parent 49234 3375a8039fde
equal deleted inserted replaced
54875:bcfedddcf4ce 54876:da3834261f0c
     1 /***************************************************************************/
     1 /****************************************************************************
     2 /*                                                                         */
     2  *
     3 /*  ftmac.h                                                                */
     3  * ftmac.h
     4 /*                                                                         */
     4  *
     5 /*    Additional Mac-specific API.                                         */
     5  *   Additional Mac-specific API.
     6 /*                                                                         */
     6  *
     7 /*  Copyright 1996-2018 by                                                 */
     7  * Copyright (C) 1996-2019 by
     8 /*  Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.     */
     8  * Just van Rossum, 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 /***************************************************************************/
    19 /****************************************************************************
    20 /*                                                                         */
    20  *
    21 /* NOTE: Include this file after FT_FREETYPE_H and after any               */
    21  * NOTE: Include this file after `FT_FREETYPE_H` and after any
    22 /*       Mac-specific headers (because this header uses Mac types such as  */
    22  *       Mac-specific headers (because this header uses Mac types such as
    23 /*       Handle, FSSpec, FSRef, etc.)                                      */
    23  *       'Handle', 'FSSpec', 'FSRef', etc.)
    24 /*                                                                         */
    24  *
    25 /***************************************************************************/
    25  */
    26 
    26 
    27 
    27 
    28 #ifndef FTMAC_H_
    28 #ifndef FTMAC_H_
    29 #define FTMAC_H_
    29 #define FTMAC_H_
    30 
    30 
    45 #define FT_DEPRECATED_ATTRIBUTE
    45 #define FT_DEPRECATED_ATTRIBUTE
    46 #endif
    46 #endif
    47 #endif
    47 #endif
    48 
    48 
    49 
    49 
    50   /*************************************************************************/
    50   /**************************************************************************
    51   /*                                                                       */
    51    *
    52   /* <Section>                                                             */
    52    * @section:
    53   /*    mac_specific                                                       */
    53    *   mac_specific
    54   /*                                                                       */
    54    *
    55   /* <Title>                                                               */
    55    * @title:
    56   /*    Mac Specific Interface                                             */
    56    *   Mac Specific Interface
    57   /*                                                                       */
    57    *
    58   /* <Abstract>                                                            */
    58    * @abstract:
    59   /*    Only available on the Macintosh.                                   */
    59    *   Only available on the Macintosh.
    60   /*                                                                       */
    60    *
    61   /* <Description>                                                         */
    61    * @description:
    62   /*    The following definitions are only available if FreeType is        */
    62    *   The following definitions are only available if FreeType is compiled
    63   /*    compiled on a Macintosh.                                           */
    63    *   on a Macintosh.
    64   /*                                                                       */
    64    *
    65   /*************************************************************************/
    65    */
    66 
    66 
    67 
    67 
    68   /*************************************************************************/
    68   /**************************************************************************
    69   /*                                                                       */
    69    *
    70   /* <Function>                                                            */
    70    * @function:
    71   /*    FT_New_Face_From_FOND                                              */
    71    *   FT_New_Face_From_FOND
    72   /*                                                                       */
    72    *
    73   /* <Description>                                                         */
    73    * @description:
    74   /*    Create a new face object from a FOND resource.                     */
    74    *   Create a new face object from a FOND resource.
    75   /*                                                                       */
    75    *
    76   /* <InOut>                                                               */
    76    * @inout:
    77   /*    library    :: A handle to the library resource.                    */
    77    *   library ::
    78   /*                                                                       */
    78    *     A handle to the library resource.
    79   /* <Input>                                                               */
    79    *
    80   /*    fond       :: A FOND resource.                                     */
    80    * @input:
    81   /*                                                                       */
    81    *   fond ::
    82   /*    face_index :: Only supported for the -1 `sanity check' special     */
    82    *     A FOND resource.
    83   /*                  case.                                                */
    83    *
    84   /*                                                                       */
    84    *   face_index ::
    85   /* <Output>                                                              */
    85    *     Only supported for the -1 'sanity check' special case.
    86   /*    aface      :: A handle to a new face object.                       */
    86    *
    87   /*                                                                       */
    87    * @output:
    88   /* <Return>                                                              */
    88    *   aface ::
    89   /*    FreeType error code.  0~means success.                             */
    89    *     A handle to a new face object.
    90   /*                                                                       */
    90    *
    91   /* <Notes>                                                               */
    91    * @return:
    92   /*    This function can be used to create @FT_Face objects from fonts    */
    92    *   FreeType error code.  0~means success.
    93   /*    that are installed in the system as follows.                       */
    93    *
    94   /*                                                                       */
    94    * @example:
    95   /*    {                                                                  */
    95    *   This function can be used to create @FT_Face objects from fonts that
    96   /*      fond = GetResource( 'FOND', fontName );                          */
    96    *   are installed in the system as follows.
    97   /*      error = FT_New_Face_From_FOND( library, fond, 0, &face );        */
    97    *
    98   /*    }                                                                  */
    98    *   ```
    99   /*                                                                       */
    99    *     fond  = GetResource( 'FOND', fontName );
       
   100    *     error = FT_New_Face_From_FOND( library, fond, 0, &face );
       
   101    *   ```
       
   102    */
   100   FT_EXPORT( FT_Error )
   103   FT_EXPORT( FT_Error )
   101   FT_New_Face_From_FOND( FT_Library  library,
   104   FT_New_Face_From_FOND( FT_Library  library,
   102                          Handle      fond,
   105                          Handle      fond,
   103                          FT_Long     face_index,
   106                          FT_Long     face_index,
   104                          FT_Face    *aface )
   107                          FT_Face    *aface )
   105                        FT_DEPRECATED_ATTRIBUTE;
   108                        FT_DEPRECATED_ATTRIBUTE;
   106 
   109 
   107 
   110 
   108   /*************************************************************************/
   111   /**************************************************************************
   109   /*                                                                       */
   112    *
   110   /* <Function>                                                            */
   113    * @function:
   111   /*    FT_GetFile_From_Mac_Name                                           */
   114    *   FT_GetFile_From_Mac_Name
   112   /*                                                                       */
   115    *
   113   /* <Description>                                                         */
   116    * @description:
   114   /*    Return an FSSpec for the disk file containing the named font.      */
   117    *   Return an FSSpec for the disk file containing the named font.
   115   /*                                                                       */
   118    *
   116   /* <Input>                                                               */
   119    * @input:
   117   /*    fontName   :: Mac OS name of the font (e.g., Times New Roman       */
   120    *   fontName ::
   118   /*                  Bold).                                               */
   121    *     Mac OS name of the font (e.g., Times New Roman Bold).
   119   /*                                                                       */
   122    *
   120   /* <Output>                                                              */
   123    * @output:
   121   /*    pathSpec   :: FSSpec to the file.  For passing to                  */
   124    *   pathSpec ::
   122   /*                  @FT_New_Face_From_FSSpec.                            */
   125    *     FSSpec to the file.  For passing to @FT_New_Face_From_FSSpec.
   123   /*                                                                       */
   126    *
   124   /*    face_index :: Index of the face.  For passing to                   */
   127    *   face_index ::
   125   /*                  @FT_New_Face_From_FSSpec.                            */
   128    *     Index of the face.  For passing to @FT_New_Face_From_FSSpec.
   126   /*                                                                       */
   129    *
   127   /* <Return>                                                              */
   130    * @return:
   128   /*    FreeType error code.  0~means success.                             */
   131    *   FreeType error code.  0~means success.
   129   /*                                                                       */
   132    */
   130   FT_EXPORT( FT_Error )
   133   FT_EXPORT( FT_Error )
   131   FT_GetFile_From_Mac_Name( const char*  fontName,
   134   FT_GetFile_From_Mac_Name( const char*  fontName,
   132                             FSSpec*      pathSpec,
   135                             FSSpec*      pathSpec,
   133                             FT_Long*     face_index )
   136                             FT_Long*     face_index )
   134                           FT_DEPRECATED_ATTRIBUTE;
   137                           FT_DEPRECATED_ATTRIBUTE;
   135 
   138 
   136 
   139 
   137   /*************************************************************************/
   140   /**************************************************************************
   138   /*                                                                       */
   141    *
   139   /* <Function>                                                            */
   142    * @function:
   140   /*    FT_GetFile_From_Mac_ATS_Name                                       */
   143    *   FT_GetFile_From_Mac_ATS_Name
   141   /*                                                                       */
   144    *
   142   /* <Description>                                                         */
   145    * @description:
   143   /*    Return an FSSpec for the disk file containing the named font.      */
   146    *   Return an FSSpec for the disk file containing the named font.
   144   /*                                                                       */
   147    *
   145   /* <Input>                                                               */
   148    * @input:
   146   /*    fontName   :: Mac OS name of the font in ATS framework.            */
   149    *   fontName ::
   147   /*                                                                       */
   150    *     Mac OS name of the font in ATS framework.
   148   /* <Output>                                                              */
   151    *
   149   /*    pathSpec   :: FSSpec to the file. For passing to                   */
   152    * @output:
   150   /*                  @FT_New_Face_From_FSSpec.                            */
   153    *   pathSpec ::
   151   /*                                                                       */
   154    *     FSSpec to the file. For passing to @FT_New_Face_From_FSSpec.
   152   /*    face_index :: Index of the face. For passing to                    */
   155    *
   153   /*                  @FT_New_Face_From_FSSpec.                            */
   156    *   face_index ::
   154   /*                                                                       */
   157    *     Index of the face. For passing to @FT_New_Face_From_FSSpec.
   155   /* <Return>                                                              */
   158    *
   156   /*    FreeType error code.  0~means success.                             */
   159    * @return:
   157   /*                                                                       */
   160    *   FreeType error code.  0~means success.
       
   161    */
   158   FT_EXPORT( FT_Error )
   162   FT_EXPORT( FT_Error )
   159   FT_GetFile_From_Mac_ATS_Name( const char*  fontName,
   163   FT_GetFile_From_Mac_ATS_Name( const char*  fontName,
   160                                 FSSpec*      pathSpec,
   164                                 FSSpec*      pathSpec,
   161                                 FT_Long*     face_index )
   165                                 FT_Long*     face_index )
   162                               FT_DEPRECATED_ATTRIBUTE;
   166                               FT_DEPRECATED_ATTRIBUTE;
   163 
   167 
   164 
   168 
   165   /*************************************************************************/
   169   /**************************************************************************
   166   /*                                                                       */
   170    *
   167   /* <Function>                                                            */
   171    * @function:
   168   /*    FT_GetFilePath_From_Mac_ATS_Name                                   */
   172    *   FT_GetFilePath_From_Mac_ATS_Name
   169   /*                                                                       */
   173    *
   170   /* <Description>                                                         */
   174    * @description:
   171   /*    Return a pathname of the disk file and face index for given font   */
   175    *   Return a pathname of the disk file and face index for given font name
   172   /*    name that is handled by ATS framework.                             */
   176    *   that is handled by ATS framework.
   173   /*                                                                       */
   177    *
   174   /* <Input>                                                               */
   178    * @input:
   175   /*    fontName    :: Mac OS name of the font in ATS framework.           */
   179    *   fontName ::
   176   /*                                                                       */
   180    *     Mac OS name of the font in ATS framework.
   177   /* <Output>                                                              */
   181    *
   178   /*    path        :: Buffer to store pathname of the file.  For passing  */
   182    * @output:
   179   /*                   to @FT_New_Face.  The client must allocate this     */
   183    *   path ::
   180   /*                   buffer before calling this function.                */
   184    *     Buffer to store pathname of the file.  For passing to @FT_New_Face.
   181   /*                                                                       */
   185    *     The client must allocate this buffer before calling this function.
   182   /*    maxPathSize :: Lengths of the buffer `path' that client allocated. */
   186    *
   183   /*                                                                       */
   187    *   maxPathSize ::
   184   /*    face_index  :: Index of the face.  For passing to @FT_New_Face.    */
   188    *     Lengths of the buffer `path` that client allocated.
   185   /*                                                                       */
   189    *
   186   /* <Return>                                                              */
   190    *   face_index ::
   187   /*    FreeType error code.  0~means success.                             */
   191    *     Index of the face.  For passing to @FT_New_Face.
   188   /*                                                                       */
   192    *
       
   193    * @return:
       
   194    *   FreeType error code.  0~means success.
       
   195    */
   189   FT_EXPORT( FT_Error )
   196   FT_EXPORT( FT_Error )
   190   FT_GetFilePath_From_Mac_ATS_Name( const char*  fontName,
   197   FT_GetFilePath_From_Mac_ATS_Name( const char*  fontName,
   191                                     UInt8*       path,
   198                                     UInt8*       path,
   192                                     UInt32       maxPathSize,
   199                                     UInt32       maxPathSize,
   193                                     FT_Long*     face_index )
   200                                     FT_Long*     face_index )
   194                                   FT_DEPRECATED_ATTRIBUTE;
   201                                   FT_DEPRECATED_ATTRIBUTE;
   195 
   202 
   196 
   203 
   197   /*************************************************************************/
   204   /**************************************************************************
   198   /*                                                                       */
   205    *
   199   /* <Function>                                                            */
   206    * @function:
   200   /*    FT_New_Face_From_FSSpec                                            */
   207    *   FT_New_Face_From_FSSpec
   201   /*                                                                       */
   208    *
   202   /* <Description>                                                         */
   209    * @description:
   203   /*    Create a new face object from a given resource and typeface index  */
   210    *   Create a new face object from a given resource and typeface index
   204   /*    using an FSSpec to the font file.                                  */
   211    *   using an FSSpec to the font file.
   205   /*                                                                       */
   212    *
   206   /* <InOut>                                                               */
   213    * @inout:
   207   /*    library    :: A handle to the library resource.                    */
   214    *   library ::
   208   /*                                                                       */
   215    *     A handle to the library resource.
   209   /* <Input>                                                               */
   216    *
   210   /*    spec       :: FSSpec to the font file.                             */
   217    * @input:
   211   /*                                                                       */
   218    *   spec ::
   212   /*    face_index :: The index of the face within the resource.  The      */
   219    *     FSSpec to the font file.
   213   /*                  first face has index~0.                              */
   220    *
   214   /* <Output>                                                              */
   221    *   face_index ::
   215   /*    aface      :: A handle to a new face object.                       */
   222    *     The index of the face within the resource.  The first face has
   216   /*                                                                       */
   223    *     index~0.
   217   /* <Return>                                                              */
   224    * @output:
   218   /*    FreeType error code.  0~means success.                             */
   225    *   aface ::
   219   /*                                                                       */
   226    *     A handle to a new face object.
   220   /* <Note>                                                                */
   227    *
   221   /*    @FT_New_Face_From_FSSpec is identical to @FT_New_Face except       */
   228    * @return:
   222   /*    it accepts an FSSpec instead of a path.                            */
   229    *   FreeType error code.  0~means success.
   223   /*                                                                       */
   230    *
       
   231    * @note:
       
   232    *   @FT_New_Face_From_FSSpec is identical to @FT_New_Face except it
       
   233    *   accepts an FSSpec instead of a path.
       
   234    */
   224   FT_EXPORT( FT_Error )
   235   FT_EXPORT( FT_Error )
   225   FT_New_Face_From_FSSpec( FT_Library     library,
   236   FT_New_Face_From_FSSpec( FT_Library     library,
   226                            const FSSpec  *spec,
   237                            const FSSpec  *spec,
   227                            FT_Long        face_index,
   238                            FT_Long        face_index,
   228                            FT_Face       *aface )
   239                            FT_Face       *aface )
   229                          FT_DEPRECATED_ATTRIBUTE;
   240                          FT_DEPRECATED_ATTRIBUTE;
   230 
   241 
   231 
   242 
   232   /*************************************************************************/
   243   /**************************************************************************
   233   /*                                                                       */
   244    *
   234   /* <Function>                                                            */
   245    * @function:
   235   /*    FT_New_Face_From_FSRef                                             */
   246    *   FT_New_Face_From_FSRef
   236   /*                                                                       */
   247    *
   237   /* <Description>                                                         */
   248    * @description:
   238   /*    Create a new face object from a given resource and typeface index  */
   249    *   Create a new face object from a given resource and typeface index
   239   /*    using an FSRef to the font file.                                   */
   250    *   using an FSRef to the font file.
   240   /*                                                                       */
   251    *
   241   /* <InOut>                                                               */
   252    * @inout:
   242   /*    library    :: A handle to the library resource.                    */
   253    *   library ::
   243   /*                                                                       */
   254    *     A handle to the library resource.
   244   /* <Input>                                                               */
   255    *
   245   /*    spec       :: FSRef to the font file.                              */
   256    * @input:
   246   /*                                                                       */
   257    *   spec ::
   247   /*    face_index :: The index of the face within the resource.  The      */
   258    *     FSRef to the font file.
   248   /*                  first face has index~0.                              */
   259    *
   249   /* <Output>                                                              */
   260    *   face_index ::
   250   /*    aface      :: A handle to a new face object.                       */
   261    *     The index of the face within the resource.  The first face has
   251   /*                                                                       */
   262    *     index~0.
   252   /* <Return>                                                              */
   263    * @output:
   253   /*    FreeType error code.  0~means success.                             */
   264    *   aface ::
   254   /*                                                                       */
   265    *     A handle to a new face object.
   255   /* <Note>                                                                */
   266    *
   256   /*    @FT_New_Face_From_FSRef is identical to @FT_New_Face except        */
   267    * @return:
   257   /*    it accepts an FSRef instead of a path.                             */
   268    *   FreeType error code.  0~means success.
   258   /*                                                                       */
   269    *
       
   270    * @note:
       
   271    *   @FT_New_Face_From_FSRef is identical to @FT_New_Face except it accepts
       
   272    *   an FSRef instead of a path.
       
   273    */
   259   FT_EXPORT( FT_Error )
   274   FT_EXPORT( FT_Error )
   260   FT_New_Face_From_FSRef( FT_Library    library,
   275   FT_New_Face_From_FSRef( FT_Library    library,
   261                           const FSRef  *ref,
   276                           const FSRef  *ref,
   262                           FT_Long       face_index,
   277                           FT_Long       face_index,
   263                           FT_Face      *aface )
   278                           FT_Face      *aface )