Charles.Forsyth20060303a828770d19 years agoHistory
2860 lines · 181.5 KB · C
RawDownload
/***************************************************************************//*                                                                         *//*  freetype.h                                                             *//*                                                                         *//*    FreeType high-level API and common types (specification only).       *//*                                                                         *//*  Copyright 1996-2001, 2002 by                                           *//*  David Turner, Robert Wilhelm, and Werner Lemberg.                      *//*                                                                         *//*  This file is part of the FreeType project, and may only be used,       *//*  modified, and distributed under the terms of the FreeType project      *//*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     *//*  this file you indicate that you have read the license and              *//*  understand and accept it fully.                                        *//*                                                                         *//***************************************************************************/  #ifndef __FREETYPE_H__#define __FREETYPE_H__#pragma incomplete _off_	/* it's too hard */    /*************************************************************************/  /*                                                                       */  /* The `raster' component duplicates some of the declarations in         */  /* freetype.h for stand-alone use if _FREETYPE_ isn't defined.           */  /*                                                                       */    /*************************************************************************/  /*                                                                       */  /* The FREETYPE_MAJOR and FREETYPE_MINOR macros are used to version the  */  /* new FreeType design, which is able to host several kinds of font      */  /* drivers.  It starts at 2.0.                                           */  /*                                                                       */#define FREETYPE_MAJOR 2#define FREETYPE_MINOR 1#define FREETYPE_PATCH 3  #include <ft2build.h>#include FT_CONFIG_CONFIG_H#include FT_ERRORS_H#include FT_TYPES_H  FT_BEGIN_HEADER    /*************************************************************************/  /*************************************************************************/  /*                                                                       */  /*                        B A S I C   T Y P E S                          */  /*                                                                       */  /*************************************************************************/  /*************************************************************************/    /*************************************************************************/  /*                                                                       */  /* <Section>                                                             */  /*    base_interface                                                     */  /*                                                                       */  /* <Title>                                                               */  /*    Base Interface                                                     */  /*                                                                       */  /* <Abstract>                                                            */  /*    The FreeType 2 base font interface.                                */  /*                                                                       */  /* <Description>                                                         */  /*    This section describes the public high-level API of FreeType 2.    */  /*                                                                       */  /* <Order>                                                               */  /*    FT_Library                                                         */  /*    FT_Face                                                            */  /*    FT_Size                                                            */  /*    FT_GlyphSlot                                                       */  /*    FT_CharMap                                                         */  /*    FT_Encoding                                                        */  /*                                                                       */  /*    FT_FaceRec                                                         */  /*                                                                       */  /*    FT_FACE_FLAG_SCALABLE                                              */  /*    FT_FACE_FLAG_FIXED_SIZES                                           */  /*    FT_FACE_FLAG_FIXED_WIDTH                                           */  /*    FT_FACE_FLAG_HORIZONTAL                                            */  /*    FT_FACE_FLAG_VERTICAL                                              */  /*    FT_FACE_FLAG_SFNT                                                  */  /*    FT_FACE_FLAG_KERNING                                               */  /*    FT_FACE_FLAG_MULTIPLE_MASTERS                                      */  /*    FT_FACE_FLAG_GLYPH_NAMES                                           */  /*    FT_FACE_FLAG_EXTERNAL_STREAM                                       */  /*    FT_FACE_FLAG_FAST_GLYPHS                                           */  /*                                                                       */  /*    FT_STYLE_FLAG_BOLD                                                 */  /*    FT_STYLE_FLAG_ITALIC                                               */  /*                                                                       */  /*    FT_SizeRec                                                         */  /*    FT_Size_Metrics                                                    */  /*                                                                       */  /*    FT_GlyphSlotRec                                                    */  /*    FT_Glyph_Metrics                                                   */  /*    FT_SubGlyph                                                        */  /*                                                                       */  /*    FT_Bitmap_Size                                                     */  /*                                                                       */  /*    FT_Init_FreeType                                                   */  /*    FT_Done_FreeType                                                   */  /*    FT_Library_Version                                                 */  /*                                                                       */  /*    FT_New_Face                                                        */  /*    FT_Done_Face                                                       */  /*    FT_New_Memory_Face                                                 */  /*    FT_Open_Face                                                       */  /*    FT_Open_Args                                                       */  /*    FT_Open_Flags                                                      */  /*    FT_Parameter                                                       */  /*    FT_Attach_File                                                     */  /*    FT_Attach_Stream                                                   */  /*                                                                       */  /*    FT_Set_Char_Size                                                   */  /*    FT_Set_Pixel_Sizes                                                 */  /*    FT_Set_Transform                                                   */  /*    FT_Load_Glyph                                                      */  /*    FT_Get_Char_Index                                                  */  /*    FT_Get_Name_Index                                                  */  /*    FT_Load_Char                                                       */  /*                                                                       */  /*    FT_LOAD_DEFAULT                                                    */  /*    FT_LOAD_RENDER                                                     */  /*    FT_LOAD_MONOCHROME                                                 */  /*    FT_LOAD_LINEAR_DESIGN                                              */  /*    FT_LOAD_NO_SCALE                                                   */  /*    FT_LOAD_NO_HINTING                                                 */  /*    FT_LOAD_NO_BITMAP                                                  */  /*    FT_LOAD_CROP_BITMAP                                                */  /*                                                                       */  /*    FT_LOAD_VERTICAL_LAYOUT                                            */  /*    FT_LOAD_IGNORE_TRANSFORM                                           */  /*    FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH                                */  /*    FT_LOAD_FORCE_AUTOHINT                                             */  /*    FT_LOAD_NO_RECURSE                                                 */  /*    FT_LOAD_PEDANTIC                                                   */  /*                                                                       */  /*    FT_Render_Glyph                                                    */  /*    FT_Render_Mode                                                     */  /*    FT_Get_Kerning                                                     */  /*    FT_Kerning_Mode                                                    */  /*    FT_Get_Glyph_Name                                                  */  /*    FT_Get_Postscript_Name                                             */  /*                                                                       */  /*    FT_CharMapRec                                                      */  /*    FT_Select_Charmap                                                  */  /*    FT_Set_Charmap                                                     */  /*                                                                       */  /*************************************************************************/    /*************************************************************************/  /*                                                                       */  /* <Struct>                                                              */  /*    FT_Glyph_Metrics                                                   */  /*                                                                       */  /* <Description>                                                         */  /*    A structure used to model the metrics of a single glyph.  Note     */  /*    that values are expressed in 26.6 fractional pixel format or in    */  /*    font units, depending on context.                                  */  /*                                                                       */  /* <Fields>                                                              */  /*    width        :: The glyph's width.                                 */  /*                                                                       */  /*    height       :: The glyph's height.                                */  /*                                                                       */  /*    horiBearingX :: Horizontal left side bearing.                      */  /*                                                                       */  /*    horiBearingY :: Horizontal top side bearing.                       */  /*                                                                       */  /*    horiAdvance  :: Horizontal advance width.                          */  /*                                                                       */  /*    vertBearingX :: Vertical left side bearing.                        */  /*                                                                       */  /*    vertBearingY :: Vertical top side bearing.                         */  /*                                                                       */  /*    vertAdvance  :: Vertical advance height.                           */  /*                                                                       */  typedef struct  FT_Glyph_Metrics_  {    FT_Pos  width;         /* glyph width  */    FT_Pos  height;        /* glyph height */     FT_Pos  horiBearingX;  /* left side bearing in horizontal layouts */    FT_Pos  horiBearingY;  /* top side bearing in horizontal layouts  */    FT_Pos  horiAdvance;   /* advance width for horizontal layout     */     FT_Pos  vertBearingX;  /* left side bearing in vertical layouts */    FT_Pos  vertBearingY;  /* top side bearing in vertical layouts  */    FT_Pos  vertAdvance;   /* advance height for vertical layout    */   } FT_Glyph_Metrics;    /*************************************************************************/  /*                                                                       */  /* <Struct>                                                              */  /*    FT_Bitmap_Size                                                     */  /*                                                                       */  /* <Description>                                                         */  /*    An extremely simple structure used to model the size of a bitmap   */  /*    strike (i.e., a bitmap instance of the font for a given            */  /*    resolution) in a fixed-size font face.  This is used for the       */  /*    `available_sizes' field of the FT_Face_Properties structure.       */  /*                                                                       */  /* <Fields>                                                              */  /*    height :: The character height in pixels.                          */  /*                                                                       */  /*    width  :: The character width in pixels.                           */  /*                                                                       */  typedef struct  FT_Bitmap_Size_  {    FT_Short  height;    FT_Short  width;   } FT_Bitmap_Size;    /*************************************************************************/  /*************************************************************************/  /*                                                                       */  /*                     O B J E C T   C L A S S E S                       */  /*                                                                       */  /*************************************************************************/  /*************************************************************************/   /*************************************************************************/  /*                                                                       */  /* <Type>                                                                */  /*    FT_Library                                                         */  /*                                                                       */  /* <Description>                                                         */  /*    A handle to a FreeType library instance.  Each `library' is        */  /*    completely independent from the others; it is the `root' of a set  */  /*    of objects like fonts, faces, sizes, etc.                          */  /*                                                                       */  /*    It also embeds a memory manager (see @FT_Memory), as well as a     */  /*    scan-line converter object (see @FT_Raster).                       */  /*                                                                       */  /* <Note>                                                                */  /*    Library objects are normally created by @FT_Init_FreeType, and     */  /*    destroyed with @FT_Done_FreeType.                                  */  /*                                                                       */  typedef struct FT_LibraryRec_  *FT_Library;    /*************************************************************************/  /*                                                                       */  /* <Type>                                                                */  /*    FT_Module                                                          */  /*                                                                       */  /* <Description>                                                         */  /*    A handle to a given FreeType module object.  Each module can be a  */  /*    font driver, a renderer, or anything else that provides services   */  /*    to the formers.                                                    */  /*                                                                       */  typedef struct FT_ModuleRec_*  FT_Module;    /*************************************************************************/  /*                                                                       */  /* <Type>                                                                */  /*    FT_Driver                                                          */  /*                                                                       */  /* <Description>                                                         */  /*    A handle to a given FreeType font driver object.  Each font driver */  /*    is a special module capable of creating faces from font files.     */  /*                                                                       */  typedef struct FT_DriverRec_*  FT_Driver;    /*************************************************************************/  /*                                                                       */  /* <Type>                                                                */  /*    FT_Renderer                                                        */  /*                                                                       */  /* <Description>                                                         */  /*    A handle to a given FreeType renderer.  A renderer is a special    */  /*    module in charge of converting a glyph image to a bitmap, when     */  /*    necessary.  Each renderer supports a given glyph image format, and */  /*    one or more target surface depths.                                 */  /*                                                                       */  typedef struct FT_RendererRec_*  FT_Renderer;    /*************************************************************************/  /*                                                                       */  /* <Type>                                                                */  /*    FT_Face                                                            */  /*                                                                       */  /* <Description>                                                         */  /*    A handle to a given typographic face object.  A face object models */  /*    a given typeface, in a given style.                                */  /*                                                                       */  /* <Note>                                                                */  /*    Each face object also owns a single @FT_GlyphSlot object, as well  */  /*    as one or more @FT_Size objects.                                   */  /*                                                                       */  /*    Use @FT_New_Face or @FT_Open_Face to create a new face object from */  /*    a given filepathname or a custom input stream.                     */  /*                                                                       */  /*    Use @FT_Done_Face to destroy it (along with its slot and sizes).   */  /*                                                                       */  /* <Also>                                                                */  /*    The @FT_FaceRec details the publicly accessible fields of a given  */  /*    face object.                                                       */  /*                                                                       */  typedef struct FT_FaceRec_*  FT_Face;    /*************************************************************************/  /*                                                                       */  /* <Type>                                                                */  /*    FT_Size                                                            */  /*                                                                       */  /* <Description>                                                         */  /*    A handle to a given size object.  Such an object models the data   */  /*    that depends on the current _resolution_ and _character size_ in a */  /*    given @FT_Face.                                                    */  /*                                                                       */  /* <Note>                                                                */  /*    Each face object owns one or more sizes.  There is however a       */  /*    single _active_ size for the face at any time that will be used by */  /*    functions like @FT_Load_Glyph, @FT_Get_Kerning, etc.               */  /*                                                                       */  /*    You can use the @FT_Activate_Size API to change the current        */  /*    active size of any given face.                                     */  /*                                                                       */  /* <Also>                                                                */  /*    The @FT_SizeRec structure details the publicly accessible fields   */  /*    of a given face object.                                            */  /*                                                                       */  typedef struct FT_SizeRec_*  FT_Size;    /*************************************************************************/  /*                                                                       */  /* <Type>                                                                */  /*    FT_GlyphSlot                                                       */  /*                                                                       */  /* <Description>                                                         */  /*    A handle to a given `glyph slot'.  A slot is a container where it  */  /*    is possible to load any one of the glyphs contained in its parent  */  /*    face.                                                              */  /*                                                                       */  /*    In other words, each time you call @FT_Load_Glyph or               */  /*    @FT_Load_Char, the slot's content is erased by the new glyph data, */  /*    i.e. the glyph's metrics, its image (bitmap or outline), and       */  /*    other control information.                                         */  /*                                                                       */  /* <Also>                                                                */  /*    @FT_GlyphSlotRec details the publicly accessible glyph fields.     */  /*                                                                       */  typedef struct FT_GlyphSlotRec_*  FT_GlyphSlot;    /*************************************************************************/  /*                                                                       */  /* <Type>                                                                */  /*    FT_CharMap                                                         */  /*                                                                       */  /* <Description>                                                         */  /*    A handle to a given character map.  A charmap is used to translate */  /*    character codes in a given encoding into glyph indexes for its     */  /*    parent's face.  Some font formats may provide several charmaps per */  /*    font.                                                              */  /*                                                                       */  /*    Each face object owns zero or more charmaps, but only one of them  */  /*    can be "active" and used by @FT_Get_Char_Index or @FT_Load_Char.   */  /*                                                                       */  /*    The list of available charmaps in a face is available through the  */  /*    "face->num_charmaps" and "face->charmaps" fields of @FT_FaceRec.   */  /*                                                                       */  /*    The currently active charmap is available as "face->charmap".      */  /*    You should call @FT_Set_Charmap to change it.                      */  /*                                                                       */  /* <Note>                                                                */  /*    When a new face is created (either through @FT_New_Face or         */  /*    @FT_Open_Face), the library looks for a Unicode charmap within     */  /*    the list and automatically activates it.                           */  /*                                                                       */  typedef struct FT_CharMapRec_*  FT_CharMap;    /*************************************************************************/  /*                                                                       */  /* <Macro>                                                               */  /*    FT_ENC_TAG                                                         */  /*                                                                       */  /* <Description>                                                         */  /*    This macro converts four letter tags into an unsigned long.  It is */  /*    used to define "encoding" identifiers (see @FT_Encoding).          */  /*                                                                       */  /* <Note>                                                                */  /*    Since many 16bit compilers don't like 32bit enumerations, you      */  /*    should redefine this macro in case of problems to something like   */  /*    this:                                                              */  /*                                                                       */  /*      #define FT_ENC_TAG( value, a, b, c, d )  (value)                 */  /*                                                                       */  /*    to get a simple enumeration without assigning special numbers.     */  /*                                                                       */ #ifndef FT_ENC_TAG#define FT_ENC_TAG( value, a, b, c, d )         \          value = ( ( (FT_UInt32)(a) << 24 ) |  \                    ( (FT_UInt32)(b) << 16 ) |  \                    ( (FT_UInt32)(c) <<  8 ) |  \                      (FT_UInt32)(d)         ) #endif /* FT_ENC_TAG */    /*************************************************************************/  /*                                                                       */  /* <Enum>                                                                */  /*    FT_Encoding                                                        */  /*                                                                       */  /* <Description>                                                         */  /*    An enumeration used to specify encodings supported by charmaps.    */  /*    Used in the @FT_Select_Charmap API function.                       */  /*                                                                       */  /* <Note>                                                                */  /*    Because of 32-bit charcodes defined in Unicode (i.e., surrogates), */  /*    all character codes must be expressed as FT_Longs.                 */  /*                                                                       */  /*    The values of this type correspond to specific character           */  /*    repertories (i.e. charsets), and not to text encoding methods      */  /*    (like UTF-8, UTF-16, GB2312_EUC, etc.).                            */  /*                                                                       */  /*    Other encodings might be defined in the future.                    */  /*                                                                       */  /* <Values>                                                              */  /*   FT_ENCODING_NONE ::                                                 */  /*     The encoding value 0 is reserved.                                 */  /*                                                                       */  /*   FT_ENCODING_UNICODE ::                                              */  /*     Corresponds to the Unicode character set.  This value covers      */  /*     all versions of the Unicode repertoire, including ASCII and       */  /*     Latin-1.  Most fonts include a Unicode charmap, but not all       */  /*     of them.                                                          */  /*                                                                       */  /*   FT_ENCODING_MS_SYMBOL ::                                            */  /*     Corresponds to the Microsoft Symbol encoding, used to encode      */  /*     mathematical symbols in the 32..255 character code range.  For    */  /*     more information, see `http://www.ceviz.net/symbol.htm'.          */  /*                                                                       */  /*   FT_ENCODING_MS_SJIS ::                                              */  /*     Corresponds to Microsoft's Japanese SJIS encoding.  More info     */  /*     at `http://langsupport.japanreference.com/encoding.shtml'.        */  /*     See note on multi-byte encodings below.                           */  /*                                                                       */  /*   FT_ENCODING_MS_GB2312 ::                                            */  /*     Corresponds to the encoding system for Simplified Chinese, as     */  /*     used in China.  Only found in some TrueType fonts.                */  /*                                                                       */  /*   FT_ENCODING_MS_BIG5 ::                                              */  /*     Corresponds to the encoding system for Traditional Chinese, as    */  /*     used in Taiwan and Hong Kong.  Only found in some TrueType fonts. */  /*                                                                       */  /*   FT_ENCODING_MS_WANSUNG ::                                           */  /*     Corresponds to the Korean encoding system known as Wansung.       */  /*     This is a Microsoft encoding that is only found in some TrueType  */  /*     fonts.  For more information, see                                 */  /*     `http://www.microsoft.com/typography/unicode/949.txt'.            */  /*                                                                       */  /*   FT_ENCODING_MS_JOHAB ::                                             */  /*     The Korean standard character set (KS C-5601-1992), which         */  /*     corresponds to Windows code page 1361.  This character set        */  /*     includes all possible Hangeul character combinations.             */  /*     Only found on some rare TrueType fonts.                           */  /*                                                                       */  /*   FT_ENCODING_ADOBE_LATIN_1 ::                                        */  /*     Corresponds to a Latin-1 encoding as defined in a Type 1          */  /*     Postscript font.  It is limited to 256 character codes.           */  /*                                                                       */  /*   FT_ENCODING_ADOBE_STANDARD ::                                       */  /*     Corresponds to the Adobe Standard encoding, as found in Type 1,   */  /*     CFF, and OpenType/CFF fonts.  It is limited to 256character       */  /*     codes.                                                            */  /*                                                                       */  /*   FT_ENCODING_ADOBE_EXPERT ::                                         */  /*     Corresponds to the Adobe Expert encoding, as found in Type 1,     */  /*     CFF, and OpenType/CFF fonts.  It is limited to 256 character      */  /*     codes.                                                            */  /*                                                                       */  /*   FT_ENCODING_ADOBE_CUSTOM ::                                         */  /*     Corresponds to a custom encoding, as found in Type 1, CFF, and    */  /*     OpenType/CFF fonts.  It is limited to 256 character codes.        */  /*                                                                       */  /*   FT_ENCODING_APPLE_ROMAN ::                                          */  /*     Corresponds to the 8-bit Apple roman encoding.  Many TrueType and */

Lines 1–500 of 2860.