freetype.h
上传用户:yisoukefu
上传日期:2020-08-09
资源大小:39506k
文件大小:206k
源码类别:

其他游戏

开发平台:

Visual C++

  1. /***************************************************************************/
  2. /*                                                                         */
  3. /*  freetype.h                                                             */
  4. /*                                                                         */
  5. /*    FreeType high-level API and common types (specification only).       */
  6. /*                                                                         */
  7. /*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */
  8. /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
  9. /*                                                                         */
  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      */
  12. /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
  13. /*  this file you indicate that you have read the license and              */
  14. /*  understand and accept it fully.                                        */
  15. /*                                                                         */
  16. /***************************************************************************/
  17. #ifndef FT_FREETYPE_H
  18. #error "`ft2build.h' hasn't been included yet!"
  19. #error "Please always use macros to include FreeType header files."
  20. #error "Example:"
  21. #error "  #include <ft2build.h>"
  22. #error "  #include FT_FREETYPE_H"
  23. #endif
  24.   /*************************************************************************/
  25.   /*                                                                       */
  26.   /* The `raster' component duplicates some of the declarations in         */
  27.   /* freetype.h for stand-alone use if _FREETYPE_ isn't defined.           */
  28.   /*                                                                       */
  29.   /*************************************************************************/
  30. #ifndef __FREETYPE_H__
  31. #define __FREETYPE_H__
  32. #include <ft2build.h>
  33. #include FT_CONFIG_CONFIG_H
  34. #include FT_ERRORS_H
  35. #include FT_TYPES_H
  36. FT_BEGIN_HEADER
  37.   /*************************************************************************/
  38.   /*                                                                       */
  39.   /* <Section>                                                             */
  40.   /*    user_allocation                                                    */
  41.   /*                                                                       */
  42.   /* <Title>                                                               */
  43.   /*    User allocation                                                    */
  44.   /*                                                                       */
  45.   /* <Abstract>                                                            */
  46.   /*    How client applications should allocate FreeType data structures.  */
  47.   /*                                                                       */
  48.   /* <Description>                                                         */
  49.   /*    FreeType assumes that structures allocated by the user and passed  */
  50.   /*    as arguments are zeroed out except for the actual data.  With      */
  51.   /*    other words, it is recommended to use `calloc' (or variants of it) */
  52.   /*    instead of `malloc' for allocation.                                */
  53.   /*                                                                       */
  54.   /*************************************************************************/
  55.   /*************************************************************************/
  56.   /*************************************************************************/
  57.   /*                                                                       */
  58.   /*                        B A S I C   T Y P E S                          */
  59.   /*                                                                       */
  60.   /*************************************************************************/
  61.   /*************************************************************************/
  62.   /*************************************************************************/
  63.   /*                                                                       */
  64.   /* <Section>                                                             */
  65.   /*    base_interface                                                     */
  66.   /*                                                                       */
  67.   /* <Title>                                                               */
  68.   /*    Base Interface                                                     */
  69.   /*                                                                       */
  70.   /* <Abstract>                                                            */
  71.   /*    The FreeType 2 base font interface.                                */
  72.   /*                                                                       */
  73.   /* <Description>                                                         */
  74.   /*    This section describes the public high-level API of FreeType 2.    */
  75.   /*                                                                       */
  76.   /* <Order>                                                               */
  77.   /*    FT_Library                                                         */
  78.   /*    FT_Face                                                            */
  79.   /*    FT_Size                                                            */
  80.   /*    FT_GlyphSlot                                                       */
  81.   /*    FT_CharMap                                                         */
  82.   /*    FT_Encoding                                                        */
  83.   /*                                                                       */
  84.   /*    FT_FaceRec                                                         */
  85.   /*                                                                       */
  86.   /*    FT_FACE_FLAG_SCALABLE                                              */
  87.   /*    FT_FACE_FLAG_FIXED_SIZES                                           */
  88.   /*    FT_FACE_FLAG_FIXED_WIDTH                                           */
  89.   /*    FT_FACE_FLAG_HORIZONTAL                                            */
  90.   /*    FT_FACE_FLAG_VERTICAL                                              */
  91.   /*    FT_FACE_FLAG_SFNT                                                  */
  92.   /*    FT_FACE_FLAG_KERNING                                               */
  93.   /*    FT_FACE_FLAG_MULTIPLE_MASTERS                                      */
  94.   /*    FT_FACE_FLAG_GLYPH_NAMES                                           */
  95.   /*    FT_FACE_FLAG_EXTERNAL_STREAM                                       */
  96.   /*    FT_FACE_FLAG_FAST_GLYPHS                                           */
  97.   /*    FT_FACE_FLAG_HINTER                                                */
  98.   /*                                                                       */
  99.   /*    FT_STYLE_FLAG_BOLD                                                 */
  100.   /*    FT_STYLE_FLAG_ITALIC                                               */
  101.   /*                                                                       */
  102.   /*    FT_SizeRec                                                         */
  103.   /*    FT_Size_Metrics                                                    */
  104.   /*                                                                       */
  105.   /*    FT_GlyphSlotRec                                                    */
  106.   /*    FT_Glyph_Metrics                                                   */
  107.   /*    FT_SubGlyph                                                        */
  108.   /*                                                                       */
  109.   /*    FT_Bitmap_Size                                                     */
  110.   /*                                                                       */
  111.   /*    FT_Init_FreeType                                                   */
  112.   /*    FT_Done_FreeType                                                   */
  113.   /*                                                                       */
  114.   /*    FT_New_Face                                                        */
  115.   /*    FT_Done_Face                                                       */
  116.   /*    FT_New_Memory_Face                                                 */
  117.   /*    FT_Open_Face                                                       */
  118.   /*    FT_Open_Args                                                       */
  119.   /*    FT_Parameter                                                       */
  120.   /*    FT_Attach_File                                                     */
  121.   /*    FT_Attach_Stream                                                   */
  122.   /*                                                                       */
  123.   /*    FT_Set_Char_Size                                                   */
  124.   /*    FT_Set_Pixel_Sizes                                                 */
  125.   /*    FT_Request_Size                                                    */
  126.   /*    FT_Select_Size                                                     */
  127.   /*    FT_Size_Request_Type                                               */
  128.   /*    FT_Size_Request                                                    */
  129.   /*    FT_Set_Transform                                                   */
  130.   /*    FT_Load_Glyph                                                      */
  131.   /*    FT_Get_Char_Index                                                  */
  132.   /*    FT_Get_Name_Index                                                  */
  133.   /*    FT_Load_Char                                                       */
  134.   /*                                                                       */
  135.   /*    FT_OPEN_MEMORY                                                     */
  136.   /*    FT_OPEN_STREAM                                                     */
  137.   /*    FT_OPEN_PATHNAME                                                   */
  138.   /*    FT_OPEN_DRIVER                                                     */
  139.   /*    FT_OPEN_PARAMS                                                     */
  140.   /*                                                                       */
  141.   /*    FT_LOAD_DEFAULT                                                    */
  142.   /*    FT_LOAD_RENDER                                                     */
  143.   /*    FT_LOAD_MONOCHROME                                                 */
  144.   /*    FT_LOAD_LINEAR_DESIGN                                              */
  145.   /*    FT_LOAD_NO_SCALE                                                   */
  146.   /*    FT_LOAD_NO_HINTING                                                 */
  147.   /*    FT_LOAD_NO_BITMAP                                                  */
  148.   /*    FT_LOAD_CROP_BITMAP                                                */
  149.   /*                                                                       */
  150.   /*    FT_LOAD_VERTICAL_LAYOUT                                            */
  151.   /*    FT_LOAD_IGNORE_TRANSFORM                                           */
  152.   /*    FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH                                */
  153.   /*    FT_LOAD_FORCE_AUTOHINT                                             */
  154.   /*    FT_LOAD_NO_RECURSE                                                 */
  155.   /*    FT_LOAD_PEDANTIC                                                   */
  156.   /*                                                                       */
  157.   /*    FT_LOAD_TARGET_NORMAL                                              */
  158.   /*    FT_LOAD_TARGET_LIGHT                                               */
  159.   /*    FT_LOAD_TARGET_MONO                                                */
  160.   /*    FT_LOAD_TARGET_LCD                                                 */
  161.   /*    FT_LOAD_TARGET_LCD_V                                               */
  162.   /*                                                                       */
  163.   /*    FT_Render_Glyph                                                    */
  164.   /*    FT_Render_Mode                                                     */
  165.   /*    FT_Get_Kerning                                                     */
  166.   /*    FT_Kerning_Mode                                                    */
  167.   /*    FT_Get_Track_Kerning                                               */
  168.   /*    FT_Get_Glyph_Name                                                  */
  169.   /*    FT_Get_Postscript_Name                                             */
  170.   /*                                                                       */
  171.   /*    FT_CharMapRec                                                      */
  172.   /*    FT_Select_Charmap                                                  */
  173.   /*    FT_Set_Charmap                                                     */
  174.   /*    FT_Get_Charmap_Index                                               */
  175.   /*                                                                       */
  176.   /*************************************************************************/
  177.   /*************************************************************************/
  178.   /*                                                                       */
  179.   /* <Struct>                                                              */
  180.   /*    FT_Glyph_Metrics                                                   */
  181.   /*                                                                       */
  182.   /* <Description>                                                         */
  183.   /*    A structure used to model the metrics of a single glyph.  The      */
  184.   /*    values are expressed in 26.6 fractional pixel format; if the flag  */
  185.   /*    @FT_LOAD_NO_SCALE has been used while loading the glyph, values    */
  186.   /*    are expressed in font units instead.                               */
  187.   /*                                                                       */
  188.   /* <Fields>                                                              */
  189.   /*    width ::                                                           */
  190.   /*      The glyph's width.                                               */
  191.   /*                                                                       */
  192.   /*    height ::                                                          */
  193.   /*      The glyph's height.                                              */
  194.   /*                                                                       */
  195.   /*    horiBearingX ::                                                    */
  196.   /*      Left side bearing for horizontal layout.                         */
  197.   /*                                                                       */
  198.   /*    horiBearingY ::                                                    */
  199.   /*      Top side bearing for horizontal layout.                          */
  200.   /*                                                                       */
  201.   /*    horiAdvance ::                                                     */
  202.   /*      Advance width for horizontal layout.                             */
  203.   /*                                                                       */
  204.   /*    vertBearingX ::                                                    */
  205.   /*      Left side bearing for vertical layout.                           */
  206.   /*                                                                       */
  207.   /*    vertBearingY ::                                                    */
  208.   /*      Top side bearing for vertical layout.                            */
  209.   /*                                                                       */
  210.   /*    vertAdvance ::                                                     */
  211.   /*      Advance height for vertical layout.                              */
  212.   /*                                                                       */
  213.   typedef struct  FT_Glyph_Metrics_
  214.   {
  215.     FT_Pos  width;
  216.     FT_Pos  height;
  217.     FT_Pos  horiBearingX;
  218.     FT_Pos  horiBearingY;
  219.     FT_Pos  horiAdvance;
  220.     FT_Pos  vertBearingX;
  221.     FT_Pos  vertBearingY;
  222.     FT_Pos  vertAdvance;
  223.   } FT_Glyph_Metrics;
  224.   /*************************************************************************/
  225.   /*                                                                       */
  226.   /* <Struct>                                                              */
  227.   /*    FT_Bitmap_Size                                                     */
  228.   /*                                                                       */
  229.   /* <Description>                                                         */
  230.   /*    This structure models the metrics of a bitmap strike (i.e., a set  */
  231.   /*    of glyphs for a given point size and resolution) in a bitmap font. */
  232.   /*    It is used for the `available_sizes' field of @FT_Face.            */
  233.   /*                                                                       */
  234.   /* <Fields>                                                              */
  235.   /*    height :: The vertical distance, in pixels, between two            */
  236.   /*              consecutive baselines.  It is always positive.           */
  237.   /*                                                                       */
  238.   /*    width  :: The average width, in pixels, of all glyphs in the       */
  239.   /*              strike.                                                  */
  240.   /*                                                                       */
  241.   /*    size   :: The nominal size of the strike in 26.6 fractional        */
  242.   /*              points.  This field is not very useful.                  */
  243.   /*                                                                       */
  244.   /*    x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional   */
  245.   /*              pixels.                                                  */
  246.   /*                                                                       */
  247.   /*    y_ppem :: The vertical ppem (nominal height) in 26.6 fractional    */
  248.   /*              pixels.                                                  */
  249.   /*                                                                       */
  250.   /* <Note>                                                                */
  251.   /*    Windows FNT:                                                       */
  252.   /*      The nominal size given in a FNT font is not reliable.  Thus when */
  253.   /*      the driver finds it incorrect, it sets `size' to some calculated */
  254.   /*      values and sets `x_ppem' and `y_ppem' to the pixel width and     */
  255.   /*      height given in the font, respectively.                          */
  256.   /*                                                                       */
  257.   /*    TrueType embedded bitmaps:                                         */
  258.   /*      `size', `width', and `height' values are not contained in the    */
  259.   /*      bitmap strike itself.  They are computed from the global font    */
  260.   /*      parameters.                                                      */
  261.   /*                                                                       */
  262.   typedef struct  FT_Bitmap_Size_
  263.   {
  264.     FT_Short  height;
  265.     FT_Short  width;
  266.     FT_Pos    size;
  267.     FT_Pos    x_ppem;
  268.     FT_Pos    y_ppem;
  269.   } FT_Bitmap_Size;
  270.   /*************************************************************************/
  271.   /*************************************************************************/
  272.   /*                                                                       */
  273.   /*                     O B J E C T   C L A S S E S                       */
  274.   /*                                                                       */
  275.   /*************************************************************************/
  276.   /*************************************************************************/
  277.   /*************************************************************************/
  278.   /*                                                                       */
  279.   /* <Type>                                                                */
  280.   /*    FT_Library                                                         */
  281.   /*                                                                       */
  282.   /* <Description>                                                         */
  283.   /*    A handle to a FreeType library instance.  Each `library' is        */
  284.   /*    completely independent from the others; it is the `root' of a set  */
  285.   /*    of objects like fonts, faces, sizes, etc.                          */
  286.   /*                                                                       */
  287.   /*    It also embeds a memory manager (see @FT_Memory), as well as a     */
  288.   /*    scan-line converter object (see @FT_Raster).                       */
  289.   /*                                                                       */
  290.   /*    For multi-threading applications each thread should have its own   */
  291.   /*    FT_Library object.                                                 */
  292.   /*                                                                       */
  293.   /* <Note>                                                                */
  294.   /*    Library objects are normally created by @FT_Init_FreeType, and     */
  295.   /*    destroyed with @FT_Done_FreeType.                                  */
  296.   /*                                                                       */
  297.   typedef struct FT_LibraryRec_  *FT_Library;
  298.   /*************************************************************************/
  299.   /*                                                                       */
  300.   /* <Type>                                                                */
  301.   /*    FT_Module                                                          */
  302.   /*                                                                       */
  303.   /* <Description>                                                         */
  304.   /*    A handle to a given FreeType module object.  Each module can be a  */
  305.   /*    font driver, a renderer, or anything else that provides services   */
  306.   /*    to the formers.                                                    */
  307.   /*                                                                       */
  308.   typedef struct FT_ModuleRec_*  FT_Module;
  309.   /*************************************************************************/
  310.   /*                                                                       */
  311.   /* <Type>                                                                */
  312.   /*    FT_Driver                                                          */
  313.   /*                                                                       */
  314.   /* <Description>                                                         */
  315.   /*    A handle to a given FreeType font driver object.  Each font driver */
  316.   /*    is a special module capable of creating faces from font files.     */
  317.   /*                                                                       */
  318.   typedef struct FT_DriverRec_*  FT_Driver;
  319.   /*************************************************************************/
  320.   /*                                                                       */
  321.   /* <Type>                                                                */
  322.   /*    FT_Renderer                                                        */
  323.   /*                                                                       */
  324.   /* <Description>                                                         */
  325.   /*    A handle to a given FreeType renderer.  A renderer is a special    */
  326.   /*    module in charge of converting a glyph image to a bitmap, when     */
  327.   /*    necessary.  Each renderer supports a given glyph image format, and */
  328.   /*    one or more target surface depths.                                 */
  329.   /*                                                                       */
  330.   typedef struct FT_RendererRec_*  FT_Renderer;
  331.   /*************************************************************************/
  332.   /*                                                                       */
  333.   /* <Type>                                                                */
  334.   /*    FT_Face                                                            */
  335.   /*                                                                       */
  336.   /* <Description>                                                         */
  337.   /*    A handle to a given typographic face object.  A face object models */
  338.   /*    a given typeface, in a given style.                                */
  339.   /*                                                                       */
  340.   /* <Note>                                                                */
  341.   /*    Each face object also owns a single @FT_GlyphSlot object, as well  */
  342.   /*    as one or more @FT_Size objects.                                   */
  343.   /*                                                                       */
  344.   /*    Use @FT_New_Face or @FT_Open_Face to create a new face object from */
  345.   /*    a given filepathname or a custom input stream.                     */
  346.   /*                                                                       */
  347.   /*    Use @FT_Done_Face to destroy it (along with its slot and sizes).   */
  348.   /*                                                                       */
  349.   /* <Also>                                                                */
  350.   /*    The @FT_FaceRec details the publicly accessible fields of a given  */
  351.   /*    face object.                                                       */
  352.   /*                                                                       */
  353.   typedef struct FT_FaceRec_*  FT_Face;
  354.   /*************************************************************************/
  355.   /*                                                                       */
  356.   /* <Type>                                                                */
  357.   /*    FT_Size                                                            */
  358.   /*                                                                       */
  359.   /* <Description>                                                         */
  360.   /*    A handle to an object used to model a face scaled to a given       */
  361.   /*    character size.                                                    */
  362.   /*                                                                       */
  363.   /* <Note>                                                                */
  364.   /*    Each @FT_Face has an _active_ @FT_Size object that is used by      */
  365.   /*    functions like @FT_Load_Glyph to determine the scaling             */
  366.   /*    transformation which is used to load and hint glyphs and metrics.  */
  367.   /*                                                                       */
  368.   /*    You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes,                */
  369.   /*    @FT_Request_Size or even @FT_Select_Size to change the content     */
  370.   /*    (i.e., the scaling values) of the active @FT_Size.                 */
  371.   /*                                                                       */
  372.   /*    You can use @FT_New_Size to create additional size objects for a   */
  373.   /*    given @FT_Face, but they won't be used by other functions until    */
  374.   /*    you activate it through @FT_Activate_Size.  Only one size can be   */
  375.   /*    activated at any given time per face.                              */
  376.   /*                                                                       */
  377.   /* <Also>                                                                */
  378.   /*    The @FT_SizeRec structure details the publicly accessible fields   */
  379.   /*    of a given size object.                                            */
  380.   /*                                                                       */
  381.   typedef struct FT_SizeRec_*  FT_Size;
  382.   /*************************************************************************/
  383.   /*                                                                       */
  384.   /* <Type>                                                                */
  385.   /*    FT_GlyphSlot                                                       */
  386.   /*                                                                       */
  387.   /* <Description>                                                         */
  388.   /*    A handle to a given `glyph slot'.  A slot is a container where it  */
  389.   /*    is possible to load any one of the glyphs contained in its parent  */
  390.   /*    face.                                                              */
  391.   /*                                                                       */
  392.   /*    In other words, each time you call @FT_Load_Glyph or               */
  393.   /*    @FT_Load_Char, the slot's content is erased by the new glyph data, */
  394.   /*    i.e., the glyph's metrics, its image (bitmap or outline), and      */
  395.   /*    other control information.                                         */
  396.   /*                                                                       */
  397.   /* <Also>                                                                */
  398.   /*    @FT_GlyphSlotRec details the publicly accessible glyph fields.     */
  399.   /*                                                                       */
  400.   typedef struct FT_GlyphSlotRec_*  FT_GlyphSlot;
  401.   /*************************************************************************/
  402.   /*                                                                       */
  403.   /* <Type>                                                                */
  404.   /*    FT_CharMap                                                         */
  405.   /*                                                                       */
  406.   /* <Description>                                                         */
  407.   /*    A handle to a given character map.  A charmap is used to translate */
  408.   /*    character codes in a given encoding into glyph indexes for its     */
  409.   /*    parent's face.  Some font formats may provide several charmaps per */
  410.   /*    font.                                                              */
  411.   /*                                                                       */
  412.   /*    Each face object owns zero or more charmaps, but only one of them  */
  413.   /*    can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char.   */
  414.   /*                                                                       */
  415.   /*    The list of available charmaps in a face is available through the  */
  416.   /*    `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec.   */
  417.   /*                                                                       */
  418.   /*    The currently active charmap is available as `face->charmap'.      */
  419.   /*    You should call @FT_Set_Charmap to change it.                      */
  420.   /*                                                                       */
  421.   /* <Note>                                                                */
  422.   /*    When a new face is created (either through @FT_New_Face or         */
  423.   /*    @FT_Open_Face), the library looks for a Unicode charmap within     */
  424.   /*    the list and automatically activates it.                           */
  425.   /*                                                                       */
  426.   /* <Also>                                                                */
  427.   /*    The @FT_CharMapRec details the publicly accessible fields of a     */
  428.   /*    given character map.                                               */
  429.   /*                                                                       */
  430.   typedef struct FT_CharMapRec_*  FT_CharMap;
  431.   /*************************************************************************/
  432.   /*                                                                       */
  433.   /* <Macro>                                                               */
  434.   /*    FT_ENC_TAG                                                         */
  435.   /*                                                                       */
  436.   /* <Description>                                                         */
  437.   /*    This macro converts four-letter tags into an unsigned long.  It is */
  438.   /*    used to define `encoding' identifiers (see @FT_Encoding).          */
  439.   /*                                                                       */
  440.   /* <Note>                                                                */
  441.   /*    Since many 16bit compilers don't like 32bit enumerations, you      */
  442.   /*    should redefine this macro in case of problems to something like   */
  443.   /*    this:                                                              */
  444.   /*                                                                       */
  445.   /*    {                                                                  */
  446.   /*      #define FT_ENC_TAG( value, a, b, c, d )  value                   */
  447.   /*    }                                                                  */
  448.   /*                                                                       */
  449.   /*    to get a simple enumeration without assigning special numbers.     */
  450.   /*                                                                       */
  451. #ifndef FT_ENC_TAG
  452. #define FT_ENC_TAG( value, a, b, c, d )         
  453.           value = ( ( (FT_UInt32)(a) << 24 ) |  
  454.                     ( (FT_UInt32)(b) << 16 ) |  
  455.                     ( (FT_UInt32)(c) <<  8 ) |  
  456.                       (FT_UInt32)(d)         )
  457. #endif /* FT_ENC_TAG */
  458.   /*************************************************************************/
  459.   /*                                                                       */
  460.   /* <Enum>                                                                */
  461.   /*    FT_Encoding                                                        */
  462.   /*                                                                       */
  463.   /* <Description>                                                         */
  464.   /*    An enumeration used to specify character sets supported by         */
  465.   /*    charmaps.  Used in the @FT_Select_Charmap API function.            */
  466.   /*                                                                       */
  467.   /* <Note>                                                                */
  468.   /*    Despite the name, this enumeration lists specific character        */
  469.   /*    repertories (i.e., charsets), and not text encoding methods (e.g., */
  470.   /*    UTF-8, UTF-16, GB2312_EUC, etc.).                                  */
  471.   /*                                                                       */
  472.   /*    Because of 32-bit charcodes defined in Unicode (i.e., surrogates), */
  473.   /*    all character codes must be expressed as FT_Longs.                 */
  474.   /*                                                                       */
  475.   /*    Other encodings might be defined in the future.                    */
  476.   /*                                                                       */
  477.   /* <Values>                                                              */
  478.   /*   FT_ENCODING_NONE ::                                                 */
  479.   /*     The encoding value 0 is reserved.                                 */
  480.   /*                                                                       */
  481.   /*   FT_ENCODING_UNICODE ::                                              */
  482.   /*     Corresponds to the Unicode character set.  This value covers      */
  483.   /*     all versions of the Unicode repertoire, including ASCII and       */
  484.   /*     Latin-1.  Most fonts include a Unicode charmap, but not all       */
  485.   /*     of them.                                                          */
  486.   /*                                                                       */
  487.   /*   FT_ENCODING_MS_SYMBOL ::                                            */
  488.   /*     Corresponds to the Microsoft Symbol encoding, used to encode      */
  489.   /*     mathematical symbols in the 32..255 character code range.  For    */
  490.   /*     more information, see `http://www.ceviz.net/symbol.htm'.          */
  491.   /*                                                                       */
  492.   /*   FT_ENCODING_SJIS ::                                                 */
  493.   /*     Corresponds to Japanese SJIS encoding.  More info at              */
  494.   /*     at `http://langsupport.japanreference.com/encoding.shtml'.        */
  495.   /*     See note on multi-byte encodings below.                           */
  496.   /*                                                                       */
  497.   /*   FT_ENCODING_GB2312 ::                                               */
  498.   /*     Corresponds to an encoding system for Simplified Chinese as used  */
  499.   /*     used in mainland China.                                           */
  500.   /*                                                                       */
  501.   /*   FT_ENCODING_BIG5 ::                                                 */
  502.   /*     Corresponds to an encoding system for Traditional Chinese as used */
  503.   /*     in Taiwan and Hong Kong.                                          */
  504.   /*                                                                       */
  505.   /*   FT_ENCODING_WANSUNG ::                                              */
  506.   /*     Corresponds to the Korean encoding system known as Wansung.       */
  507.   /*     For more information see                                          */
  508.   /*     `http://www.microsoft.com/typography/unicode/949.txt'.            */
  509.   /*                                                                       */
  510.   /*   FT_ENCODING_JOHAB ::                                                */
  511.   /*     The Korean standard character set (KS C-5601-1992), which         */
  512.   /*     corresponds to MS Windows code page 1361.  This character set     */
  513.   /*     includes all possible Hangeul character combinations.             */
  514.   /*                                                                       */
  515.   /*   FT_ENCODING_ADOBE_LATIN_1 ::                                        */
  516.   /*     Corresponds to a Latin-1 encoding as defined in a Type 1          */
  517.   /*     Postscript font.  It is limited to 256 character codes.           */
  518.   /*                                                                       */
  519.   /*   FT_ENCODING_ADOBE_STANDARD ::                                       */
  520.   /*     Corresponds to the Adobe Standard encoding, as found in Type 1,   */
  521.   /*     CFF, and OpenType/CFF fonts.  It is limited to 256 character      */
  522.   /*     codes.                                                            */
  523.   /*                                                                       */
  524.   /*   FT_ENCODING_ADOBE_EXPERT ::                                         */
  525.   /*     Corresponds to the Adobe Expert encoding, as found in Type 1,     */
  526.   /*     CFF, and OpenType/CFF fonts.  It is limited to 256 character      */
  527.   /*     codes.                                                            */
  528.   /*                                                                       */
  529.   /*   FT_ENCODING_ADOBE_CUSTOM ::                                         */
  530.   /*     Corresponds to a custom encoding, as found in Type 1, CFF, and    */
  531.   /*     OpenType/CFF fonts.  It is limited to 256 character codes.        */
  532.   /*                                                                       */
  533.   /*   FT_ENCODING_APPLE_ROMAN ::                                          */
  534.   /*     Corresponds to the 8-bit Apple roman encoding.  Many TrueType and */
  535.   /*     OpenType fonts contain a charmap for this encoding, since older   */
  536.   /*     versions of Mac OS are able to use it.                            */
  537.   /*                                                                       */
  538.   /*   FT_ENCODING_OLD_LATIN_2 ::                                          */
  539.   /*     This value is deprecated and was never used nor reported by       */
  540.   /*     FreeType.  Don't use or test for it.                              */
  541.   /*                                                                       */
  542.   /*   FT_ENCODING_MS_SJIS ::                                              */
  543.   /*     Same as FT_ENCODING_SJIS.  Deprecated.                            */
  544.   /*                                                                       */
  545.   /*   FT_ENCODING_MS_GB2312 ::                                            */
  546.   /*     Same as FT_ENCODING_GB2312.  Deprecated.                          */
  547.   /*                                                                       */
  548.   /*   FT_ENCODING_MS_BIG5 ::                                              */
  549.   /*     Same as FT_ENCODING_BIG5.  Deprecated.                            */
  550.   /*                                                                       */
  551.   /*   FT_ENCODING_MS_WANSUNG ::                                           */
  552.   /*     Same as FT_ENCODING_WANSUNG.  Deprecated.                         */
  553.   /*                                                                       */
  554.   /*   FT_ENCODING_MS_JOHAB ::                                             */
  555.   /*     Same as FT_ENCODING_JOHAB.  Deprecated.                           */
  556.   /*                                                                       */
  557.   /* <Note>                                                                */
  558.   /*   By default, FreeType automatically synthetizes a Unicode charmap    */
  559.   /*   for Postscript fonts, using their glyph names dictionaries.         */
  560.   /*   However, it also reports the encodings defined explicitly in the    */
  561.   /*   font file, for the cases when they are needed, with the Adobe       */
  562.   /*   values as well.                                                     */
  563.   /*                                                                       */
  564.   /*   FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap   */
  565.   /*   is neither Unicode nor ISO-8859-1 (otherwise it is set to           */
  566.   /*   FT_ENCODING_UNICODE).  Use @FT_Get_BDF_Charset_ID to find out which */
  567.   /*   encoding is really present.  If, for example, the `cs_registry'     */
  568.   /*   field is `KOI8' and the `cs_encoding' field is `R', the font is     */
  569.   /*   encoded in KOI8-R.                                                  */
  570.   /*                                                                       */
  571.   /*   FT_ENCODING_NONE is always set (with a single exception) by the     */
  572.   /*   winfonts driver.  Use @FT_Get_WinFNT_Header and examine the         */
  573.   /*   `charset' field of the @FT_WinFNT_HeaderRec structure to find out   */
  574.   /*   which encoding is really present.  For example,                     */
  575.   /*   @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for        */
  576.   /*   Russian).                                                           */
  577.   /*                                                                       */
  578.   /*   FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH  */
  579.   /*   and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to   */
  580.   /*   FT_ENCODING_APPLE_ROMAN).                                           */
  581.   /*                                                                       */
  582.   /*   If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function  c     */
  583.   /*   @FT_Get_CMap_Language_ID  to query the Mac language ID which may be */
  584.   /*   needed to be able to distinguish Apple encoding variants.  See      */
  585.   /*                                                                       */
  586.   /*     http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT   */
  587.   /*                                                                       */
  588.   /*   to get an idea how to do that.  Basically, if the language ID is 0, */
  589.   /*   don't use it, otherwise subtract 1 from the language ID.  Then      */
  590.   /*   examine `encoding_id'.  If, for example, `encoding_id' is           */
  591.   /*   @TT_MAC_ID_ROMAN and the language ID (minus 1) is                   */
  592.   /*   `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman.         */
  593.   /*   @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi        */
  594.   /*   variant the Arabic encoding.                                        */
  595.   /*                                                                       */
  596.   typedef enum  FT_Encoding_
  597.   {
  598.     FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
  599.     FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
  600.     FT_ENC_TAG( FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c' ),
  601.     FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),
  602.     FT_ENC_TAG( FT_ENCODING_GB2312,  'g', 'b', ' ', ' ' ),
  603.     FT_ENC_TAG( FT_ENCODING_BIG5,    'b', 'i', 'g', '5' ),
  604.     FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
  605.     FT_ENC_TAG( FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a' ),
  606.     /* for backwards compatibility */
  607.     FT_ENCODING_MS_SJIS    = FT_ENCODING_SJIS,
  608.     FT_ENCODING_MS_GB2312  = FT_ENCODING_GB2312,
  609.     FT_ENCODING_MS_BIG5    = FT_ENCODING_BIG5,
  610.     FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
  611.     FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,
  612.     FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
  613.     FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT,   'A', 'D', 'B', 'E' ),
  614.     FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM,   'A', 'D', 'B', 'C' ),
  615.     FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1,  'l', 'a', 't', '1' ),
  616.     FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
  617.     FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
  618.   } FT_Encoding;
  619.   /*************************************************************************/
  620.   /*                                                                       */
  621.   /* <Enum>                                                                */
  622.   /*    ft_encoding_xxx                                                    */
  623.   /*                                                                       */
  624.   /* <Description>                                                         */
  625.   /*    These constants are deprecated; use the corresponding @FT_Encoding */
  626.   /*    values instead.                                                    */
  627.   /*                                                                       */
  628. #define ft_encoding_none            FT_ENCODING_NONE
  629. #define ft_encoding_unicode         FT_ENCODING_UNICODE
  630. #define ft_encoding_symbol          FT_ENCODING_MS_SYMBOL
  631. #define ft_encoding_latin_1         FT_ENCODING_ADOBE_LATIN_1
  632. #define ft_encoding_latin_2         FT_ENCODING_OLD_LATIN_2
  633. #define ft_encoding_sjis            FT_ENCODING_SJIS
  634. #define ft_encoding_gb2312          FT_ENCODING_GB2312
  635. #define ft_encoding_big5            FT_ENCODING_BIG5
  636. #define ft_encoding_wansung         FT_ENCODING_WANSUNG
  637. #define ft_encoding_johab           FT_ENCODING_JOHAB
  638. #define ft_encoding_adobe_standard  FT_ENCODING_ADOBE_STANDARD
  639. #define ft_encoding_adobe_expert    FT_ENCODING_ADOBE_EXPERT
  640. #define ft_encoding_adobe_custom    FT_ENCODING_ADOBE_CUSTOM
  641. #define ft_encoding_apple_roman     FT_ENCODING_APPLE_ROMAN
  642.   /*************************************************************************/
  643.   /*                                                                       */
  644.   /* <Struct>                                                              */
  645.   /*    FT_CharMapRec                                                      */
  646.   /*                                                                       */
  647.   /* <Description>                                                         */
  648.   /*    The base charmap structure.                                        */
  649.   /*                                                                       */
  650.   /* <Fields>                                                              */
  651.   /*    face        :: A handle to the parent face object.                 */
  652.   /*                                                                       */
  653.   /*    encoding    :: An @FT_Encoding tag identifying the charmap.  Use   */
  654.   /*                   this with @FT_Select_Charmap.                       */
  655.   /*                                                                       */
  656.   /*    platform_id :: An ID number describing the platform for the        */
  657.   /*                   following encoding ID.  This comes directly from    */
  658.   /*                   the TrueType specification and should be emulated   */
  659.   /*                   for other formats.                                  */
  660.   /*                                                                       */
  661.   /*    encoding_id :: A platform specific encoding number.  This also     */
  662.   /*                   comes from the TrueType specification and should be */
  663.   /*                   emulated similarly.                                 */
  664.   /*                                                                       */
  665.   typedef struct  FT_CharMapRec_
  666.   {
  667.     FT_Face      face;
  668.     FT_Encoding  encoding;
  669.     FT_UShort    platform_id;
  670.     FT_UShort    encoding_id;
  671.   } FT_CharMapRec;
  672.   /*************************************************************************/
  673.   /*************************************************************************/
  674.   /*                                                                       */
  675.   /*                 B A S E   O B J E C T   C L A S S E S                 */
  676.   /*                                                                       */
  677.   /*************************************************************************/
  678.   /*************************************************************************/
  679.   /*************************************************************************/
  680.   /*                                                                       */
  681.   /* <Type>                                                                */
  682.   /*    FT_Face_Internal                                                   */
  683.   /*                                                                       */
  684.   /* <Description>                                                         */
  685.   /*    An opaque handle to an `FT_Face_InternalRec' structure, used to    */
  686.   /*    model private data of a given @FT_Face object.                     */
  687.   /*                                                                       */
  688.   /*    This structure might change between releases of FreeType 2 and is  */
  689.   /*    not generally available to client applications.                    */
  690.   /*                                                                       */
  691.   typedef struct FT_Face_InternalRec_*  FT_Face_Internal;
  692.   /*************************************************************************/
  693.   /*                                                                       */
  694.   /* <Struct>                                                              */
  695.   /*    FT_FaceRec                                                         */
  696.   /*                                                                       */
  697.   /* <Description>                                                         */
  698.   /*    FreeType root face class structure.  A face object models a        */
  699.   /*    typeface in a font file.                                           */
  700.   /*                                                                       */
  701.   /* <Fields>                                                              */
  702.   /*    num_faces           :: The number of faces in the font file.  Some */
  703.   /*                           font formats can have multiple faces in     */
  704.   /*                           a font file.                                */
  705.   /*                                                                       */
  706.   /*    face_index          :: The index of the face in the font file.  It */
  707.   /*                           is set to 0 if there is only one face in    */
  708.   /*                           the font file.                              */
  709.   /*                                                                       */
  710.   /*    face_flags          :: A set of bit flags that give important      */
  711.   /*                           information about the face; see             */
  712.   /*                           @FT_FACE_FLAG_XXX for the details.          */
  713.   /*                                                                       */
  714.   /*    style_flags         :: A set of bit flags indicating the style of  */
  715.   /*                           the face; see @FT_STYLE_FLAG_XXX for the    */
  716.   /*                           details.                                    */
  717.   /*                                                                       */
  718.   /*    num_glyphs          :: The number of glyphs in the face.  If the   */
  719.   /*                           face is scalable and has sbits (see         */
  720.   /*                           `num_fixed_sizes'), it is set to the number */
  721.   /*                           of outline glyphs.                          */
  722.   /*                                                                       */
  723.   /*    family_name         :: The face's family name.  This is an ASCII   */
  724.   /*                           string, usually in English, which describes */
  725.   /*                           the typeface's family (like `Times New      */
  726.   /*                           Roman', `Bodoni', `Garamond', etc).  This   */
  727.   /*                           is a least common denominator used to list  */
  728.   /*                           fonts.  Some formats (TrueType & OpenType)  */
  729.   /*                           provide localized and Unicode versions of   */
  730.   /*                           this string.  Applications should use the   */
  731.   /*                           format specific interface to access them.   */
  732.   /*                                                                       */
  733.   /*    style_name          :: The face's style name.  This is an ASCII    */
  734.   /*                           string, usually in English, which describes */
  735.   /*                           the typeface's style (like `Italic',        */
  736.   /*                           `Bold', `Condensed', etc).  Not all font    */
  737.   /*                           formats provide a style name, so this field */
  738.   /*                           is optional, and can be set to NULL.  As    */
  739.   /*                           for `family_name', some formats provide     */
  740.   /*                           localized and Unicode versions of this      */
  741.   /*                           string.  Applications should use the format */
  742.   /*                           specific interface to access them.          */
  743.   /*                                                                       */
  744.   /*    num_fixed_sizes     :: The number of bitmap strikes in the face.   */
  745.   /*                           Even if the face is scalable, there might   */
  746.   /*                           still be bitmap strikes, which are called   */
  747.   /*                           `sbits' in that case.                       */
  748.   /*                                                                       */
  749.   /*    available_sizes     :: An array of @FT_Bitmap_Size for all bitmap  */
  750.   /*                           strikes in the face.  It is set to NULL if  */
  751.   /*                           there is no bitmap strike.                  */
  752.   /*                                                                       */
  753.   /*    num_charmaps        :: The number of charmaps in the face.         */
  754.   /*                                                                       */
  755.   /*    charmaps            :: An array of the charmaps of the face.       */
  756.   /*                                                                       */
  757.   /*    generic             :: A field reserved for client uses.  See the  */
  758.   /*                           @FT_Generic type description.               */
  759.   /*                                                                       */
  760.   /*    bbox                :: The font bounding box.  Coordinates are     */
  761.   /*                           expressed in font units (see                */
  762.   /*                           `units_per_EM').  The box is large enough   */
  763.   /*                           to contain any glyph from the font.  Thus,  */
  764.   /*                           `bbox.yMax' can be seen as the `maximal     */
  765.   /*                           ascender', and `bbox.yMin' as the `minimal  */
  766.   /*                           descender'.  Only relevant for scalable     */
  767.   /*                           formats.                                    */
  768.   /*                                                                       */
  769.   /*    units_per_EM        :: The number of font units per EM square for  */
  770.   /*                           this face.  This is typically 2048 for      */
  771.   /*                           TrueType fonts, and 1000 for Type 1 fonts.  */
  772.   /*                           Only relevant for scalable formats.         */
  773.   /*                                                                       */
  774.   /*    ascender            :: The typographic ascender of the face,       */
  775.   /*                           expressed in font units.  For font formats  */
  776.   /*                           not having this information, it is set to   */
  777.   /*                           `bbox.yMax'.  Only relevant for scalable    */
  778.   /*                           formats.                                    */
  779.   /*                                                                       */
  780.   /*    descender           :: The typographic descender of the face,      */
  781.   /*                           expressed in font units.  For font formats  */
  782.   /*                           not having this information, it is set to   */
  783.   /*                           `bbox.yMin'.  Note that this field is       */
  784.   /*                           usually negative.  Only relevant for        */
  785.   /*                           scalable formats.                           */
  786.   /*                                                                       */
  787.   /*    height              :: The height is the vertical distance         */
  788.   /*                           between two consecutive baselines,          */
  789.   /*                           expressed in font units.  It is always      */
  790.   /*                           positive.  Only relevant for scalable       */
  791.   /*                           formats.                                    */
  792.   /*                                                                       */
  793.   /*    max_advance_width   :: The maximal advance width, in font units,   */
  794.   /*                           for all glyphs in this face.  This can be   */
  795.   /*                           used to make word wrapping computations     */
  796.   /*                           faster.  Only relevant for scalable         */
  797.   /*                           formats.                                    */
  798.   /*                                                                       */
  799.   /*    max_advance_height  :: The maximal advance height, in font units,  */
  800.   /*                           for all glyphs in this face.  This is only  */
  801.   /*                           relevant for vertical layouts, and is set   */
  802.   /*                           to `height' for fonts that do not provide   */
  803.   /*                           vertical metrics.  Only relevant for        */
  804.   /*                           scalable formats.                           */
  805.   /*                                                                       */
  806.   /*    underline_position  :: The position, in font units, of the         */
  807.   /*                           underline line for this face.  It's the     */
  808.   /*                           center of the underlining stem.  Only       */
  809.   /*                           relevant for scalable formats.              */
  810.   /*                                                                       */
  811.   /*    underline_thickness :: The thickness, in font units, of the        */
  812.   /*                           underline for this face.  Only relevant for */
  813.   /*                           scalable formats.                           */
  814.   /*                                                                       */
  815.   /*    glyph               :: The face's associated glyph slot(s).        */
  816.   /*                                                                       */
  817.   /*    size                :: The current active size for this face.      */
  818.   /*                                                                       */
  819.   /*    charmap             :: The current active charmap for this face.   */
  820.   /*                                                                       */
  821.   /* <Note>                                                                */
  822.   /*   Fields may be changed after a call to @FT_Attach_File or            */
  823.   /*   @FT_Attach_Stream.                                                  */
  824.   /*                                                                       */
  825.   typedef struct  FT_FaceRec_
  826.   {
  827.     FT_Long           num_faces;
  828.     FT_Long           face_index;
  829.     FT_Long           face_flags;
  830.     FT_Long           style_flags;
  831.     FT_Long           num_glyphs;
  832.     FT_String*        family_name;
  833.     FT_String*        style_name;
  834.     FT_Int            num_fixed_sizes;
  835.     FT_Bitmap_Size*   available_sizes;
  836.     FT_Int            num_charmaps;
  837.     FT_CharMap*       charmaps;
  838.     FT_Generic        generic;
  839.     /*# The following member variables (down to `underline_thickness') */
  840.     /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size    */
  841.     /*# for bitmap fonts.                                              */
  842.     FT_BBox           bbox;
  843.     FT_UShort         units_per_EM;
  844.     FT_Short          ascender;
  845.     FT_Short          descender;
  846.     FT_Short          height;
  847.     FT_Short          max_advance_width;
  848.     FT_Short          max_advance_height;
  849.     FT_Short          underline_position;
  850.     FT_Short          underline_thickness;
  851.     FT_GlyphSlot      glyph;
  852.     FT_Size           size;
  853.     FT_CharMap        charmap;
  854.     /*@private begin */
  855.     FT_Driver         driver;
  856.     FT_Memory         memory;
  857.     FT_Stream         stream;
  858.     FT_ListRec        sizes_list;
  859.     FT_Generic        autohint;
  860.     void*             extensions;
  861.     FT_Face_Internal  internal;
  862.     /*@private end */
  863.   } FT_FaceRec;
  864.   /*************************************************************************/
  865.   /*                                                                       */
  866.   /* <Enum>                                                                */
  867.   /*    FT_FACE_FLAG_XXX                                                   */
  868.   /*                                                                       */
  869.   /* <Description>                                                         */
  870.   /*    A list of bit flags used in the `face_flags' field of the          */
  871.   /*    @FT_FaceRec structure.  They inform client applications of         */
  872.   /*    properties of the corresponding face.                              */
  873.   /*                                                                       */
  874.   /* <Values>                                                              */
  875.   /*    FT_FACE_FLAG_SCALABLE ::                                           */
  876.   /*      Indicates that the face contains outline glyphs.  This doesn't   */
  877.   /*      prevent bitmap strikes, i.e., a face can have both this and      */
  878.   /*      and @FT_FACE_FLAG_FIXED_SIZES set.                               */
  879.   /*                                                                       */
  880.   /*    FT_FACE_FLAG_FIXED_SIZES ::                                        */
  881.   /*      Indicates that the face contains bitmap strikes.  See also the   */
  882.   /*      `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec.   */
  883.   /*                                                                       */
  884.   /*    FT_FACE_FLAG_FIXED_WIDTH ::                                        */
  885.   /*      Indicates that the face contains fixed-width characters (like    */
  886.   /*      Courier, Lucido, MonoType, etc.).                                */
  887.   /*                                                                       */
  888.   /*    FT_FACE_FLAG_SFNT ::                                               */
  889.   /*      Indicates that the face uses the `sfnt' storage scheme.  For     */
  890.   /*      now, this means TrueType and OpenType.                           */
  891.   /*                                                                       */
  892.   /*    FT_FACE_FLAG_HORIZONTAL ::                                         */
  893.   /*      Indicates that the face contains horizontal glyph metrics.  This */
  894.   /*      should be set for all common formats.                            */
  895.   /*                                                                       */
  896.   /*    FT_FACE_FLAG_VERTICAL ::                                           */
  897.   /*      Indicates that the face contains vertical glyph metrics.  This   */
  898.   /*      is only available in some formats, not all of them.              */
  899.   /*                                                                       */
  900.   /*    FT_FACE_FLAG_KERNING ::                                            */
  901.   /*      Indicates that the face contains kerning information.  If set,   */
  902.   /*      the kerning distance can be retrieved through the function       */
  903.   /*      @FT_Get_Kerning.  Otherwise the function always return the       */
  904.   /*      vector (0,0).  Note that FreeType doesn't handle kerning data    */
  905.   /*      from the `GPOS' table (as present in some OpenType fonts).       */
  906.   /*                                                                       */
  907.   /*    FT_FACE_FLAG_FAST_GLYPHS ::                                        */
  908.   /*      THIS FLAG IS DEPRECATED.  DO NOT USE OR TEST IT.                 */
  909.   /*                                                                       */
  910.   /*    FT_FACE_FLAG_MULTIPLE_MASTERS ::                                   */
  911.   /*      Indicates that the font contains multiple masters and is capable */
  912.   /*      of interpolating between them.  See the multiple-masters         */
  913.   /*      specific API for details.                                        */
  914.   /*                                                                       */
  915.   /*    FT_FACE_FLAG_GLYPH_NAMES ::                                        */
  916.   /*      Indicates that the font contains glyph names that can be         */
  917.   /*      retrieved through @FT_Get_Glyph_Name.  Note that some TrueType   */
  918.   /*      fonts contain broken glyph name tables.  Use the function        */
  919.   /*      @FT_Has_PS_Glyph_Names when needed.                              */
  920.   /*                                                                       */
  921.   /*    FT_FACE_FLAG_EXTERNAL_STREAM ::                                    */
  922.   /*      Used internally by FreeType to indicate that a face's stream was */
  923.   /*      provided by the client application and should not be destroyed   */
  924.   /*      when @FT_Done_Face is called.  Don't read or test this flag.     */
  925.   /*                                                                       */
  926.   /*    FT_FACE_FLAG_HINTER ::                                             */
  927.   /*      Set if the font driver has a hinting machine of its own.  For    */
  928.   /*      example, with TrueType fonts, it makes sense to use data from    */
  929.   /*      the SFNT `gasp' table only if the native TrueType hinting engine */
  930.   /*      (with the bytecode interpreter) is available and active.         */
  931.   /*                                                                       */
  932. #define FT_FACE_FLAG_SCALABLE          ( 1L <<  0 )
  933. #define FT_FACE_FLAG_FIXED_SIZES       ( 1L <<  1 )
  934. #define FT_FACE_FLAG_FIXED_WIDTH       ( 1L <<  2 )
  935. #define FT_FACE_FLAG_SFNT              ( 1L <<  3 )
  936. #define FT_FACE_FLAG_HORIZONTAL        ( 1L <<  4 )
  937. #define FT_FACE_FLAG_VERTICAL          ( 1L <<  5 )
  938. #define FT_FACE_FLAG_KERNING           ( 1L <<  6 )
  939. #define FT_FACE_FLAG_FAST_GLYPHS       ( 1L <<  7 )
  940. #define FT_FACE_FLAG_MULTIPLE_MASTERS  ( 1L <<  8 )
  941. #define FT_FACE_FLAG_GLYPH_NAMES       ( 1L <<  9 )
  942. #define FT_FACE_FLAG_EXTERNAL_STREAM   ( 1L << 10 )
  943. #define FT_FACE_FLAG_HINTER            ( 1L << 11 )
  944.   /* */
  945.   /*************************************************************************
  946.    *
  947.    * @macro:
  948.    *   FT_HAS_HORIZONTAL( face )
  949.    *
  950.    * @description:
  951.    *   A macro that returns true whenever a face object contains
  952.    *   horizontal metrics (this is true for all font formats though).
  953.    *
  954.    * @also:
  955.    *   @FT_HAS_VERTICAL can be used to check for vertical metrics.
  956.    *
  957.    */
  958. #define FT_HAS_HORIZONTAL( face ) 
  959.           ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
  960.   /*************************************************************************
  961.    *
  962.    * @macro:
  963.    *   FT_HAS_VERTICAL( face )
  964.    *
  965.    * @description:
  966.    *   A macro that returns true whenever a face object contains vertical
  967.    *   metrics.
  968.    *
  969.    */
  970. #define FT_HAS_VERTICAL( face ) 
  971.           ( face->face_flags & FT_FACE_FLAG_VERTICAL )
  972.   /*************************************************************************
  973.    *
  974.    * @macro:
  975.    *   FT_HAS_KERNING( face )
  976.    *
  977.    * @description:
  978.    *   A macro that returns true whenever a face object contains kerning
  979.    *   data that can be accessed with @FT_Get_Kerning.
  980.    *
  981.    */
  982. #define FT_HAS_KERNING( face ) 
  983.           ( face->face_flags & FT_FACE_FLAG_KERNING )
  984.   /*************************************************************************
  985.    *
  986.    * @macro:
  987.    *   FT_IS_SCALABLE( face )
  988.    *
  989.    * @description:
  990.    *   A macro that returns true whenever a face object contains a scalable
  991.    *   font face (true for TrueType, Type 1, Type 42, CID, OpenType/CFF,
  992.    *   and PFR font formats.
  993.    *
  994.    */
  995. #define FT_IS_SCALABLE( face ) 
  996.           ( face->face_flags & FT_FACE_FLAG_SCALABLE )
  997.   /*************************************************************************
  998.    *
  999.    * @macro:
  1000.    *   FT_IS_SFNT( face )
  1001.    *
  1002.    * @description:
  1003.    *   A macro that returns true whenever a face object contains a font
  1004.    *   whose format is based on the SFNT storage scheme.  This usually
  1005.    *   means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded
  1006.    *   bitmap fonts.
  1007.    *
  1008.    *   If this macro is true, all functions defined in @FT_SFNT_NAMES_H and
  1009.    *   @FT_TRUETYPE_TABLES_H are available.
  1010.    *
  1011.    */
  1012. #define FT_IS_SFNT( face ) 
  1013.           ( face->face_flags & FT_FACE_FLAG_SFNT )
  1014.   /*************************************************************************
  1015.    *
  1016.    * @macro:
  1017.    *   FT_IS_FIXED_WIDTH( face )
  1018.    *
  1019.    * @description:
  1020.    *   A macro that returns true whenever a face object contains a font face
  1021.    *   that contains fixed-width (or `monospace', `fixed-pitch', etc.)
  1022.    *   glyphs.
  1023.    *
  1024.    */
  1025. #define FT_IS_FIXED_WIDTH( face ) 
  1026.           ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
  1027.   /*************************************************************************
  1028.    *
  1029.    * @macro:
  1030.    *   FT_HAS_FIXED_SIZES( face )
  1031.    *
  1032.    * @description:
  1033.    *   A macro that returns true whenever a face object contains some
  1034.    *   embedded bitmaps.  See the `available_sizes' field of the
  1035.    *   @FT_FaceRec structure.
  1036.    *
  1037.    */
  1038. #define FT_HAS_FIXED_SIZES( face ) 
  1039.           ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
  1040.   /* */
  1041.   /*************************************************************************
  1042.    *
  1043.    * @macro:
  1044.    *   FT_HAS_FAST_GLYPHS( face )
  1045.    *
  1046.    * @description:
  1047.    *   Deprecated.
  1048.    *
  1049.    */
  1050. #define FT_HAS_FAST_GLYPHS( face )  0
  1051.   /*************************************************************************
  1052.    *
  1053.    * @macro:
  1054.    *   FT_HAS_GLYPH_NAMES( face )
  1055.    *
  1056.    * @description:
  1057.    *   A macro that returns true whenever a face object contains some glyph
  1058.    *   names that can be accessed through @FT_Get_Glyph_Name.
  1059.    *
  1060.    */
  1061. #define FT_HAS_GLYPH_NAMES( face ) 
  1062.           ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
  1063.   /*************************************************************************
  1064.    *
  1065.    * @macro:
  1066.    *   FT_HAS_MULTIPLE_MASTERS( face )
  1067.    *
  1068.    * @description:
  1069.    *   A macro that returns true whenever a face object contains some
  1070.    *   multiple masters.  The functions provided by @FT_MULTIPLE_MASTERS_H
  1071.    *   are then available to choose the exact design you want.
  1072.    *
  1073.    */
  1074. #define FT_HAS_MULTIPLE_MASTERS( face ) 
  1075.           ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
  1076.   /*************************************************************************/
  1077.   /*                                                                       */
  1078.   /* <Constant>                                                            */
  1079.   /*    FT_STYLE_FLAG_XXX                                                  */
  1080.   /*                                                                       */
  1081.   /* <Description>                                                         */
  1082.   /*    A list of bit-flags used to indicate the style of a given face.    */
  1083.   /*    These are used in the `style_flags' field of @FT_FaceRec.          */
  1084.   /*                                                                       */
  1085.   /* <Values>                                                              */
  1086.   /*    FT_STYLE_FLAG_ITALIC ::                                            */
  1087.   /*      Indicates that a given face is italicized.                       */
  1088.   /*                                                                       */
  1089.   /*    FT_STYLE_FLAG_BOLD ::                                              */
  1090.   /*      Indicates that a given face is bold.                             */
  1091.   /*                                                                       */
  1092. #define FT_STYLE_FLAG_ITALIC  ( 1 << 0 )
  1093. #define FT_STYLE_FLAG_BOLD    ( 1 << 1 )
  1094.   /*************************************************************************/
  1095.   /*                                                                       */
  1096.   /* <Type>                                                                */
  1097.   /*    FT_Size_Internal                                                   */
  1098.   /*                                                                       */
  1099.   /* <Description>                                                         */
  1100.   /*    An opaque handle to an `FT_Size_InternalRec' structure, used to    */
  1101.   /*    model private data of a given FT_Size object.                      */
  1102.   /*                                                                       */
  1103.   typedef struct FT_Size_InternalRec_*  FT_Size_Internal;
  1104.   /*************************************************************************/
  1105.   /*                                                                       */
  1106.   /* <Struct>                                                              */
  1107.   /*    FT_Size_Metrics                                                    */
  1108.   /*                                                                       */
  1109.   /* <Description>                                                         */
  1110.   /*    The size metrics structure gives the metrics of a size object.     */
  1111.   /*                                                                       */
  1112.   /* <Fields>                                                              */
  1113.   /*    x_ppem       :: The width of the scaled EM square in pixels, hence */
  1114.   /*                    the term `ppem' (pixels per EM).  It is also       */
  1115.   /*                    referred to as `nominal width'.                    */
  1116.   /*                                                                       */
  1117.   /*    y_ppem       :: The height of the scaled EM square in pixels,      */
  1118.   /*                    hence the term `ppem' (pixels per EM).  It is also */
  1119.   /*                    referred to as `nominal height'.                   */
  1120.   /*                                                                       */
  1121.   /*    x_scale      :: A 16.16 fractional scaling value used to convert   */
  1122.   /*                    horizontal metrics from font units to 26.6         */
  1123.   /*                    fractional pixels.  Only relevant for scalable     */
  1124.   /*                    font formats.                                      */
  1125.   /*                                                                       */
  1126.   /*    y_scale      :: A 16.16 fractional scaling value used to convert   */
  1127.   /*                    vertical metrics from font units to 26.6           */
  1128.   /*                    fractional pixels.  Only relevant for scalable     */
  1129.   /*                    font formats.                                      */
  1130.   /*                                                                       */
  1131.   /*    ascender     :: The ascender in 26.6 fractional pixels.  See       */
  1132.   /*                    @FT_FaceRec for the details.                       */
  1133.   /*                                                                       */
  1134.   /*    descender    :: The descender in 26.6 fractional pixels.  See      */
  1135.   /*                    @FT_FaceRec for the details.                       */
  1136.   /*                                                                       */
  1137.   /*    height       :: The height in 26.6 fractional pixels.  See         */
  1138.   /*                    @FT_FaceRec for the details.                       */
  1139.   /*                                                                       */
  1140.   /*    max_advance  :: The maximal advance width in 26.6 fractional       */
  1141.   /*                    pixels.  See @FT_FaceRec for the details.          */
  1142.   /*                                                                       */
  1143.   /* <Note>                                                                */
  1144.   /*    The scaling values, if relevant, are determined first during a     */
  1145.   /*    size changing operation.  The remaining fields are then set by the */
  1146.   /*    driver.  For scalable formats, they are usually set to scaled      */
  1147.   /*    values of the corresponding fields in @FT_FaceRec.                 */
  1148.   /*                                                                       */
  1149.   /*    Note that due to glyph hinting, these values might not be exact    */
  1150.   /*    for certain fonts.  Thus they must be treated as unreliable        */
  1151.   /*    with an error margin of at least one pixel!                        */
  1152.   /*                                                                       */
  1153.   /*    Indeed, the only way to get the exact metrics is to render _all_   */
  1154.   /*    glyphs.  As this would be a definite performance hit, it is up to  */
  1155.   /*    client applications to perform such computations.                  */
  1156.   /*                                                                       */
  1157.   /*    The FT_Size_Metrics structure is valid for bitmap fonts also.      */
  1158.   /*                                                                       */
  1159.   typedef struct  FT_Size_Metrics_
  1160.   {
  1161.     FT_UShort  x_ppem;      /* horizontal pixels per EM               */
  1162.     FT_UShort  y_ppem;      /* vertical pixels per EM                 */
  1163.     FT_Fixed   x_scale;     /* scaling values used to convert font    */
  1164.     FT_Fixed   y_scale;     /* units to 26.6 fractional pixels        */
  1165.     FT_Pos     ascender;    /* ascender in 26.6 frac. pixels          */
  1166.     FT_Pos     descender;   /* descender in 26.6 frac. pixels         */
  1167.     FT_Pos     height;      /* text height in 26.6 frac. pixels       */
  1168.     FT_Pos     max_advance; /* max horizontal advance, in 26.6 pixels */
  1169.   } FT_Size_Metrics;
  1170.   /*************************************************************************/
  1171.   /*                                                                       */
  1172.   /* <Struct>                                                              */
  1173.   /*    FT_SizeRec                                                         */
  1174.   /*                                                                       */
  1175.   /* <Description>                                                         */
  1176.   /*    FreeType root size class structure.  A size object models a face   */
  1177.   /*    object at a given size.                                            */
  1178.   /*                                                                       */
  1179.   /* <Fields>                                                              */
  1180.   /*    face    :: Handle to the parent face object.                       */
  1181.   /*                                                                       */
  1182.   /*    generic :: A typeless pointer, which is unused by the FreeType     */
  1183.   /*               library or any of its drivers.  It can be used by       */
  1184.   /*               client applications to link their own data to each size */
  1185.   /*               object.                                                 */
  1186.   /*                                                                       */
  1187.   /*    metrics :: Metrics for this size object.  This field is read-only. */
  1188.   /*                                                                       */
  1189.   typedef struct  FT_SizeRec_
  1190.   {
  1191.     FT_Face           face;      /* parent face object              */
  1192.     FT_Generic        generic;   /* generic pointer for client uses */
  1193.     FT_Size_Metrics   metrics;   /* size metrics                    */
  1194.     FT_Size_Internal  internal;
  1195.   } FT_SizeRec;
  1196.   /*************************************************************************/
  1197.   /*                                                                       */
  1198.   /* <Struct>                                                              */
  1199.   /*    FT_SubGlyph                                                        */
  1200.   /*                                                                       */
  1201.   /* <Description>                                                         */
  1202.   /*    The subglyph structure is an internal object used to describe      */
  1203.   /*    subglyphs (for example, in the case of composites).                */
  1204.   /*                                                                       */
  1205.   /* <Note>                                                                */
  1206.   /*    The subglyph implementation is not part of the high-level API,     */
  1207.   /*    hence the forward structure declaration.                           */
  1208.   /*                                                                       */
  1209.   /*    You can however retrieve subglyph information with                 */
  1210.   /*    @FT_Get_SubGlyph_Info.                                             */
  1211.   /*                                                                       */
  1212.   typedef struct FT_SubGlyphRec_*  FT_SubGlyph;
  1213.   /*************************************************************************/
  1214.   /*                                                                       */
  1215.   /* <Type>                                                                */
  1216.   /*    FT_Slot_Internal                                                   */
  1217.   /*                                                                       */
  1218.   /* <Description>                                                         */
  1219.   /*    An opaque handle to an `FT_Slot_InternalRec' structure, used to    */
  1220.   /*    model private data of a given FT_GlyphSlot object.                 */
  1221.   /*                                                                       */
  1222.   typedef struct FT_Slot_InternalRec_*  FT_Slot_Internal;
  1223.   /*************************************************************************/
  1224.   /*                                                                       */
  1225.   /* <Struct>                                                              */
  1226.   /*    FT_GlyphSlotRec                                                    */
  1227.   /*                                                                       */
  1228.   /* <Description>                                                         */
  1229.   /*    FreeType root glyph slot class structure.  A glyph slot is a       */
  1230.   /*    container where individual glyphs can be loaded, be they in        */
  1231.   /*    outline or bitmap format.                                          */
  1232.   /*                                                                       */
  1233.   /* <Fields>                                                              */
  1234.   /*    library           :: A handle to the FreeType library instance     */
  1235.   /*                         this slot belongs to.                         */
  1236.   /*                                                                       */
  1237.   /*    face              :: A handle to the parent face object.           */
  1238.   /*                                                                       */
  1239.   /*    next              :: In some cases (like some font tools), several */
  1240.   /*                         glyph slots per face object can be a good     */
  1241.   /*                         thing.  As this is rare, the glyph slots are  */
  1242.   /*                         listed through a direct, single-linked list   */
  1243.   /*                         using its `next' field.                       */
  1244.   /*                                                                       */
  1245.   /*    generic           :: A typeless pointer which is unused by the     */
  1246.   /*                         FreeType library or any of its drivers.  It   */
  1247.   /*                         can be used by client applications to link    */
  1248.   /*                         their own data to each glyph slot object.     */
  1249.   /*                                                                       */
  1250.   /*    metrics           :: The metrics of the last loaded glyph in the   */
  1251.   /*                         slot.  The returned values depend on the last */
  1252.   /*                         load flags (see the @FT_Load_Glyph API        */
  1253.   /*                         function) and can be expressed either in 26.6 */
  1254.   /*                         fractional pixels or font units.              */
  1255.   /*                                                                       */
  1256.   /*                         Note that even when the glyph image is        */
  1257.   /*                         transformed, the metrics are not.             */
  1258.   /*                                                                       */
  1259.   /*    linearHoriAdvance :: The advance width of the unhinted glyph.      */
  1260.   /*                         Its value is expressed in 16.16 fractional    */
  1261.   /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */
  1262.   /*                         when loading the glyph.  This field can be    */
  1263.   /*                         important to perform correct WYSIWYG layout.  */
  1264.   /*                         Only relevant for outline glyphs.             */
  1265.   /*                                                                       */
  1266.   /*    linearVertAdvance :: The advance height of the unhinted glyph.     */
  1267.   /*                         Its value is expressed in 16.16 fractional    */
  1268.   /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */
  1269.   /*                         when loading the glyph.  This field can be    */
  1270.   /*                         important to perform correct WYSIWYG layout.  */
  1271.   /*                         Only relevant for outline glyphs.             */
  1272.   /*                                                                       */
  1273.   /*    advance           :: This is the transformed advance width for the */
  1274.   /*                         glyph.                                        */
  1275.   /*                                                                       */
  1276.   /*    format            :: This field indicates the format of the image  */
  1277.   /*                         contained in the glyph slot.  Typically       */
  1278.   /*                         @FT_GLYPH_FORMAT_BITMAP,                      */
  1279.   /*                         @FT_GLYPH_FORMAT_OUTLINE, or                  */
  1280.   /*                         @FT_GLYPH_FORMAT_COMPOSITE, but others are    */
  1281.   /*                         possible.                                     */
  1282.   /*                                                                       */
  1283.   /*    bitmap            :: This field is used as a bitmap descriptor     */
  1284.   /*                         when the slot format is                       */
  1285.   /*                         @FT_GLYPH_FORMAT_BITMAP.  Note that the       */
  1286.   /*                         address and content of the bitmap buffer can  */
  1287.   /*                         change between calls of @FT_Load_Glyph and a  */
  1288.   /*                         few other functions.                          */
  1289.   /*                                                                       */
  1290.   /*    bitmap_left       :: This is the bitmap's left bearing expressed   */
  1291.   /*                         in integer pixels.  Of course, this is only   */
  1292.   /*                         valid if the format is                        */
  1293.   /*                         @FT_GLYPH_FORMAT_BITMAP.                      */
  1294.   /*                                                                       */
  1295.   /*    bitmap_top        :: This is the bitmap's top bearing expressed in */
  1296.   /*                         integer pixels.  Remember that this is the    */
  1297.   /*                         distance from the baseline to the top-most    */
  1298.   /*                         glyph scanline, upwards y-coordinates being   */
  1299.   /*                         *positive*.                                   */
  1300.   /*                                                                       */
  1301.   /*    outline           :: The outline descriptor for the current glyph  */
  1302.   /*                         image if its format is                        */
  1303.   /*                         @FT_GLYPH_FORMAT_OUTLINE.  Once a glyph is    */
  1304.   /*                         loaded, `outline' can be transformed,         */
  1305.   /*                         distorted, embolded, etc.  However, it must   */
  1306.   /*                         not be freed.                                 */
  1307.   /*                                                                       */
  1308.   /*    num_subglyphs     :: The number of subglyphs in a composite glyph. */
  1309.   /*                         This field is only valid for the composite    */
  1310.   /*                         glyph format that should normally only be     */
  1311.   /*                         loaded with the @FT_LOAD_NO_RECURSE flag.     */
  1312.   /*                         For now this is internal to FreeType.         */
  1313.   /*                                                                       */
  1314.   /*    subglyphs         :: An array of subglyph descriptors for          */
  1315.   /*                         composite glyphs.  There are `num_subglyphs'  */
  1316.   /*                         elements in there.  Currently internal to     */
  1317.   /*                         FreeType.                                     */
  1318.   /*                                                                       */
  1319.   /*    control_data      :: Certain font drivers can also return the      */
  1320.   /*                         control data for a given glyph image (e.g.    */
  1321.   /*                         TrueType bytecode, Type 1 charstrings, etc.). */
  1322.   /*                         This field is a pointer to such data.         */
  1323.   /*                                                                       */
  1324.   /*    control_len       :: This is the length in bytes of the control    */
  1325.   /*                         data.                                         */
  1326.   /*                                                                       */
  1327.   /*    other             :: Really wicked formats can use this pointer to */
  1328.   /*                         present their own glyph image to client       */
  1329.   /*                         applications.  Note that the application      */
  1330.   /*                         needs to know about the image format.         */
  1331.   /*                                                                       */
  1332.   /*    lsb_delta         :: The difference between hinted and unhinted    */
  1333.   /*                         left side bearing while autohinting is        */
  1334.   /*                         active.  Zero otherwise.                      */
  1335.   /*                                                                       */
  1336.   /*    rsb_delta         :: The difference between hinted and unhinted    */
  1337.   /*                         right side bearing while autohinting is       */
  1338.   /*                         active.  Zero otherwise.                      */
  1339.   /*                                                                       */
  1340.   /* <Note>                                                                */
  1341.   /*    If @FT_Load_Glyph is called with default flags (see                */
  1342.   /*    @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in   */
  1343.   /*    its native format (e.g., an outline glyph for TrueType and Type 1  */
  1344.   /*    formats).                                                          */
  1345.   /*                                                                       */
  1346.   /*    This image can later be converted into a bitmap by calling         */
  1347.   /*    @FT_Render_Glyph.  This function finds the current renderer for    */
  1348.   /*    the native image's format then invokes it.                         */
  1349.   /*                                                                       */
  1350.   /*    The renderer is in charge of transforming the native image through */
  1351.   /*    the slot's face transformation fields, then convert it into a      */
  1352.   /*    bitmap that is returned in `slot->bitmap'.                         */
  1353.   /*                                                                       */
  1354.   /*    Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */
  1355.   /*    to specify the position of the bitmap relative to the current pen  */
  1356.   /*    position (e.g., coordinates (0,0) on the baseline).  Of course,    */
  1357.   /*    `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP.         */
  1358.   /*                                                                       */
  1359.   /* <Note>                                                                */
  1360.   /*    Here a small pseudo code fragment which shows how to use           */
  1361.   /*    `lsb_delta' and `rsb_delta':                                       */
  1362.   /*                                                                       */
  1363.   /*    {                                                                  */
  1364.   /*      FT_Pos  origin_x       = 0;                                      */
  1365.   /*      FT_Pos  prev_rsb_delta = 0;                                      */
  1366.   /*                                                                       */
  1367.   /*                                                                       */
  1368.   /*      for all glyphs do                                                */
  1369.   /*        <compute kern between current and previous glyph and add it to */
  1370.   /*         `origin_x'>                                                   */
  1371.   /*                                                                       */
  1372.   /*        <load glyph with `FT_Load_Glyph'>                              */
  1373.   /*                                                                       */
  1374.   /*        if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 )           */
  1375.   /*          origin_x -= 64;                                              */
  1376.   /*        else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 )      */
  1377.   /*          origin_x += 64;                                              */
  1378.   /*                                                                       */
  1379.   /*        prev_rsb_delta = face->glyph->rsb_delta;                       */
  1380.   /*                                                                       */
  1381.   /*        <save glyph image, or render glyph, or ...>                    */
  1382.   /*                                                                       */
  1383.   /*        origin_x += face->glyph->advance.x;                            */
  1384.   /*      endfor                                                           */
  1385.   /*    }                                                                  */
  1386.   /*                                                                       */
  1387.   typedef struct  FT_GlyphSlotRec_
  1388.   {
  1389.     FT_Library        library;
  1390.     FT_Face           face;
  1391.     FT_GlyphSlot      next;
  1392.     FT_UInt           reserved;       /* retained for binary compatibility */
  1393.     FT_Generic        generic;
  1394.     FT_Glyph_Metrics  metrics;
  1395.     FT_Fixed          linearHoriAdvance;
  1396.     FT_Fixed          linearVertAdvance;
  1397.     FT_Vector         advance;
  1398.     FT_Glyph_Format   format;
  1399.     FT_Bitmap         bitmap;
  1400.     FT_Int            bitmap_left;
  1401.     FT_Int            bitmap_top;
  1402.     FT_Outline        outline;
  1403.     FT_UInt           num_subglyphs;
  1404.     FT_SubGlyph       subglyphs;
  1405.     void*             control_data;
  1406.     long              control_len;
  1407.     FT_Pos            lsb_delta;
  1408.     FT_Pos            rsb_delta;
  1409.     void*             other;
  1410.     FT_Slot_Internal  internal;
  1411.   } FT_GlyphSlotRec;
  1412.   /*************************************************************************/
  1413.   /*************************************************************************/
  1414.   /*                                                                       */
  1415.   /*                         F U N C T I O N S                             */
  1416.   /*                                                                       */
  1417.   /*************************************************************************/
  1418.   /*************************************************************************/
  1419.   /*************************************************************************/
  1420.   /*                                                                       */
  1421.   /* <Function>                                                            */
  1422.   /*    FT_Init_FreeType                                                   */
  1423.   /*                                                                       */
  1424.   /* <Description>                                                         */
  1425.   /*    Initialize a new FreeType library object.  The set of modules      */
  1426.   /*    that are registered by this function is determined at build time.  */
  1427.   /*                                                                       */
  1428.   /* <Output>                                                              */
  1429.   /*    alibrary :: A handle to a new library object.                      */
  1430.   /*                                                                       */
  1431.   /* <Return>                                                              */
  1432.   /*    FreeType error code.  0 means success.                             */
  1433.   /*                                                                       */
  1434.   FT_EXPORT( FT_Error )
  1435.   FT_Init_FreeType( FT_Library  *alibrary );
  1436.   /*************************************************************************/
  1437.   /*                                                                       */
  1438.   /* <Function>                                                            */
  1439.   /*    FT_Done_FreeType                                                   */
  1440.   /*                                                                       */
  1441.   /* <Description>                                                         */
  1442.   /*    Destroy a given FreeType library object and all of its children,   */
  1443.   /*    including resources, drivers, faces, sizes, etc.                   */
  1444.   /*                                                                       */
  1445.   /* <Input>                                                               */
  1446.   /*    library :: A handle to the target library object.                  */
  1447.   /*                                                                       */
  1448.   /* <Return>                                                              */
  1449.   /*    FreeType error code.  0 means success.                             */
  1450.   /*                                                                       */
  1451.   FT_EXPORT( FT_Error )
  1452.   FT_Done_FreeType( FT_Library  library );
  1453.   /*************************************************************************/
  1454.   /*                                                                       */
  1455.   /* <Enum>                                                                */
  1456.   /*    FT_OPEN_XXX                                                        */
  1457.   /*                                                                       */
  1458.   /* <Description>                                                         */
  1459.   /*    A list of bit-field constants used within the `flags' field of the */
  1460.   /*    @FT_Open_Args structure.                                           */
  1461.   /*                                                                       */
  1462.   /* <Values>                                                              */
  1463.   /*    FT_OPEN_MEMORY      :: This is a memory-based stream.              */
  1464.   /*                                                                       */
  1465.   /*    FT_OPEN_STREAM      :: Copy the stream from the `stream' field.    */
  1466.   /*                                                                       */
  1467.   /*    FT_OPEN_PATHNAME    :: Create a new input stream from a C          */
  1468.   /*                           path name.                                  */
  1469.   /*                                                                       */
  1470.   /*    FT_OPEN_DRIVER      :: Use the `driver' field.                     */
  1471.   /*                                                                       */
  1472.   /*    FT_OPEN_PARAMS      :: Use the `num_params' and `params' fields.   */
  1473.   /*                                                                       */
  1474.   /*    ft_open_memory      :: Deprecated; use @FT_OPEN_MEMORY instead.    */
  1475.   /*                                                                       */
  1476.   /*    ft_open_stream      :: Deprecated; use @FT_OPEN_STREAM instead.    */
  1477.   /*                                                                       */
  1478.   /*    ft_open_pathname    :: Deprecated; use @FT_OPEN_PATHNAME instead.  */
  1479.   /*                                                                       */
  1480.   /*    ft_open_driver      :: Deprecated; use @FT_OPEN_DRIVER instead.    */
  1481.   /*                                                                       */
  1482.   /*    ft_open_params      :: Deprecated; use @FT_OPEN_PARAMS instead.    */
  1483.   /*                                                                       */
  1484.   /* <Note>                                                                */
  1485.   /*    The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME'     */
  1486.   /*    flags are mutually exclusive.                                      */
  1487.   /*                                                                       */
  1488. #define FT_OPEN_MEMORY    0x1
  1489. #define FT_OPEN_STREAM    0x2
  1490. #define FT_OPEN_PATHNAME  0x4
  1491. #define FT_OPEN_DRIVER    0x8
  1492. #define FT_OPEN_PARAMS    0x10
  1493. #define ft_open_memory    FT_OPEN_MEMORY     /* deprecated */
  1494. #define ft_open_stream    FT_OPEN_STREAM     /* deprecated */
  1495. #define ft_open_pathname  FT_OPEN_PATHNAME   /* deprecated */
  1496. #define ft_open_driver    FT_OPEN_DRIVER     /* deprecated */
  1497. #define ft_open_params    FT_OPEN_PARAMS     /* deprecated */
  1498.   /*************************************************************************/
  1499.   /*                                                                       */
  1500.   /* <Struct>                                                              */
  1501.   /*    FT_Parameter                                                       */
  1502.   /*                                                                       */
  1503.   /* <Description>                                                         */
  1504.   /*    A simple structure used to pass more or less generic parameters    */
  1505.   /*    to @FT_Open_Face.                                                  */
  1506.   /*                                                                       */
  1507.   /* <Fields>                                                              */
  1508.   /*    tag  :: A four-byte identification tag.                            */
  1509.   /*                                                                       */
  1510.   /*    data :: A pointer to the parameter data.                           */
  1511.   /*                                                                       */
  1512.   /* <Note>                                                                */
  1513.   /*    The ID and function of parameters are driver-specific.             */
  1514.   /*                                                                       */
  1515.   typedef struct  FT_Parameter_
  1516.   {
  1517.     FT_ULong    tag;
  1518.     FT_Pointer  data;
  1519.   } FT_Parameter;
  1520.   /*************************************************************************/
  1521.   /*                                                                       */
  1522.   /* <Struct>                                                              */
  1523.   /*    FT_Open_Args                                                       */
  1524.   /*                                                                       */
  1525.   /* <Description>                                                         */
  1526.   /*    A structure used to indicate how to open a new font file or        */
  1527.   /*    stream.  A pointer to such a structure can be used as a parameter  */
  1528.   /*    for the functions @FT_Open_Face and @FT_Attach_Stream.             */
  1529.   /*                                                                       */
  1530.   /* <Fields>                                                              */
  1531.   /*    flags       :: A set of bit flags indicating how to use the        */
  1532.   /*                   structure.                                          */
  1533.   /*                                                                       */
  1534.   /*    memory_base :: The first byte of the file in memory.               */
  1535.   /*                                                                       */
  1536.   /*    memory_size :: The size in bytes of the file in memory.            */
  1537.   /*                                                                       */
  1538.   /*    pathname    :: A pointer to an 8-bit file pathname.                */
  1539.   /*                                                                       */
  1540.   /*    stream      :: A handle to a source stream object.                 */
  1541.   /*                                                                       */
  1542.   /*    driver      :: This field is exclusively used by @FT_Open_Face;    */
  1543.   /*                   it simply specifies the font driver to use to open  */
  1544.   /*                   the face.  If set to 0, FreeType tries to load the  */
  1545.   /*                   face with each one of the drivers in its list.      */
  1546.   /*                                                                       */
  1547.   /*    num_params  :: The number of extra parameters.                     */
  1548.   /*                                                                       */
  1549.   /*    params      :: Extra parameters passed to the font driver when     */
  1550.   /*                   opening a new face.                                 */
  1551.   /*                                                                       */
  1552.   /* <Note>                                                                */
  1553.   /*    The stream type is determined by the contents of `flags' which     */
  1554.   /*    are tested in the following order by @FT_Open_Face:                */
  1555.   /*                                                                       */
  1556.   /*    If the `FT_OPEN_MEMORY' bit is set, assume that this is a          */
  1557.   /*    memory file of `memory_size' bytes, located at `memory_address'.   */
  1558.   /*    The data are are not copied, and the client is responsible for     */
  1559.   /*    releasing and destroying them _after_ the corresponding call to    */
  1560.   /*    @FT_Done_Face.                                                     */
  1561.   /*                                                                       */
  1562.   /*    Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a       */
  1563.   /*    custom input stream `stream' is used.                              */
  1564.   /*                                                                       */