src/java.desktop/share/native/libfreetype/include/freetype/fttypes.h
changeset 54876 da3834261f0c
parent 49234 3375a8039fde
equal deleted inserted replaced
54875:bcfedddcf4ce 54876:da3834261f0c
     1 /***************************************************************************/
     1 /****************************************************************************
     2 /*                                                                         */
     2  *
     3 /*  fttypes.h                                                              */
     3  * fttypes.h
     4 /*                                                                         */
     4  *
     5 /*    FreeType simple types definitions (specification only).              */
     5  *   FreeType simple types definitions (specification only).
     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 #ifndef FTTYPES_H_
    19 #ifndef FTTYPES_H_
    20 #define FTTYPES_H_
    20 #define FTTYPES_H_
    21 
    21 
    29 
    29 
    30 
    30 
    31 FT_BEGIN_HEADER
    31 FT_BEGIN_HEADER
    32 
    32 
    33 
    33 
    34   /*************************************************************************/
    34   /**************************************************************************
    35   /*                                                                       */
    35    *
    36   /* <Section>                                                             */
    36    * @section:
    37   /*    basic_types                                                        */
    37    *   basic_types
    38   /*                                                                       */
    38    *
    39   /* <Title>                                                               */
    39    * @title:
    40   /*    Basic Data Types                                                   */
    40    *   Basic Data Types
    41   /*                                                                       */
    41    *
    42   /* <Abstract>                                                            */
    42    * @abstract:
    43   /*    The basic data types defined by the library.                       */
    43    *   The basic data types defined by the library.
    44   /*                                                                       */
    44    *
    45   /* <Description>                                                         */
    45    * @description:
    46   /*    This section contains the basic data types defined by FreeType~2,  */
    46    *   This section contains the basic data types defined by FreeType~2,
    47   /*    ranging from simple scalar types to bitmap descriptors.  More      */
    47    *   ranging from simple scalar types to bitmap descriptors.  More
    48   /*    font-specific structures are defined in a different section.       */
    48    *   font-specific structures are defined in a different section.
    49   /*                                                                       */
    49    *
    50   /* <Order>                                                               */
    50    * @order:
    51   /*    FT_Byte                                                            */
    51    *   FT_Byte
    52   /*    FT_Bytes                                                           */
    52    *   FT_Bytes
    53   /*    FT_Char                                                            */
    53    *   FT_Char
    54   /*    FT_Int                                                             */
    54    *   FT_Int
    55   /*    FT_UInt                                                            */
    55    *   FT_UInt
    56   /*    FT_Int16                                                           */
    56    *   FT_Int16
    57   /*    FT_UInt16                                                          */
    57    *   FT_UInt16
    58   /*    FT_Int32                                                           */
    58    *   FT_Int32
    59   /*    FT_UInt32                                                          */
    59    *   FT_UInt32
    60   /*    FT_Int64                                                           */
    60    *   FT_Int64
    61   /*    FT_UInt64                                                          */
    61    *   FT_UInt64
    62   /*    FT_Short                                                           */
    62    *   FT_Short
    63   /*    FT_UShort                                                          */
    63    *   FT_UShort
    64   /*    FT_Long                                                            */
    64    *   FT_Long
    65   /*    FT_ULong                                                           */
    65    *   FT_ULong
    66   /*    FT_Bool                                                            */
    66    *   FT_Bool
    67   /*    FT_Offset                                                          */
    67    *   FT_Offset
    68   /*    FT_PtrDist                                                         */
    68    *   FT_PtrDist
    69   /*    FT_String                                                          */
    69    *   FT_String
    70   /*    FT_Tag                                                             */
    70    *   FT_Tag
    71   /*    FT_Error                                                           */
    71    *   FT_Error
    72   /*    FT_Fixed                                                           */
    72    *   FT_Fixed
    73   /*    FT_Pointer                                                         */
    73    *   FT_Pointer
    74   /*    FT_Pos                                                             */
    74    *   FT_Pos
    75   /*    FT_Vector                                                          */
    75    *   FT_Vector
    76   /*    FT_BBox                                                            */
    76    *   FT_BBox
    77   /*    FT_Matrix                                                          */
    77    *   FT_Matrix
    78   /*    FT_FWord                                                           */
    78    *   FT_FWord
    79   /*    FT_UFWord                                                          */
    79    *   FT_UFWord
    80   /*    FT_F2Dot14                                                         */
    80    *   FT_F2Dot14
    81   /*    FT_UnitVector                                                      */
    81    *   FT_UnitVector
    82   /*    FT_F26Dot6                                                         */
    82    *   FT_F26Dot6
    83   /*    FT_Data                                                            */
    83    *   FT_Data
    84   /*                                                                       */
    84    *
    85   /*    FT_MAKE_TAG                                                        */
    85    *   FT_MAKE_TAG
    86   /*                                                                       */
    86    *
    87   /*    FT_Generic                                                         */
    87    *   FT_Generic
    88   /*    FT_Generic_Finalizer                                               */
    88    *   FT_Generic_Finalizer
    89   /*                                                                       */
    89    *
    90   /*    FT_Bitmap                                                          */
    90    *   FT_Bitmap
    91   /*    FT_Pixel_Mode                                                      */
    91    *   FT_Pixel_Mode
    92   /*    FT_Palette_Mode                                                    */
    92    *   FT_Palette_Mode
    93   /*    FT_Glyph_Format                                                    */
    93    *   FT_Glyph_Format
    94   /*    FT_IMAGE_TAG                                                       */
    94    *   FT_IMAGE_TAG
    95   /*                                                                       */
    95    *
    96   /*************************************************************************/
    96    */
    97 
    97 
    98 
    98 
    99   /*************************************************************************/
    99   /**************************************************************************
   100   /*                                                                       */
   100    *
   101   /* <Type>                                                                */
   101    * @type:
   102   /*    FT_Bool                                                            */
   102    *   FT_Bool
   103   /*                                                                       */
   103    *
   104   /* <Description>                                                         */
   104    * @description:
   105   /*    A typedef of unsigned char, used for simple booleans.  As usual,   */
   105    *   A typedef of unsigned char, used for simple booleans.  As usual,
   106   /*    values 1 and~0 represent true and false, respectively.             */
   106    *   values 1 and~0 represent true and false, respectively.
   107   /*                                                                       */
   107    */
   108   typedef unsigned char  FT_Bool;
   108   typedef unsigned char  FT_Bool;
   109 
   109 
   110 
   110 
   111   /*************************************************************************/
   111   /**************************************************************************
   112   /*                                                                       */
   112    *
   113   /* <Type>                                                                */
   113    * @type:
   114   /*    FT_FWord                                                           */
   114    *   FT_FWord
   115   /*                                                                       */
   115    *
   116   /* <Description>                                                         */
   116    * @description:
   117   /*    A signed 16-bit integer used to store a distance in original font  */
   117    *   A signed 16-bit integer used to store a distance in original font
   118   /*    units.                                                             */
   118    *   units.
   119   /*                                                                       */
   119    */
   120   typedef signed short  FT_FWord;   /* distance in FUnits */
   120   typedef signed short  FT_FWord;   /* distance in FUnits */
   121 
   121 
   122 
   122 
   123   /*************************************************************************/
   123   /**************************************************************************
   124   /*                                                                       */
   124    *
   125   /* <Type>                                                                */
   125    * @type:
   126   /*    FT_UFWord                                                          */
   126    *   FT_UFWord
   127   /*                                                                       */
   127    *
   128   /* <Description>                                                         */
   128    * @description:
   129   /*    An unsigned 16-bit integer used to store a distance in original    */
   129    *   An unsigned 16-bit integer used to store a distance in original font
   130   /*    font units.                                                        */
   130    *   units.
   131   /*                                                                       */
   131    */
   132   typedef unsigned short  FT_UFWord;  /* unsigned distance */
   132   typedef unsigned short  FT_UFWord;  /* unsigned distance */
   133 
   133 
   134 
   134 
   135   /*************************************************************************/
   135   /**************************************************************************
   136   /*                                                                       */
   136    *
   137   /* <Type>                                                                */
   137    * @type:
   138   /*    FT_Char                                                            */
   138    *   FT_Char
   139   /*                                                                       */
   139    *
   140   /* <Description>                                                         */
   140    * @description:
   141   /*    A simple typedef for the _signed_ char type.                       */
   141    *   A simple typedef for the _signed_ char type.
   142   /*                                                                       */
   142    */
   143   typedef signed char  FT_Char;
   143   typedef signed char  FT_Char;
   144 
   144 
   145 
   145 
   146   /*************************************************************************/
   146   /**************************************************************************
   147   /*                                                                       */
   147    *
   148   /* <Type>                                                                */
   148    * @type:
   149   /*    FT_Byte                                                            */
   149    *   FT_Byte
   150   /*                                                                       */
   150    *
   151   /* <Description>                                                         */
   151    * @description:
   152   /*    A simple typedef for the _unsigned_ char type.                     */
   152    *   A simple typedef for the _unsigned_ char type.
   153   /*                                                                       */
   153    */
   154   typedef unsigned char  FT_Byte;
   154   typedef unsigned char  FT_Byte;
   155 
   155 
   156 
   156 
   157   /*************************************************************************/
   157   /**************************************************************************
   158   /*                                                                       */
   158    *
   159   /* <Type>                                                                */
   159    * @type:
   160   /*    FT_Bytes                                                           */
   160    *   FT_Bytes
   161   /*                                                                       */
   161    *
   162   /* <Description>                                                         */
   162    * @description:
   163   /*    A typedef for constant memory areas.                               */
   163    *   A typedef for constant memory areas.
   164   /*                                                                       */
   164    */
   165   typedef const FT_Byte*  FT_Bytes;
   165   typedef const FT_Byte*  FT_Bytes;
   166 
   166 
   167 
   167 
   168   /*************************************************************************/
   168   /**************************************************************************
   169   /*                                                                       */
   169    *
   170   /* <Type>                                                                */
   170    * @type:
   171   /*    FT_Tag                                                             */
   171    *   FT_Tag
   172   /*                                                                       */
   172    *
   173   /* <Description>                                                         */
   173    * @description:
   174   /*    A typedef for 32-bit tags (as used in the SFNT format).            */
   174    *   A typedef for 32-bit tags (as used in the SFNT format).
   175   /*                                                                       */
   175    */
   176   typedef FT_UInt32  FT_Tag;
   176   typedef FT_UInt32  FT_Tag;
   177 
   177 
   178 
   178 
   179   /*************************************************************************/
   179   /**************************************************************************
   180   /*                                                                       */
   180    *
   181   /* <Type>                                                                */
   181    * @type:
   182   /*    FT_String                                                          */
   182    *   FT_String
   183   /*                                                                       */
   183    *
   184   /* <Description>                                                         */
   184    * @description:
   185   /*    A simple typedef for the char type, usually used for strings.      */
   185    *   A simple typedef for the char type, usually used for strings.
   186   /*                                                                       */
   186    */
   187   typedef char  FT_String;
   187   typedef char  FT_String;
   188 
   188 
   189 
   189 
   190   /*************************************************************************/
   190   /**************************************************************************
   191   /*                                                                       */
   191    *
   192   /* <Type>                                                                */
   192    * @type:
   193   /*    FT_Short                                                           */
   193    *   FT_Short
   194   /*                                                                       */
   194    *
   195   /* <Description>                                                         */
   195    * @description:
   196   /*    A typedef for signed short.                                        */
   196    *   A typedef for signed short.
   197   /*                                                                       */
   197    */
   198   typedef signed short  FT_Short;
   198   typedef signed short  FT_Short;
   199 
   199 
   200 
   200 
   201   /*************************************************************************/
   201   /**************************************************************************
   202   /*                                                                       */
   202    *
   203   /* <Type>                                                                */
   203    * @type:
   204   /*    FT_UShort                                                          */
   204    *   FT_UShort
   205   /*                                                                       */
   205    *
   206   /* <Description>                                                         */
   206    * @description:
   207   /*    A typedef for unsigned short.                                      */
   207    *   A typedef for unsigned short.
   208   /*                                                                       */
   208    */
   209   typedef unsigned short  FT_UShort;
   209   typedef unsigned short  FT_UShort;
   210 
   210 
   211 
   211 
   212   /*************************************************************************/
   212   /**************************************************************************
   213   /*                                                                       */
   213    *
   214   /* <Type>                                                                */
   214    * @type:
   215   /*    FT_Int                                                             */
   215    *   FT_Int
   216   /*                                                                       */
   216    *
   217   /* <Description>                                                         */
   217    * @description:
   218   /*    A typedef for the int type.                                        */
   218    *   A typedef for the int type.
   219   /*                                                                       */
   219    */
   220   typedef signed int  FT_Int;
   220   typedef signed int  FT_Int;
   221 
   221 
   222 
   222 
   223   /*************************************************************************/
   223   /**************************************************************************
   224   /*                                                                       */
   224    *
   225   /* <Type>                                                                */
   225    * @type:
   226   /*    FT_UInt                                                            */
   226    *   FT_UInt
   227   /*                                                                       */
   227    *
   228   /* <Description>                                                         */
   228    * @description:
   229   /*    A typedef for the unsigned int type.                               */
   229    *   A typedef for the unsigned int type.
   230   /*                                                                       */
   230    */
   231   typedef unsigned int  FT_UInt;
   231   typedef unsigned int  FT_UInt;
   232 
   232 
   233 
   233 
   234   /*************************************************************************/
   234   /**************************************************************************
   235   /*                                                                       */
   235    *
   236   /* <Type>                                                                */
   236    * @type:
   237   /*    FT_Long                                                            */
   237    *   FT_Long
   238   /*                                                                       */
   238    *
   239   /* <Description>                                                         */
   239    * @description:
   240   /*    A typedef for signed long.                                         */
   240    *   A typedef for signed long.
   241   /*                                                                       */
   241    */
   242   typedef signed long  FT_Long;
   242   typedef signed long  FT_Long;
   243 
   243 
   244 
   244 
   245   /*************************************************************************/
   245   /**************************************************************************
   246   /*                                                                       */
   246    *
   247   /* <Type>                                                                */
   247    * @type:
   248   /*    FT_ULong                                                           */
   248    *   FT_ULong
   249   /*                                                                       */
   249    *
   250   /* <Description>                                                         */
   250    * @description:
   251   /*    A typedef for unsigned long.                                       */
   251    *   A typedef for unsigned long.
   252   /*                                                                       */
   252    */
   253   typedef unsigned long  FT_ULong;
   253   typedef unsigned long  FT_ULong;
   254 
   254 
   255 
   255 
   256   /*************************************************************************/
   256   /**************************************************************************
   257   /*                                                                       */
   257    *
   258   /* <Type>                                                                */
   258    * @type:
   259   /*    FT_F2Dot14                                                         */
   259    *   FT_F2Dot14
   260   /*                                                                       */
   260    *
   261   /* <Description>                                                         */
   261    * @description:
   262   /*    A signed 2.14 fixed-point type used for unit vectors.              */
   262    *   A signed 2.14 fixed-point type used for unit vectors.
   263   /*                                                                       */
   263    */
   264   typedef signed short  FT_F2Dot14;
   264   typedef signed short  FT_F2Dot14;
   265 
   265 
   266 
   266 
   267   /*************************************************************************/
   267   /**************************************************************************
   268   /*                                                                       */
   268    *
   269   /* <Type>                                                                */
   269    * @type:
   270   /*    FT_F26Dot6                                                         */
   270    *   FT_F26Dot6
   271   /*                                                                       */
   271    *
   272   /* <Description>                                                         */
   272    * @description:
   273   /*    A signed 26.6 fixed-point type used for vectorial pixel            */
   273    *   A signed 26.6 fixed-point type used for vectorial pixel coordinates.
   274   /*    coordinates.                                                       */
   274    */
   275   /*                                                                       */
       
   276   typedef signed long  FT_F26Dot6;
   275   typedef signed long  FT_F26Dot6;
   277 
   276 
   278 
   277 
   279   /*************************************************************************/
   278   /**************************************************************************
   280   /*                                                                       */
   279    *
   281   /* <Type>                                                                */
   280    * @type:
   282   /*    FT_Fixed                                                           */
   281    *   FT_Fixed
   283   /*                                                                       */
   282    *
   284   /* <Description>                                                         */
   283    * @description:
   285   /*    This type is used to store 16.16 fixed-point values, like scaling  */
   284    *   This type is used to store 16.16 fixed-point values, like scaling
   286   /*    values or matrix coefficients.                                     */
   285    *   values or matrix coefficients.
   287   /*                                                                       */
   286    */
   288   typedef signed long  FT_Fixed;
   287   typedef signed long  FT_Fixed;
   289 
   288 
   290 
   289 
   291   /*************************************************************************/
   290   /**************************************************************************
   292   /*                                                                       */
   291    *
   293   /* <Type>                                                                */
   292    * @type:
   294   /*    FT_Error                                                           */
   293    *   FT_Error
   295   /*                                                                       */
   294    *
   296   /* <Description>                                                         */
   295    * @description:
   297   /*    The FreeType error code type.  A value of~0 is always interpreted  */
   296    *   The FreeType error code type.  A value of~0 is always interpreted as a
   298   /*    as a successful operation.                                         */
   297    *   successful operation.
   299   /*                                                                       */
   298    */
   300   typedef int  FT_Error;
   299   typedef int  FT_Error;
   301 
   300 
   302 
   301 
   303   /*************************************************************************/
   302   /**************************************************************************
   304   /*                                                                       */
   303    *
   305   /* <Type>                                                                */
   304    * @type:
   306   /*    FT_Pointer                                                         */
   305    *   FT_Pointer
   307   /*                                                                       */
   306    *
   308   /* <Description>                                                         */
   307    * @description:
   309   /*    A simple typedef for a typeless pointer.                           */
   308    *   A simple typedef for a typeless pointer.
   310   /*                                                                       */
   309    */
   311   typedef void*  FT_Pointer;
   310   typedef void*  FT_Pointer;
   312 
   311 
   313 
   312 
   314   /*************************************************************************/
   313   /**************************************************************************
   315   /*                                                                       */
   314    *
   316   /* <Type>                                                                */
   315    * @type:
   317   /*    FT_Offset                                                          */
   316    *   FT_Offset
   318   /*                                                                       */
   317    *
   319   /* <Description>                                                         */
   318    * @description:
   320   /*    This is equivalent to the ANSI~C `size_t' type, i.e., the largest  */
   319    *   This is equivalent to the ANSI~C `size_t` type, i.e., the largest
   321   /*    _unsigned_ integer type used to express a file size or position,   */
   320    *   _unsigned_ integer type used to express a file size or position, or a
   322   /*    or a memory block size.                                            */
   321    *   memory block size.
   323   /*                                                                       */
   322    */
   324   typedef size_t  FT_Offset;
   323   typedef size_t  FT_Offset;
   325 
   324 
   326 
   325 
   327   /*************************************************************************/
   326   /**************************************************************************
   328   /*                                                                       */
   327    *
   329   /* <Type>                                                                */
   328    * @type:
   330   /*    FT_PtrDist                                                         */
   329    *   FT_PtrDist
   331   /*                                                                       */
   330    *
   332   /* <Description>                                                         */
   331    * @description:
   333   /*    This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the       */
   332    *   This is equivalent to the ANSI~C `ptrdiff_t` type, i.e., the largest
   334   /*    largest _signed_ integer type used to express the distance         */
   333    *   _signed_ integer type used to express the distance between two
   335   /*    between two pointers.                                              */
   334    *   pointers.
   336   /*                                                                       */
   335    */
   337   typedef ft_ptrdiff_t  FT_PtrDist;
   336   typedef ft_ptrdiff_t  FT_PtrDist;
   338 
   337 
   339 
   338 
   340   /*************************************************************************/
   339   /**************************************************************************
   341   /*                                                                       */
   340    *
   342   /* <Struct>                                                              */
   341    * @struct:
   343   /*    FT_UnitVector                                                      */
   342    *   FT_UnitVector
   344   /*                                                                       */
   343    *
   345   /* <Description>                                                         */
   344    * @description:
   346   /*    A simple structure used to store a 2D vector unit vector.  Uses    */
   345    *   A simple structure used to store a 2D vector unit vector.  Uses
   347   /*    FT_F2Dot14 types.                                                  */
   346    *   FT_F2Dot14 types.
   348   /*                                                                       */
   347    *
   349   /* <Fields>                                                              */
   348    * @fields:
   350   /*    x :: Horizontal coordinate.                                        */
   349    *   x ::
   351   /*                                                                       */
   350    *     Horizontal coordinate.
   352   /*    y :: Vertical coordinate.                                          */
   351    *
   353   /*                                                                       */
   352    *   y ::
       
   353    *     Vertical coordinate.
       
   354    */
   354   typedef struct  FT_UnitVector_
   355   typedef struct  FT_UnitVector_
   355   {
   356   {
   356     FT_F2Dot14  x;
   357     FT_F2Dot14  x;
   357     FT_F2Dot14  y;
   358     FT_F2Dot14  y;
   358 
   359 
   359   } FT_UnitVector;
   360   } FT_UnitVector;
   360 
   361 
   361 
   362 
   362   /*************************************************************************/
   363   /**************************************************************************
   363   /*                                                                       */
   364    *
   364   /* <Struct>                                                              */
   365    * @struct:
   365   /*    FT_Matrix                                                          */
   366    *   FT_Matrix
   366   /*                                                                       */
   367    *
   367   /* <Description>                                                         */
   368    * @description:
   368   /*    A simple structure used to store a 2x2 matrix.  Coefficients are   */
   369    *   A simple structure used to store a 2x2 matrix.  Coefficients are in
   369   /*    in 16.16 fixed-point format.  The computation performed is:        */
   370    *   16.16 fixed-point format.  The computation performed is:
   370   /*                                                                       */
   371    *
   371   /*       {                                                               */
   372    *   ```
   372   /*          x' = x*xx + y*xy                                             */
   373    *     x' = x*xx + y*xy
   373   /*          y' = x*yx + y*yy                                             */
   374    *     y' = x*yx + y*yy
   374   /*       }                                                               */
   375    *   ```
   375   /*                                                                       */
   376    *
   376   /* <Fields>                                                              */
   377    * @fields:
   377   /*    xx :: Matrix coefficient.                                          */
   378    *   xx ::
   378   /*                                                                       */
   379    *     Matrix coefficient.
   379   /*    xy :: Matrix coefficient.                                          */
   380    *
   380   /*                                                                       */
   381    *   xy ::
   381   /*    yx :: Matrix coefficient.                                          */
   382    *     Matrix coefficient.
   382   /*                                                                       */
   383    *
   383   /*    yy :: Matrix coefficient.                                          */
   384    *   yx ::
   384   /*                                                                       */
   385    *     Matrix coefficient.
       
   386    *
       
   387    *   yy ::
       
   388    *     Matrix coefficient.
       
   389    */
   385   typedef struct  FT_Matrix_
   390   typedef struct  FT_Matrix_
   386   {
   391   {
   387     FT_Fixed  xx, xy;
   392     FT_Fixed  xx, xy;
   388     FT_Fixed  yx, yy;
   393     FT_Fixed  yx, yy;
   389 
   394 
   390   } FT_Matrix;
   395   } FT_Matrix;
   391 
   396 
   392 
   397 
   393   /*************************************************************************/
   398   /**************************************************************************
   394   /*                                                                       */
   399    *
   395   /* <Struct>                                                              */
   400    * @struct:
   396   /*    FT_Data                                                            */
   401    *   FT_Data
   397   /*                                                                       */
   402    *
   398   /* <Description>                                                         */
   403    * @description:
   399   /*    Read-only binary data represented as a pointer and a length.       */
   404    *   Read-only binary data represented as a pointer and a length.
   400   /*                                                                       */
   405    *
   401   /* <Fields>                                                              */
   406    * @fields:
   402   /*    pointer :: The data.                                               */
   407    *   pointer ::
   403   /*                                                                       */
   408    *     The data.
   404   /*    length  :: The length of the data in bytes.                        */
   409    *
   405   /*                                                                       */
   410    *   length ::
       
   411    *     The length of the data in bytes.
       
   412    */
   406   typedef struct  FT_Data_
   413   typedef struct  FT_Data_
   407   {
   414   {
   408     const FT_Byte*  pointer;
   415     const FT_Byte*  pointer;
   409     FT_Int          length;
   416     FT_Int          length;
   410 
   417 
   411   } FT_Data;
   418   } FT_Data;
   412 
   419 
   413 
   420 
   414   /*************************************************************************/
   421   /**************************************************************************
   415   /*                                                                       */
   422    *
   416   /* <FuncType>                                                            */
   423    * @functype:
   417   /*    FT_Generic_Finalizer                                               */
   424    *   FT_Generic_Finalizer
   418   /*                                                                       */
   425    *
   419   /* <Description>                                                         */
   426    * @description:
   420   /*    Describe a function used to destroy the `client' data of any       */
   427    *   Describe a function used to destroy the 'client' data of any FreeType
   421   /*    FreeType object.  See the description of the @FT_Generic type for  */
   428    *   object.  See the description of the @FT_Generic type for details of
   422   /*    details of usage.                                                  */
   429    *   usage.
   423   /*                                                                       */
   430    *
   424   /* <Input>                                                               */
   431    * @input:
   425   /*    The address of the FreeType object that is under finalization.     */
   432    *   The address of the FreeType object that is under finalization.  Its
   426   /*    Its client data is accessed through its `generic' field.           */
   433    *   client data is accessed through its `generic` field.
   427   /*                                                                       */
   434    */
   428   typedef void  (*FT_Generic_Finalizer)( void*  object );
   435   typedef void  (*FT_Generic_Finalizer)( void*  object );
   429 
   436 
   430 
   437 
   431   /*************************************************************************/
   438   /**************************************************************************
   432   /*                                                                       */
   439    *
   433   /* <Struct>                                                              */
   440    * @struct:
   434   /*    FT_Generic                                                         */
   441    *   FT_Generic
   435   /*                                                                       */
   442    *
   436   /* <Description>                                                         */
   443    * @description:
   437   /*    Client applications often need to associate their own data to a    */
   444    *   Client applications often need to associate their own data to a
   438   /*    variety of FreeType core objects.  For example, a text layout API  */
   445    *   variety of FreeType core objects.  For example, a text layout API
   439   /*    might want to associate a glyph cache to a given size object.      */
   446    *   might want to associate a glyph cache to a given size object.
   440   /*                                                                       */
   447    *
   441   /*    Some FreeType object contains a `generic' field, of type           */
   448    *   Some FreeType object contains a `generic` field, of type `FT_Generic`,
   442   /*    FT_Generic, which usage is left to client applications and font    */
   449    *   which usage is left to client applications and font servers.
   443   /*    servers.                                                           */
   450    *
   444   /*                                                                       */
   451    *   It can be used to store a pointer to client-specific data, as well as
   445   /*    It can be used to store a pointer to client-specific data, as well */
   452    *   the address of a 'finalizer' function, which will be called by
   446   /*    as the address of a `finalizer' function, which will be called by  */
   453    *   FreeType when the object is destroyed (for example, the previous
   447   /*    FreeType when the object is destroyed (for example, the previous   */
   454    *   client example would put the address of the glyph cache destructor in
   448   /*    client example would put the address of the glyph cache destructor */
   455    *   the `finalizer` field).
   449   /*    in the `finalizer' field).                                         */
   456    *
   450   /*                                                                       */
   457    * @fields:
   451   /* <Fields>                                                              */
   458    *   data ::
   452   /*    data      :: A typeless pointer to any client-specified data. This */
   459    *     A typeless pointer to any client-specified data. This field is
   453   /*                 field is completely ignored by the FreeType library.  */
   460    *     completely ignored by the FreeType library.
   454   /*                                                                       */
   461    *
   455   /*    finalizer :: A pointer to a `generic finalizer' function, which    */
   462    *   finalizer ::
   456   /*                 will be called when the object is destroyed.  If this */
   463    *     A pointer to a 'generic finalizer' function, which will be called
   457   /*                 field is set to NULL, no code will be called.         */
   464    *     when the object is destroyed.  If this field is set to `NULL`, no
   458   /*                                                                       */
   465    *     code will be called.
       
   466    */
   459   typedef struct  FT_Generic_
   467   typedef struct  FT_Generic_
   460   {
   468   {
   461     void*                 data;
   469     void*                 data;
   462     FT_Generic_Finalizer  finalizer;
   470     FT_Generic_Finalizer  finalizer;
   463 
   471 
   464   } FT_Generic;
   472   } FT_Generic;
   465 
   473 
   466 
   474 
   467   /*************************************************************************/
   475   /**************************************************************************
   468   /*                                                                       */
   476    *
   469   /* <Macro>                                                               */
   477    * @macro:
   470   /*    FT_MAKE_TAG                                                        */
   478    *   FT_MAKE_TAG
   471   /*                                                                       */
   479    *
   472   /* <Description>                                                         */
   480    * @description:
   473   /*    This macro converts four-letter tags that are used to label        */
   481    *   This macro converts four-letter tags that are used to label TrueType
   474   /*    TrueType tables into an unsigned long, to be used within FreeType. */
   482    *   tables into an unsigned long, to be used within FreeType.
   475   /*                                                                       */
   483    *
   476   /* <Note>                                                                */
   484    * @note:
   477   /*    The produced values *must* be 32-bit integers.  Don't redefine     */
   485    *   The produced values **must** be 32-bit integers.  Don't redefine this
   478   /*    this macro.                                                        */
   486    *   macro.
   479   /*                                                                       */
   487    */
   480 #define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
   488 #define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
   481           (FT_Tag)                        \
   489           (FT_Tag)                        \
   482           ( ( (FT_ULong)_x1 << 24 ) |     \
   490           ( ( (FT_ULong)_x1 << 24 ) |     \
   483             ( (FT_ULong)_x2 << 16 ) |     \
   491             ( (FT_ULong)_x2 << 16 ) |     \
   484             ( (FT_ULong)_x3 <<  8 ) |     \
   492             ( (FT_ULong)_x3 <<  8 ) |     \
   492   /*                                                                       */
   500   /*                                                                       */
   493   /*************************************************************************/
   501   /*************************************************************************/
   494   /*************************************************************************/
   502   /*************************************************************************/
   495 
   503 
   496 
   504 
   497   /*************************************************************************/
   505   /**************************************************************************
   498   /*                                                                       */
   506    *
   499   /* <Section>                                                             */
   507    * @section:
   500   /*    list_processing                                                    */
   508    *   list_processing
   501   /*                                                                       */
   509    *
   502   /*************************************************************************/
   510    */
   503 
   511 
   504 
   512 
   505   /*************************************************************************/
   513   /**************************************************************************
   506   /*                                                                       */
   514    *
   507   /* <Type>                                                                */
   515    * @type:
   508   /*    FT_ListNode                                                        */
   516    *   FT_ListNode
   509   /*                                                                       */
   517    *
   510   /* <Description>                                                         */
   518    * @description:
   511   /*     Many elements and objects in FreeType are listed through an       */
   519    *    Many elements and objects in FreeType are listed through an @FT_List
   512   /*     @FT_List record (see @FT_ListRec).  As its name suggests, an      */
   520    *    record (see @FT_ListRec).  As its name suggests, an FT_ListNode is a
   513   /*     FT_ListNode is a handle to a single list element.                 */
   521    *    handle to a single list element.
   514   /*                                                                       */
   522    */
   515   typedef struct FT_ListNodeRec_*  FT_ListNode;
   523   typedef struct FT_ListNodeRec_*  FT_ListNode;
   516 
   524 
   517 
   525 
   518   /*************************************************************************/
   526   /**************************************************************************
   519   /*                                                                       */
   527    *
   520   /* <Type>                                                                */
   528    * @type:
   521   /*    FT_List                                                            */
   529    *   FT_List
   522   /*                                                                       */
   530    *
   523   /* <Description>                                                         */
   531    * @description:
   524   /*    A handle to a list record (see @FT_ListRec).                       */
   532    *   A handle to a list record (see @FT_ListRec).
   525   /*                                                                       */
   533    */
   526   typedef struct FT_ListRec_*  FT_List;
   534   typedef struct FT_ListRec_*  FT_List;
   527 
   535 
   528 
   536 
   529   /*************************************************************************/
   537   /**************************************************************************
   530   /*                                                                       */
   538    *
   531   /* <Struct>                                                              */
   539    * @struct:
   532   /*    FT_ListNodeRec                                                     */
   540    *   FT_ListNodeRec
   533   /*                                                                       */
   541    *
   534   /* <Description>                                                         */
   542    * @description:
   535   /*    A structure used to hold a single list element.                    */
   543    *   A structure used to hold a single list element.
   536   /*                                                                       */
   544    *
   537   /* <Fields>                                                              */
   545    * @fields:
   538   /*    prev :: The previous element in the list.  NULL if first.          */
   546    *   prev ::
   539   /*                                                                       */
   547    *     The previous element in the list.  `NULL` if first.
   540   /*    next :: The next element in the list.  NULL if last.               */
   548    *
   541   /*                                                                       */
   549    *   next ::
   542   /*    data :: A typeless pointer to the listed object.                   */
   550    *     The next element in the list.  `NULL` if last.
   543   /*                                                                       */
   551    *
       
   552    *   data ::
       
   553    *     A typeless pointer to the listed object.
       
   554    */
   544   typedef struct  FT_ListNodeRec_
   555   typedef struct  FT_ListNodeRec_
   545   {
   556   {
   546     FT_ListNode  prev;
   557     FT_ListNode  prev;
   547     FT_ListNode  next;
   558     FT_ListNode  next;
   548     void*        data;
   559     void*        data;
   549 
   560 
   550   } FT_ListNodeRec;
   561   } FT_ListNodeRec;
   551 
   562 
   552 
   563 
   553   /*************************************************************************/
   564   /**************************************************************************
   554   /*                                                                       */
   565    *
   555   /* <Struct>                                                              */
   566    * @struct:
   556   /*    FT_ListRec                                                         */
   567    *   FT_ListRec
   557   /*                                                                       */
   568    *
   558   /* <Description>                                                         */
   569    * @description:
   559   /*    A structure used to hold a simple doubly-linked list.  These are   */
   570    *   A structure used to hold a simple doubly-linked list.  These are used
   560   /*    used in many parts of FreeType.                                    */
   571    *   in many parts of FreeType.
   561   /*                                                                       */
   572    *
   562   /* <Fields>                                                              */
   573    * @fields:
   563   /*    head :: The head (first element) of doubly-linked list.            */
   574    *   head ::
   564   /*                                                                       */
   575    *     The head (first element) of doubly-linked list.
   565   /*    tail :: The tail (last element) of doubly-linked list.             */
   576    *
   566   /*                                                                       */
   577    *   tail ::
       
   578    *     The tail (last element) of doubly-linked list.
       
   579    */
   567   typedef struct  FT_ListRec_
   580   typedef struct  FT_ListRec_
   568   {
   581   {
   569     FT_ListNode  head;
   582     FT_ListNode  head;
   570     FT_ListNode  tail;
   583     FT_ListNode  tail;
   571 
   584 
   573 
   586 
   574   /* */
   587   /* */
   575 
   588 
   576 
   589 
   577 #define FT_IS_EMPTY( list )  ( (list).head == 0 )
   590 #define FT_IS_EMPTY( list )  ( (list).head == 0 )
   578 #define FT_BOOL( x )  ( (FT_Bool)( x ) )
   591 #define FT_BOOL( x )  ( (FT_Bool)( (x) != 0 ) )
   579 
   592 
   580   /* concatenate C tokens */
   593   /* concatenate C tokens */
   581 #define FT_ERR_XCAT( x, y )  x ## y
   594 #define FT_ERR_XCAT( x, y )  x ## y
   582 #define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )
   595 #define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )
   583 
   596 
   584   /* see `ftmoderr.h' for descriptions of the following macros */
   597   /* see `ftmoderr.h` for descriptions of the following macros */
   585 
   598 
   586 #define FT_ERR( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )
   599 #define FT_ERR( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )
   587 
   600 
   588 #define FT_ERROR_BASE( x )    ( (x) & 0xFF )
   601 #define FT_ERROR_BASE( x )    ( (x) & 0xFF )
   589 #define FT_ERROR_MODULE( x )  ( (x) & 0xFF00U )
   602 #define FT_ERROR_MODULE( x )  ( (x) & 0xFF00U )