michael@0: /***************************************************************************/ michael@0: /* */ michael@0: /* freetype.h */ michael@0: /* */ michael@0: /* FreeType high-level API and common types (specification only). */ michael@0: /* */ michael@0: /* Copyright 1996-2014 by */ michael@0: /* David Turner, Robert Wilhelm, and Werner Lemberg. */ michael@0: /* */ michael@0: /* This file is part of the FreeType project, and may only be used, */ michael@0: /* modified, and distributed under the terms of the FreeType project */ michael@0: /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ michael@0: /* this file you indicate that you have read the license and */ michael@0: /* understand and accept it fully. */ michael@0: /* */ michael@0: /***************************************************************************/ michael@0: michael@0: michael@0: #ifndef __FREETYPE_H__ michael@0: #define __FREETYPE_H__ michael@0: michael@0: michael@0: #ifndef FT_FREETYPE_H michael@0: #error "`ft2build.h' hasn't been included yet!" michael@0: #error "Please always use macros to include FreeType header files." michael@0: #error "Example:" michael@0: #error " #include " michael@0: #error " #include FT_FREETYPE_H" michael@0: #endif michael@0: michael@0: michael@0: #include michael@0: #include FT_CONFIG_CONFIG_H michael@0: #include FT_TYPES_H michael@0: #include FT_ERRORS_H michael@0: michael@0: michael@0: FT_BEGIN_HEADER michael@0: michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /*
*/ michael@0: /* header_inclusion */ michael@0: /* */ michael@0: /* */ michael@0: /* FreeType's header inclusion scheme */ michael@0: /* */ michael@0: /* <Abstract> */ michael@0: /* How client applications should include FreeType header files. */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* To be as flexible as possible (and for historical reasons), */ michael@0: /* FreeType uses a very special inclusion scheme to load header */ michael@0: /* files, for example */ michael@0: /* */ michael@0: /* { */ michael@0: /* #include <ft2build.h> */ michael@0: /* */ michael@0: /* #include FT_FREETYPE_H */ michael@0: /* #include FT_OUTLINE_H */ michael@0: /* } */ michael@0: /* */ michael@0: /* A compiler and its preprocessor only needs an include path to find */ michael@0: /* the file `ft2build.h'; the exact locations and names of the other */ michael@0: /* FreeType header files are hidden by preprocessor macro names, */ michael@0: /* loaded by `ft2build.h'. The API documentation always gives the */ michael@0: /* header macro name needed for a particular function. */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Section> */ michael@0: /* user_allocation */ michael@0: /* */ michael@0: /* <Title> */ michael@0: /* User allocation */ michael@0: /* */ michael@0: /* <Abstract> */ michael@0: /* How client applications should allocate FreeType data structures. */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* FreeType assumes that structures allocated by the user and passed */ michael@0: /* as arguments are zeroed out except for the actual data. In other */ michael@0: /* words, it is recommended to use `calloc' (or variants of it) */ michael@0: /* instead of `malloc' for allocation. */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* B A S I C T Y P E S */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Section> */ michael@0: /* base_interface */ michael@0: /* */ michael@0: /* <Title> */ michael@0: /* Base Interface */ michael@0: /* */ michael@0: /* <Abstract> */ michael@0: /* The FreeType~2 base font interface. */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This section describes the public high-level API of FreeType~2. */ michael@0: /* */ michael@0: /* <Order> */ michael@0: /* FT_Library */ michael@0: /* FT_Face */ michael@0: /* FT_Size */ michael@0: /* FT_GlyphSlot */ michael@0: /* FT_CharMap */ michael@0: /* FT_Encoding */ michael@0: /* */ michael@0: /* FT_FaceRec */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_SCALABLE */ michael@0: /* FT_FACE_FLAG_FIXED_SIZES */ michael@0: /* FT_FACE_FLAG_FIXED_WIDTH */ michael@0: /* FT_FACE_FLAG_HORIZONTAL */ michael@0: /* FT_FACE_FLAG_VERTICAL */ michael@0: /* FT_FACE_FLAG_COLOR */ michael@0: /* FT_FACE_FLAG_SFNT */ michael@0: /* FT_FACE_FLAG_CID_KEYED */ michael@0: /* FT_FACE_FLAG_TRICKY */ michael@0: /* FT_FACE_FLAG_KERNING */ michael@0: /* FT_FACE_FLAG_MULTIPLE_MASTERS */ michael@0: /* FT_FACE_FLAG_GLYPH_NAMES */ michael@0: /* FT_FACE_FLAG_EXTERNAL_STREAM */ michael@0: /* FT_FACE_FLAG_FAST_GLYPHS */ michael@0: /* FT_FACE_FLAG_HINTER */ michael@0: /* */ michael@0: /* FT_STYLE_FLAG_BOLD */ michael@0: /* FT_STYLE_FLAG_ITALIC */ michael@0: /* */ michael@0: /* FT_SizeRec */ michael@0: /* FT_Size_Metrics */ michael@0: /* */ michael@0: /* FT_GlyphSlotRec */ michael@0: /* FT_Glyph_Metrics */ michael@0: /* FT_SubGlyph */ michael@0: /* */ michael@0: /* FT_Bitmap_Size */ michael@0: /* */ michael@0: /* FT_Init_FreeType */ michael@0: /* FT_Done_FreeType */ michael@0: /* */ michael@0: /* FT_New_Face */ michael@0: /* FT_Done_Face */ michael@0: /* FT_New_Memory_Face */ michael@0: /* FT_Open_Face */ michael@0: /* FT_Open_Args */ michael@0: /* FT_Parameter */ michael@0: /* FT_Attach_File */ michael@0: /* FT_Attach_Stream */ michael@0: /* */ michael@0: /* FT_Set_Char_Size */ michael@0: /* FT_Set_Pixel_Sizes */ michael@0: /* FT_Request_Size */ michael@0: /* FT_Select_Size */ michael@0: /* FT_Size_Request_Type */ michael@0: /* FT_Size_Request */ michael@0: /* FT_Set_Transform */ michael@0: /* FT_Load_Glyph */ michael@0: /* FT_Get_Char_Index */ michael@0: /* FT_Get_Name_Index */ michael@0: /* FT_Load_Char */ michael@0: /* */ michael@0: /* FT_OPEN_MEMORY */ michael@0: /* FT_OPEN_STREAM */ michael@0: /* FT_OPEN_PATHNAME */ michael@0: /* FT_OPEN_DRIVER */ michael@0: /* FT_OPEN_PARAMS */ michael@0: /* */ michael@0: /* FT_LOAD_DEFAULT */ michael@0: /* FT_LOAD_RENDER */ michael@0: /* FT_LOAD_MONOCHROME */ michael@0: /* FT_LOAD_LINEAR_DESIGN */ michael@0: /* FT_LOAD_NO_SCALE */ michael@0: /* FT_LOAD_NO_HINTING */ michael@0: /* FT_LOAD_NO_BITMAP */ michael@0: /* FT_LOAD_CROP_BITMAP */ michael@0: /* */ michael@0: /* FT_LOAD_VERTICAL_LAYOUT */ michael@0: /* FT_LOAD_IGNORE_TRANSFORM */ michael@0: /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */ michael@0: /* FT_LOAD_FORCE_AUTOHINT */ michael@0: /* FT_LOAD_NO_RECURSE */ michael@0: /* FT_LOAD_PEDANTIC */ michael@0: /* */ michael@0: /* FT_LOAD_TARGET_NORMAL */ michael@0: /* FT_LOAD_TARGET_LIGHT */ michael@0: /* FT_LOAD_TARGET_MONO */ michael@0: /* FT_LOAD_TARGET_LCD */ michael@0: /* FT_LOAD_TARGET_LCD_V */ michael@0: /* */ michael@0: /* FT_Render_Glyph */ michael@0: /* FT_Render_Mode */ michael@0: /* FT_Get_Kerning */ michael@0: /* FT_Kerning_Mode */ michael@0: /* FT_Get_Track_Kerning */ michael@0: /* FT_Get_Glyph_Name */ michael@0: /* FT_Get_Postscript_Name */ michael@0: /* */ michael@0: /* FT_CharMapRec */ michael@0: /* FT_Select_Charmap */ michael@0: /* FT_Set_Charmap */ michael@0: /* FT_Get_Charmap_Index */ michael@0: /* */ michael@0: /* FT_FSTYPE_INSTALLABLE_EMBEDDING */ michael@0: /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */ michael@0: /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */ michael@0: /* FT_FSTYPE_EDITABLE_EMBEDDING */ michael@0: /* FT_FSTYPE_NO_SUBSETTING */ michael@0: /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */ michael@0: /* */ michael@0: /* FT_Get_FSType_Flags */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Struct> */ michael@0: /* FT_Glyph_Metrics */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A structure used to model the metrics of a single glyph. The */ michael@0: /* values are expressed in 26.6 fractional pixel format; if the flag */ michael@0: /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */ michael@0: /* are expressed in font units instead. */ michael@0: /* */ michael@0: /* <Fields> */ michael@0: /* width :: */ michael@0: /* The glyph's width. */ michael@0: /* */ michael@0: /* height :: */ michael@0: /* The glyph's height. */ michael@0: /* */ michael@0: /* horiBearingX :: */ michael@0: /* Left side bearing for horizontal layout. */ michael@0: /* */ michael@0: /* horiBearingY :: */ michael@0: /* Top side bearing for horizontal layout. */ michael@0: /* */ michael@0: /* horiAdvance :: */ michael@0: /* Advance width for horizontal layout. */ michael@0: /* */ michael@0: /* vertBearingX :: */ michael@0: /* Left side bearing for vertical layout. */ michael@0: /* */ michael@0: /* vertBearingY :: */ michael@0: /* Top side bearing for vertical layout. Larger positive values */ michael@0: /* mean further below the vertical glyph origin. */ michael@0: /* */ michael@0: /* vertAdvance :: */ michael@0: /* Advance height for vertical layout. Positive values mean the */ michael@0: /* glyph has a positive advance downward. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* If not disabled with @FT_LOAD_NO_HINTING, the values represent */ michael@0: /* dimensions of the hinted glyph (in case hinting is applicable). */ michael@0: /* */ michael@0: /* Stroking a glyph with an outside border does not increase */ michael@0: /* `horiAdvance' or `vertAdvance'; you have to manually adjust these */ michael@0: /* values to account for the added width and height. */ michael@0: /* */ michael@0: typedef struct FT_Glyph_Metrics_ michael@0: { michael@0: FT_Pos width; michael@0: FT_Pos height; michael@0: michael@0: FT_Pos horiBearingX; michael@0: FT_Pos horiBearingY; michael@0: FT_Pos horiAdvance; michael@0: michael@0: FT_Pos vertBearingX; michael@0: FT_Pos vertBearingY; michael@0: FT_Pos vertAdvance; michael@0: michael@0: } FT_Glyph_Metrics; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Struct> */ michael@0: /* FT_Bitmap_Size */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This structure models the metrics of a bitmap strike (i.e., a set */ michael@0: /* of glyphs for a given point size and resolution) in a bitmap font. */ michael@0: /* It is used for the `available_sizes' field of @FT_Face. */ michael@0: /* */ michael@0: /* <Fields> */ michael@0: /* height :: The vertical distance, in pixels, between two */ michael@0: /* consecutive baselines. It is always positive. */ michael@0: /* */ michael@0: /* width :: The average width, in pixels, of all glyphs in the */ michael@0: /* strike. */ michael@0: /* */ michael@0: /* size :: The nominal size of the strike in 26.6 fractional */ michael@0: /* points. This field is not very useful. */ michael@0: /* */ michael@0: /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */ michael@0: /* pixels. */ michael@0: /* */ michael@0: /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */ michael@0: /* pixels. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Windows FNT: */ michael@0: /* The nominal size given in a FNT font is not reliable. Thus when */ michael@0: /* the driver finds it incorrect, it sets `size' to some calculated */ michael@0: /* values and sets `x_ppem' and `y_ppem' to the pixel width and */ michael@0: /* height given in the font, respectively. */ michael@0: /* */ michael@0: /* TrueType embedded bitmaps: */ michael@0: /* `size', `width', and `height' values are not contained in the */ michael@0: /* bitmap strike itself. They are computed from the global font */ michael@0: /* parameters. */ michael@0: /* */ michael@0: typedef struct FT_Bitmap_Size_ michael@0: { michael@0: FT_Short height; michael@0: FT_Short width; michael@0: michael@0: FT_Pos size; michael@0: michael@0: FT_Pos x_ppem; michael@0: FT_Pos y_ppem; michael@0: michael@0: } FT_Bitmap_Size; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* O B J E C T C L A S S E S */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Type> */ michael@0: /* FT_Library */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A handle to a FreeType library instance. Each `library' is */ michael@0: /* completely independent from the others; it is the `root' of a set */ michael@0: /* of objects like fonts, faces, sizes, etc. */ michael@0: /* */ michael@0: /* It also embeds a memory manager (see @FT_Memory), as well as a */ michael@0: /* scan-line converter object (see @FT_Raster). */ michael@0: /* */ michael@0: /* In multi-threaded applications, make sure that the same FT_Library */ michael@0: /* object or any of its children doesn't get accessed in parallel. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Library objects are normally created by @FT_Init_FreeType, and */ michael@0: /* destroyed with @FT_Done_FreeType. If you need reference-counting */ michael@0: /* (cf. @FT_Reference_Library), use @FT_New_Library and */ michael@0: /* @FT_Done_Library. */ michael@0: /* */ michael@0: typedef struct FT_LibraryRec_ *FT_Library; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Type> */ michael@0: /* FT_Module */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A handle to a given FreeType module object. Each module can be a */ michael@0: /* font driver, a renderer, or anything else that provides services */ michael@0: /* to the formers. */ michael@0: /* */ michael@0: typedef struct FT_ModuleRec_* FT_Module; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Type> */ michael@0: /* FT_Driver */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A handle to a given FreeType font driver object. Each font driver */ michael@0: /* is a special module capable of creating faces from font files. */ michael@0: /* */ michael@0: typedef struct FT_DriverRec_* FT_Driver; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Type> */ michael@0: /* FT_Renderer */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A handle to a given FreeType renderer. A renderer is a special */ michael@0: /* module in charge of converting a glyph image to a bitmap, when */ michael@0: /* necessary. Each renderer supports a given glyph image format, and */ michael@0: /* one or more target surface depths. */ michael@0: /* */ michael@0: typedef struct FT_RendererRec_* FT_Renderer; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Type> */ michael@0: /* FT_Face */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A handle to a given typographic face object. A face object models */ michael@0: /* a given typeface, in a given style. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Each face object also owns a single @FT_GlyphSlot object, as well */ michael@0: /* as one or more @FT_Size objects. */ michael@0: /* */ michael@0: /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */ michael@0: /* a given filepathname or a custom input stream. */ michael@0: /* */ michael@0: /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */ michael@0: /* */ michael@0: /* <Also> */ michael@0: /* See @FT_FaceRec for the publicly accessible fields of a given face */ michael@0: /* object. */ michael@0: /* */ michael@0: typedef struct FT_FaceRec_* FT_Face; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Type> */ michael@0: /* FT_Size */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A handle to an object used to model a face scaled to a given */ michael@0: /* character size. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Each @FT_Face has an _active_ @FT_Size object that is used by */ michael@0: /* functions like @FT_Load_Glyph to determine the scaling */ michael@0: /* transformation that in turn is used to load and hint glyphs and */ michael@0: /* metrics. */ michael@0: /* */ michael@0: /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */ michael@0: /* @FT_Request_Size or even @FT_Select_Size to change the content */ michael@0: /* (i.e., the scaling values) of the active @FT_Size. */ michael@0: /* */ michael@0: /* You can use @FT_New_Size to create additional size objects for a */ michael@0: /* given @FT_Face, but they won't be used by other functions until */ michael@0: /* you activate it through @FT_Activate_Size. Only one size can be */ michael@0: /* activated at any given time per face. */ michael@0: /* */ michael@0: /* <Also> */ michael@0: /* See @FT_SizeRec for the publicly accessible fields of a given size */ michael@0: /* object. */ michael@0: /* */ michael@0: typedef struct FT_SizeRec_* FT_Size; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Type> */ michael@0: /* FT_GlyphSlot */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A handle to a given `glyph slot'. A slot is a container where it */ michael@0: /* is possible to load any of the glyphs contained in its parent */ michael@0: /* face. */ michael@0: /* */ michael@0: /* In other words, each time you call @FT_Load_Glyph or */ michael@0: /* @FT_Load_Char, the slot's content is erased by the new glyph data, */ michael@0: /* i.e., the glyph's metrics, its image (bitmap or outline), and */ michael@0: /* other control information. */ michael@0: /* */ michael@0: /* <Also> */ michael@0: /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */ michael@0: /* */ michael@0: typedef struct FT_GlyphSlotRec_* FT_GlyphSlot; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Type> */ michael@0: /* FT_CharMap */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A handle to a given character map. A charmap is used to translate */ michael@0: /* character codes in a given encoding into glyph indexes for its */ michael@0: /* parent's face. Some font formats may provide several charmaps per */ michael@0: /* font. */ michael@0: /* */ michael@0: /* Each face object owns zero or more charmaps, but only one of them */ michael@0: /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */ michael@0: /* */ michael@0: /* The list of available charmaps in a face is available through the */ michael@0: /* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */ michael@0: /* */ michael@0: /* The currently active charmap is available as `face->charmap'. */ michael@0: /* You should call @FT_Set_Charmap to change it. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* When a new face is created (either through @FT_New_Face or */ michael@0: /* @FT_Open_Face), the library looks for a Unicode charmap within */ michael@0: /* the list and automatically activates it. */ michael@0: /* */ michael@0: /* <Also> */ michael@0: /* See @FT_CharMapRec for the publicly accessible fields of a given */ michael@0: /* character map. */ michael@0: /* */ michael@0: typedef struct FT_CharMapRec_* FT_CharMap; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Macro> */ michael@0: /* FT_ENC_TAG */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This macro converts four-letter tags into an unsigned long. It is */ michael@0: /* used to define `encoding' identifiers (see @FT_Encoding). */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Since many 16-bit compilers don't like 32-bit enumerations, you */ michael@0: /* should redefine this macro in case of problems to something like */ michael@0: /* this: */ michael@0: /* */ michael@0: /* { */ michael@0: /* #define FT_ENC_TAG( value, a, b, c, d ) value */ michael@0: /* } */ michael@0: /* */ michael@0: /* to get a simple enumeration without assigning special numbers. */ michael@0: /* */ michael@0: michael@0: #ifndef FT_ENC_TAG michael@0: #define FT_ENC_TAG( value, a, b, c, d ) \ michael@0: value = ( ( (FT_UInt32)(a) << 24 ) | \ michael@0: ( (FT_UInt32)(b) << 16 ) | \ michael@0: ( (FT_UInt32)(c) << 8 ) | \ michael@0: (FT_UInt32)(d) ) michael@0: michael@0: #endif /* FT_ENC_TAG */ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Enum> */ michael@0: /* FT_Encoding */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* An enumeration used to specify character sets supported by */ michael@0: /* charmaps. Used in the @FT_Select_Charmap API function. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Despite the name, this enumeration lists specific character */ michael@0: /* repertories (i.e., charsets), and not text encoding methods (e.g., */ michael@0: /* UTF-8, UTF-16, etc.). */ michael@0: /* */ michael@0: /* Other encodings might be defined in the future. */ michael@0: /* */ michael@0: /* <Values> */ michael@0: /* FT_ENCODING_NONE :: */ michael@0: /* The encoding value~0 is reserved. */ michael@0: /* */ michael@0: /* FT_ENCODING_UNICODE :: */ michael@0: /* Corresponds to the Unicode character set. This value covers */ michael@0: /* all versions of the Unicode repertoire, including ASCII and */ michael@0: /* Latin-1. Most fonts include a Unicode charmap, but not all */ michael@0: /* of them. */ michael@0: /* */ michael@0: /* For example, if you want to access Unicode value U+1F028 (and */ michael@0: /* the font contains it), use value 0x1F028 as the input value for */ michael@0: /* @FT_Get_Char_Index. */ michael@0: /* */ michael@0: /* FT_ENCODING_MS_SYMBOL :: */ michael@0: /* Corresponds to the Microsoft Symbol encoding, used to encode */ michael@0: /* mathematical symbols in the 32..255 character code range. For */ michael@0: /* more information, see */ michael@0: /* `http://www.kostis.net/charsets/symbol.htm'. */ michael@0: /* */ michael@0: /* FT_ENCODING_SJIS :: */ michael@0: /* Corresponds to Japanese SJIS encoding. More info at */ michael@0: /* at `http://en.wikipedia.org/wiki/Shift_JIS'. */ michael@0: /* See note on multi-byte encodings below. */ michael@0: /* */ michael@0: /* FT_ENCODING_GB2312 :: */ michael@0: /* Corresponds to an encoding system for Simplified Chinese as used */ michael@0: /* used in mainland China. */ michael@0: /* */ michael@0: /* FT_ENCODING_BIG5 :: */ michael@0: /* Corresponds to an encoding system for Traditional Chinese as */ michael@0: /* used in Taiwan and Hong Kong. */ michael@0: /* */ michael@0: /* FT_ENCODING_WANSUNG :: */ michael@0: /* Corresponds to the Korean encoding system known as Wansung. */ michael@0: /* For more information see */ michael@0: /* `http://msdn.microsoft.com/en-US/goglobal/cc305154'. */ michael@0: /* */ michael@0: /* FT_ENCODING_JOHAB :: */ michael@0: /* The Korean standard character set (KS~C 5601-1992), which */ michael@0: /* corresponds to MS Windows code page 1361. This character set */ michael@0: /* includes all possible Hangeul character combinations. */ michael@0: /* */ michael@0: /* FT_ENCODING_ADOBE_LATIN_1 :: */ michael@0: /* Corresponds to a Latin-1 encoding as defined in a Type~1 */ michael@0: /* PostScript font. It is limited to 256 character codes. */ michael@0: /* */ michael@0: /* FT_ENCODING_ADOBE_STANDARD :: */ michael@0: /* Corresponds to the Adobe Standard encoding, as found in Type~1, */ michael@0: /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ michael@0: /* codes. */ michael@0: /* */ michael@0: /* FT_ENCODING_ADOBE_EXPERT :: */ michael@0: /* Corresponds to the Adobe Expert encoding, as found in Type~1, */ michael@0: /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ michael@0: /* codes. */ michael@0: /* */ michael@0: /* FT_ENCODING_ADOBE_CUSTOM :: */ michael@0: /* Corresponds to a custom encoding, as found in Type~1, CFF, and */ michael@0: /* OpenType/CFF fonts. It is limited to 256 character codes. */ michael@0: /* */ michael@0: /* FT_ENCODING_APPLE_ROMAN :: */ michael@0: /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */ michael@0: /* and OpenType fonts contain a charmap for this encoding, since */ michael@0: /* older versions of Mac OS are able to use it. */ michael@0: /* */ michael@0: /* FT_ENCODING_OLD_LATIN_2 :: */ michael@0: /* This value is deprecated and was never used nor reported by */ michael@0: /* FreeType. Don't use or test for it. */ michael@0: /* */ michael@0: /* FT_ENCODING_MS_SJIS :: */ michael@0: /* Same as FT_ENCODING_SJIS. Deprecated. */ michael@0: /* */ michael@0: /* FT_ENCODING_MS_GB2312 :: */ michael@0: /* Same as FT_ENCODING_GB2312. Deprecated. */ michael@0: /* */ michael@0: /* FT_ENCODING_MS_BIG5 :: */ michael@0: /* Same as FT_ENCODING_BIG5. Deprecated. */ michael@0: /* */ michael@0: /* FT_ENCODING_MS_WANSUNG :: */ michael@0: /* Same as FT_ENCODING_WANSUNG. Deprecated. */ michael@0: /* */ michael@0: /* FT_ENCODING_MS_JOHAB :: */ michael@0: /* Same as FT_ENCODING_JOHAB. Deprecated. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* By default, FreeType automatically synthesizes a Unicode charmap */ michael@0: /* for PostScript fonts, using their glyph names dictionaries. */ michael@0: /* However, it also reports the encodings defined explicitly in the */ michael@0: /* font file, for the cases when they are needed, with the Adobe */ michael@0: /* values as well. */ michael@0: /* */ michael@0: /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */ michael@0: /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */ michael@0: /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */ michael@0: /* which encoding is really present. If, for example, the */ michael@0: /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */ michael@0: /* the font is encoded in KOI8-R. */ michael@0: /* */ michael@0: /* FT_ENCODING_NONE is always set (with a single exception) by the */ michael@0: /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */ michael@0: /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */ michael@0: /* which encoding is really present. For example, */ michael@0: /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */ michael@0: /* Russian). */ michael@0: /* */ michael@0: /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */ michael@0: /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */ michael@0: /* FT_ENCODING_APPLE_ROMAN). */ michael@0: /* */ michael@0: /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */ michael@0: /* @FT_Get_CMap_Language_ID to query the Mac language ID that may */ michael@0: /* be needed to be able to distinguish Apple encoding variants. See */ michael@0: /* */ michael@0: /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt */ michael@0: /* */ michael@0: /* to get an idea how to do that. Basically, if the language ID */ michael@0: /* is~0, don't use it, otherwise subtract 1 from the language ID. */ michael@0: /* Then examine `encoding_id'. If, for example, `encoding_id' is */ michael@0: /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */ michael@0: /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */ michael@0: /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */ michael@0: /* variant the Arabic encoding. */ michael@0: /* */ michael@0: typedef enum FT_Encoding_ michael@0: { michael@0: FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ), michael@0: michael@0: FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ), michael@0: FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ), michael@0: michael@0: FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ), michael@0: FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ), michael@0: FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ), michael@0: FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ), michael@0: FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ), michael@0: michael@0: /* for backwards compatibility */ michael@0: FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS, michael@0: FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312, michael@0: FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5, michael@0: FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG, michael@0: FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB, michael@0: michael@0: FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ), michael@0: FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ), michael@0: FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ), michael@0: FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ), michael@0: michael@0: FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ), michael@0: michael@0: FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' ) michael@0: michael@0: } FT_Encoding; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Enum> */ michael@0: /* ft_encoding_xxx */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* These constants are deprecated; use the corresponding @FT_Encoding */ michael@0: /* values instead. */ michael@0: /* */ michael@0: #define ft_encoding_none FT_ENCODING_NONE michael@0: #define ft_encoding_unicode FT_ENCODING_UNICODE michael@0: #define ft_encoding_symbol FT_ENCODING_MS_SYMBOL michael@0: #define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1 michael@0: #define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2 michael@0: #define ft_encoding_sjis FT_ENCODING_SJIS michael@0: #define ft_encoding_gb2312 FT_ENCODING_GB2312 michael@0: #define ft_encoding_big5 FT_ENCODING_BIG5 michael@0: #define ft_encoding_wansung FT_ENCODING_WANSUNG michael@0: #define ft_encoding_johab FT_ENCODING_JOHAB michael@0: michael@0: #define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD michael@0: #define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT michael@0: #define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM michael@0: #define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Struct> */ michael@0: /* FT_CharMapRec */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* The base charmap structure. */ michael@0: /* */ michael@0: /* <Fields> */ michael@0: /* face :: A handle to the parent face object. */ michael@0: /* */ michael@0: /* encoding :: An @FT_Encoding tag identifying the charmap. Use */ michael@0: /* this with @FT_Select_Charmap. */ michael@0: /* */ michael@0: /* platform_id :: An ID number describing the platform for the */ michael@0: /* following encoding ID. This comes directly from */ michael@0: /* the TrueType specification and should be emulated */ michael@0: /* for other formats. */ michael@0: /* */ michael@0: /* encoding_id :: A platform specific encoding number. This also */ michael@0: /* comes from the TrueType specification and should be */ michael@0: /* emulated similarly. */ michael@0: /* */ michael@0: typedef struct FT_CharMapRec_ michael@0: { michael@0: FT_Face face; michael@0: FT_Encoding encoding; michael@0: FT_UShort platform_id; michael@0: FT_UShort encoding_id; michael@0: michael@0: } FT_CharMapRec; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* B A S E O B J E C T C L A S S E S */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Type> */ michael@0: /* FT_Face_Internal */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* An opaque handle to an `FT_Face_InternalRec' structure, used to */ michael@0: /* model private data of a given @FT_Face object. */ michael@0: /* */ michael@0: /* This structure might change between releases of FreeType~2 and is */ michael@0: /* not generally available to client applications. */ michael@0: /* */ michael@0: typedef struct FT_Face_InternalRec_* FT_Face_Internal; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Struct> */ michael@0: /* FT_FaceRec */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* FreeType root face class structure. A face object models a */ michael@0: /* typeface in a font file. */ michael@0: /* */ michael@0: /* <Fields> */ michael@0: /* num_faces :: The number of faces in the font file. Some */ michael@0: /* font formats can have multiple faces in */ michael@0: /* a font file. */ michael@0: /* */ michael@0: /* face_index :: The index of the face in the font file. It */ michael@0: /* is set to~0 if there is only one face in */ michael@0: /* the font file. */ michael@0: /* */ michael@0: /* face_flags :: A set of bit flags that give important */ michael@0: /* information about the face; see */ michael@0: /* @FT_FACE_FLAG_XXX for the details. */ michael@0: /* */ michael@0: /* style_flags :: A set of bit flags indicating the style of */ michael@0: /* the face; see @FT_STYLE_FLAG_XXX for the */ michael@0: /* details. */ michael@0: /* */ michael@0: /* num_glyphs :: The number of glyphs in the face. If the */ michael@0: /* face is scalable and has sbits (see */ michael@0: /* `num_fixed_sizes'), it is set to the number */ michael@0: /* of outline glyphs. */ michael@0: /* */ michael@0: /* For CID-keyed fonts, this value gives the */ michael@0: /* highest CID used in the font. */ michael@0: /* */ michael@0: /* family_name :: The face's family name. This is an ASCII */ michael@0: /* string, usually in English, that describes */ michael@0: /* the typeface's family (like `Times New */ michael@0: /* Roman', `Bodoni', `Garamond', etc). This */ michael@0: /* is a least common denominator used to list */ michael@0: /* fonts. Some formats (TrueType & OpenType) */ michael@0: /* provide localized and Unicode versions of */ michael@0: /* this string. Applications should use the */ michael@0: /* format specific interface to access them. */ michael@0: /* Can be NULL (e.g., in fonts embedded in a */ michael@0: /* PDF file). */ michael@0: /* */ michael@0: /* style_name :: The face's style name. This is an ASCII */ michael@0: /* string, usually in English, that describes */ michael@0: /* the typeface's style (like `Italic', */ michael@0: /* `Bold', `Condensed', etc). Not all font */ michael@0: /* formats provide a style name, so this field */ michael@0: /* is optional, and can be set to NULL. As */ michael@0: /* for `family_name', some formats provide */ michael@0: /* localized and Unicode versions of this */ michael@0: /* string. Applications should use the format */ michael@0: /* specific interface to access them. */ michael@0: /* */ michael@0: /* num_fixed_sizes :: The number of bitmap strikes in the face. */ michael@0: /* Even if the face is scalable, there might */ michael@0: /* still be bitmap strikes, which are called */ michael@0: /* `sbits' in that case. */ michael@0: /* */ michael@0: /* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */ michael@0: /* strikes in the face. It is set to NULL if */ michael@0: /* there is no bitmap strike. */ michael@0: /* */ michael@0: /* num_charmaps :: The number of charmaps in the face. */ michael@0: /* */ michael@0: /* charmaps :: An array of the charmaps of the face. */ michael@0: /* */ michael@0: /* generic :: A field reserved for client uses. See the */ michael@0: /* @FT_Generic type description. */ michael@0: /* */ michael@0: /* bbox :: The font bounding box. Coordinates are */ michael@0: /* expressed in font units (see */ michael@0: /* `units_per_EM'). The box is large enough */ michael@0: /* to contain any glyph from the font. Thus, */ michael@0: /* `bbox.yMax' can be seen as the `maximum */ michael@0: /* ascender', and `bbox.yMin' as the `minimum */ michael@0: /* descender'. Only relevant for scalable */ michael@0: /* formats. */ michael@0: /* */ michael@0: /* Note that the bounding box might be off by */ michael@0: /* (at least) one pixel for hinted fonts. See */ michael@0: /* @FT_Size_Metrics for further discussion. */ michael@0: /* */ michael@0: /* units_per_EM :: The number of font units per EM square for */ michael@0: /* this face. This is typically 2048 for */ michael@0: /* TrueType fonts, and 1000 for Type~1 fonts. */ michael@0: /* Only relevant for scalable formats. */ michael@0: /* */ michael@0: /* ascender :: The typographic ascender of the face, */ michael@0: /* expressed in font units. For font formats */ michael@0: /* not having this information, it is set to */ michael@0: /* `bbox.yMax'. Only relevant for scalable */ michael@0: /* formats. */ michael@0: /* */ michael@0: /* descender :: The typographic descender of the face, */ michael@0: /* expressed in font units. For font formats */ michael@0: /* not having this information, it is set to */ michael@0: /* `bbox.yMin'. Note that this field is */ michael@0: /* usually negative. Only relevant for */ michael@0: /* scalable formats. */ michael@0: /* */ michael@0: /* height :: This value is the vertical distance */ michael@0: /* between two consecutive baselines, */ michael@0: /* expressed in font units. It is always */ michael@0: /* positive. Only relevant for scalable */ michael@0: /* formats. */ michael@0: /* */ michael@0: /* If you want the global glyph height, use */ michael@0: /* `ascender - descender'. */ michael@0: /* */ michael@0: /* max_advance_width :: The maximum advance width, in font units, */ michael@0: /* for all glyphs in this face. This can be */ michael@0: /* used to make word wrapping computations */ michael@0: /* faster. Only relevant for scalable */ michael@0: /* formats. */ michael@0: /* */ michael@0: /* max_advance_height :: The maximum advance height, in font units, */ michael@0: /* for all glyphs in this face. This is only */ michael@0: /* relevant for vertical layouts, and is set */ michael@0: /* to `height' for fonts that do not provide */ michael@0: /* vertical metrics. Only relevant for */ michael@0: /* scalable formats. */ michael@0: /* */ michael@0: /* underline_position :: The position, in font units, of the */ michael@0: /* underline line for this face. It is the */ michael@0: /* center of the underlining stem. Only */ michael@0: /* relevant for scalable formats. */ michael@0: /* */ michael@0: /* underline_thickness :: The thickness, in font units, of the */ michael@0: /* underline for this face. Only relevant for */ michael@0: /* scalable formats. */ michael@0: /* */ michael@0: /* glyph :: The face's associated glyph slot(s). */ michael@0: /* */ michael@0: /* size :: The current active size for this face. */ michael@0: /* */ michael@0: /* charmap :: The current active charmap for this face. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Fields may be changed after a call to @FT_Attach_File or */ michael@0: /* @FT_Attach_Stream. */ michael@0: /* */ michael@0: typedef struct FT_FaceRec_ michael@0: { michael@0: FT_Long num_faces; michael@0: FT_Long face_index; michael@0: michael@0: FT_Long face_flags; michael@0: FT_Long style_flags; michael@0: michael@0: FT_Long num_glyphs; michael@0: michael@0: FT_String* family_name; michael@0: FT_String* style_name; michael@0: michael@0: FT_Int num_fixed_sizes; michael@0: FT_Bitmap_Size* available_sizes; michael@0: michael@0: FT_Int num_charmaps; michael@0: FT_CharMap* charmaps; michael@0: michael@0: FT_Generic generic; michael@0: michael@0: /*# The following member variables (down to `underline_thickness') */ michael@0: /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */ michael@0: /*# for bitmap fonts. */ michael@0: FT_BBox bbox; michael@0: michael@0: FT_UShort units_per_EM; michael@0: FT_Short ascender; michael@0: FT_Short descender; michael@0: FT_Short height; michael@0: michael@0: FT_Short max_advance_width; michael@0: FT_Short max_advance_height; michael@0: michael@0: FT_Short underline_position; michael@0: FT_Short underline_thickness; michael@0: michael@0: FT_GlyphSlot glyph; michael@0: FT_Size size; michael@0: FT_CharMap charmap; michael@0: michael@0: /*@private begin */ michael@0: michael@0: FT_Driver driver; michael@0: FT_Memory memory; michael@0: FT_Stream stream; michael@0: michael@0: FT_ListRec sizes_list; michael@0: michael@0: FT_Generic autohint; /* face-specific auto-hinter data */ michael@0: void* extensions; /* unused */ michael@0: michael@0: FT_Face_Internal internal; michael@0: michael@0: /*@private end */ michael@0: michael@0: } FT_FaceRec; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Enum> */ michael@0: /* FT_FACE_FLAG_XXX */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A list of bit flags used in the `face_flags' field of the */ michael@0: /* @FT_FaceRec structure. They inform client applications of */ michael@0: /* properties of the corresponding face. */ michael@0: /* */ michael@0: /* <Values> */ michael@0: /* FT_FACE_FLAG_SCALABLE :: */ michael@0: /* Indicates that the face contains outline glyphs. This doesn't */ michael@0: /* prevent bitmap strikes, i.e., a face can have both this and */ michael@0: /* and @FT_FACE_FLAG_FIXED_SIZES set. */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_FIXED_SIZES :: */ michael@0: /* Indicates that the face contains bitmap strikes. See also the */ michael@0: /* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_FIXED_WIDTH :: */ michael@0: /* Indicates that the face contains fixed-width characters (like */ michael@0: /* Courier, Lucido, MonoType, etc.). */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_SFNT :: */ michael@0: /* Indicates that the face uses the `sfnt' storage scheme. For */ michael@0: /* now, this means TrueType and OpenType. */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_HORIZONTAL :: */ michael@0: /* Indicates that the face contains horizontal glyph metrics. This */ michael@0: /* should be set for all common formats. */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_VERTICAL :: */ michael@0: /* Indicates that the face contains vertical glyph metrics. This */ michael@0: /* is only available in some formats, not all of them. */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_KERNING :: */ michael@0: /* Indicates that the face contains kerning information. If set, */ michael@0: /* the kerning distance can be retrieved through the function */ michael@0: /* @FT_Get_Kerning. Otherwise the function always return the */ michael@0: /* vector (0,0). Note that FreeType doesn't handle kerning data */ michael@0: /* from the `GPOS' table (as present in some OpenType fonts). */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_FAST_GLYPHS :: */ michael@0: /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */ michael@0: /* Indicates that the font contains multiple masters and is capable */ michael@0: /* of interpolating between them. See the multiple-masters */ michael@0: /* specific API for details. */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_GLYPH_NAMES :: */ michael@0: /* Indicates that the font contains glyph names that can be */ michael@0: /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */ michael@0: /* fonts contain broken glyph name tables. Use the function */ michael@0: /* @FT_Has_PS_Glyph_Names when needed. */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_EXTERNAL_STREAM :: */ michael@0: /* Used internally by FreeType to indicate that a face's stream was */ michael@0: /* provided by the client application and should not be destroyed */ michael@0: /* when @FT_Done_Face is called. Don't read or test this flag. */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_HINTER :: */ michael@0: /* Set if the font driver has a hinting machine of its own. For */ michael@0: /* example, with TrueType fonts, it makes sense to use data from */ michael@0: /* the SFNT `gasp' table only if the native TrueType hinting engine */ michael@0: /* (with the bytecode interpreter) is available and active. */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_CID_KEYED :: */ michael@0: /* Set if the font is CID-keyed. In that case, the font is not */ michael@0: /* accessed by glyph indices but by CID values. For subsetted */ michael@0: /* CID-keyed fonts this has the consequence that not all index */ michael@0: /* values are a valid argument to FT_Load_Glyph. Only the CID */ michael@0: /* values for which corresponding glyphs in the subsetted font */ michael@0: /* exist make FT_Load_Glyph return successfully; in all other cases */ michael@0: /* you get an `FT_Err_Invalid_Argument' error. */ michael@0: /* */ michael@0: /* Note that CID-keyed fonts that are in an SFNT wrapper don't */ michael@0: /* have this flag set since the glyphs are accessed in the normal */ michael@0: /* way (using contiguous indices); the `CID-ness' isn't visible to */ michael@0: /* the application. */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_TRICKY :: */ michael@0: /* Set if the font is `tricky', this is, it always needs the */ michael@0: /* font format's native hinting engine to get a reasonable result. */ michael@0: /* A typical example is the Chinese font `mingli.ttf' that uses */ michael@0: /* TrueType bytecode instructions to move and scale all of its */ michael@0: /* subglyphs. */ michael@0: /* */ michael@0: /* It is not possible to autohint such fonts using */ michael@0: /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */ michael@0: /* @FT_LOAD_NO_HINTING. You have to set both @FT_LOAD_NO_HINTING */ michael@0: /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */ michael@0: /* probably never want this except for demonstration purposes. */ michael@0: /* */ michael@0: /* Currently, there are about a dozen TrueType fonts in the list of */ michael@0: /* tricky fonts; they are hard-coded in file `ttobjs.c'. */ michael@0: /* */ michael@0: /* FT_FACE_FLAG_COLOR :: */ michael@0: /* Set if the font has color glyph tables. To access color glyphs */ michael@0: /* use @FT_LOAD_COLOR. */ michael@0: /* */ michael@0: #define FT_FACE_FLAG_SCALABLE ( 1L << 0 ) michael@0: #define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 ) michael@0: #define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 ) michael@0: #define FT_FACE_FLAG_SFNT ( 1L << 3 ) michael@0: #define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 ) michael@0: #define FT_FACE_FLAG_VERTICAL ( 1L << 5 ) michael@0: #define FT_FACE_FLAG_KERNING ( 1L << 6 ) michael@0: #define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 ) michael@0: #define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 ) michael@0: #define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 ) michael@0: #define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 ) michael@0: #define FT_FACE_FLAG_HINTER ( 1L << 11 ) michael@0: #define FT_FACE_FLAG_CID_KEYED ( 1L << 12 ) michael@0: #define FT_FACE_FLAG_TRICKY ( 1L << 13 ) michael@0: #define FT_FACE_FLAG_COLOR ( 1L << 14 ) michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @macro: michael@0: * FT_HAS_HORIZONTAL( face ) michael@0: * michael@0: * @description: michael@0: * A macro that returns true whenever a face object contains michael@0: * horizontal metrics (this is true for all font formats though). michael@0: * michael@0: * @also: michael@0: * @FT_HAS_VERTICAL can be used to check for vertical metrics. michael@0: * michael@0: */ michael@0: #define FT_HAS_HORIZONTAL( face ) \ michael@0: ( face->face_flags & FT_FACE_FLAG_HORIZONTAL ) michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @macro: michael@0: * FT_HAS_VERTICAL( face ) michael@0: * michael@0: * @description: michael@0: * A macro that returns true whenever a face object contains real michael@0: * vertical metrics (and not only synthesized ones). michael@0: * michael@0: */ michael@0: #define FT_HAS_VERTICAL( face ) \ michael@0: ( face->face_flags & FT_FACE_FLAG_VERTICAL ) michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @macro: michael@0: * FT_HAS_KERNING( face ) michael@0: * michael@0: * @description: michael@0: * A macro that returns true whenever a face object contains kerning michael@0: * data that can be accessed with @FT_Get_Kerning. michael@0: * michael@0: */ michael@0: #define FT_HAS_KERNING( face ) \ michael@0: ( face->face_flags & FT_FACE_FLAG_KERNING ) michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @macro: michael@0: * FT_IS_SCALABLE( face ) michael@0: * michael@0: * @description: michael@0: * A macro that returns true whenever a face object contains a scalable michael@0: * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF, michael@0: * and PFR font formats. michael@0: * michael@0: */ michael@0: #define FT_IS_SCALABLE( face ) \ michael@0: ( face->face_flags & FT_FACE_FLAG_SCALABLE ) michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @macro: michael@0: * FT_IS_SFNT( face ) michael@0: * michael@0: * @description: michael@0: * A macro that returns true whenever a face object contains a font michael@0: * whose format is based on the SFNT storage scheme. This usually michael@0: * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded michael@0: * bitmap fonts. michael@0: * michael@0: * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and michael@0: * @FT_TRUETYPE_TABLES_H are available. michael@0: * michael@0: */ michael@0: #define FT_IS_SFNT( face ) \ michael@0: ( face->face_flags & FT_FACE_FLAG_SFNT ) michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @macro: michael@0: * FT_IS_FIXED_WIDTH( face ) michael@0: * michael@0: * @description: michael@0: * A macro that returns true whenever a face object contains a font face michael@0: * that contains fixed-width (or `monospace', `fixed-pitch', etc.) michael@0: * glyphs. michael@0: * michael@0: */ michael@0: #define FT_IS_FIXED_WIDTH( face ) \ michael@0: ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @macro: michael@0: * FT_HAS_FIXED_SIZES( face ) michael@0: * michael@0: * @description: michael@0: * A macro that returns true whenever a face object contains some michael@0: * embedded bitmaps. See the `available_sizes' field of the michael@0: * @FT_FaceRec structure. michael@0: * michael@0: */ michael@0: #define FT_HAS_FIXED_SIZES( face ) \ michael@0: ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES ) michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @macro: michael@0: * FT_HAS_FAST_GLYPHS( face ) michael@0: * michael@0: * @description: michael@0: * Deprecated. michael@0: * michael@0: */ michael@0: #define FT_HAS_FAST_GLYPHS( face ) 0 michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @macro: michael@0: * FT_HAS_GLYPH_NAMES( face ) michael@0: * michael@0: * @description: michael@0: * A macro that returns true whenever a face object contains some glyph michael@0: * names that can be accessed through @FT_Get_Glyph_Name. michael@0: * michael@0: */ michael@0: #define FT_HAS_GLYPH_NAMES( face ) \ michael@0: ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @macro: michael@0: * FT_HAS_MULTIPLE_MASTERS( face ) michael@0: * michael@0: * @description: michael@0: * A macro that returns true whenever a face object contains some michael@0: * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H michael@0: * are then available to choose the exact design you want. michael@0: * michael@0: */ michael@0: #define FT_HAS_MULTIPLE_MASTERS( face ) \ michael@0: ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @macro: michael@0: * FT_IS_CID_KEYED( face ) michael@0: * michael@0: * @description: michael@0: * A macro that returns true whenever a face object contains a CID-keyed michael@0: * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more michael@0: * details. michael@0: * michael@0: * If this macro is true, all functions defined in @FT_CID_H are michael@0: * available. michael@0: * michael@0: */ michael@0: #define FT_IS_CID_KEYED( face ) \ michael@0: ( face->face_flags & FT_FACE_FLAG_CID_KEYED ) michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @macro: michael@0: * FT_IS_TRICKY( face ) michael@0: * michael@0: * @description: michael@0: * A macro that returns true whenever a face represents a `tricky' font. michael@0: * See the discussion of @FT_FACE_FLAG_TRICKY for more details. michael@0: * michael@0: */ michael@0: #define FT_IS_TRICKY( face ) \ michael@0: ( face->face_flags & FT_FACE_FLAG_TRICKY ) michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @macro: michael@0: * FT_HAS_COLOR( face ) michael@0: * michael@0: * @description: michael@0: * A macro that returns true whenever a face object contains michael@0: * tables for color glyphs. michael@0: * michael@0: */ michael@0: #define FT_HAS_COLOR( face ) \ michael@0: ( face->face_flags & FT_FACE_FLAG_COLOR ) michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Const> */ michael@0: /* FT_STYLE_FLAG_XXX */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A list of bit-flags used to indicate the style of a given face. */ michael@0: /* These are used in the `style_flags' field of @FT_FaceRec. */ michael@0: /* */ michael@0: /* <Values> */ michael@0: /* FT_STYLE_FLAG_ITALIC :: */ michael@0: /* Indicates that a given face style is italic or oblique. */ michael@0: /* */ michael@0: /* FT_STYLE_FLAG_BOLD :: */ michael@0: /* Indicates that a given face is bold. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The style information as provided by FreeType is very basic. More */ michael@0: /* details are beyond the scope and should be done on a higher level */ michael@0: /* (for example, by analyzing various fields of the `OS/2' table in */ michael@0: /* SFNT based fonts). */ michael@0: /* */ michael@0: #define FT_STYLE_FLAG_ITALIC ( 1 << 0 ) michael@0: #define FT_STYLE_FLAG_BOLD ( 1 << 1 ) michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Type> */ michael@0: /* FT_Size_Internal */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* An opaque handle to an `FT_Size_InternalRec' structure, used to */ michael@0: /* model private data of a given @FT_Size object. */ michael@0: /* */ michael@0: typedef struct FT_Size_InternalRec_* FT_Size_Internal; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Struct> */ michael@0: /* FT_Size_Metrics */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* The size metrics structure gives the metrics of a size object. */ michael@0: /* */ michael@0: /* <Fields> */ michael@0: /* x_ppem :: The width of the scaled EM square in pixels, hence */ michael@0: /* the term `ppem' (pixels per EM). It is also */ michael@0: /* referred to as `nominal width'. */ michael@0: /* */ michael@0: /* y_ppem :: The height of the scaled EM square in pixels, */ michael@0: /* hence the term `ppem' (pixels per EM). It is also */ michael@0: /* referred to as `nominal height'. */ michael@0: /* */ michael@0: /* x_scale :: A 16.16 fractional scaling value used to convert */ michael@0: /* horizontal metrics from font units to 26.6 */ michael@0: /* fractional pixels. Only relevant for scalable */ michael@0: /* font formats. */ michael@0: /* */ michael@0: /* y_scale :: A 16.16 fractional scaling value used to convert */ michael@0: /* vertical metrics from font units to 26.6 */ michael@0: /* fractional pixels. Only relevant for scalable */ michael@0: /* font formats. */ michael@0: /* */ michael@0: /* ascender :: The ascender in 26.6 fractional pixels. See */ michael@0: /* @FT_FaceRec for the details. */ michael@0: /* */ michael@0: /* descender :: The descender in 26.6 fractional pixels. See */ michael@0: /* @FT_FaceRec for the details. */ michael@0: /* */ michael@0: /* height :: The height in 26.6 fractional pixels. See */ michael@0: /* @FT_FaceRec for the details. */ michael@0: /* */ michael@0: /* max_advance :: The maximum advance width in 26.6 fractional */ michael@0: /* pixels. See @FT_FaceRec for the details. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The scaling values, if relevant, are determined first during a */ michael@0: /* size changing operation. The remaining fields are then set by the */ michael@0: /* driver. For scalable formats, they are usually set to scaled */ michael@0: /* values of the corresponding fields in @FT_FaceRec. */ michael@0: /* */ michael@0: /* Note that due to glyph hinting, these values might not be exact */ michael@0: /* for certain fonts. Thus they must be treated as unreliable */ michael@0: /* with an error margin of at least one pixel! */ michael@0: /* */ michael@0: /* Indeed, the only way to get the exact metrics is to render _all_ */ michael@0: /* glyphs. As this would be a definite performance hit, it is up to */ michael@0: /* client applications to perform such computations. */ michael@0: /* */ michael@0: /* The FT_Size_Metrics structure is valid for bitmap fonts also. */ michael@0: /* */ michael@0: typedef struct FT_Size_Metrics_ michael@0: { michael@0: FT_UShort x_ppem; /* horizontal pixels per EM */ michael@0: FT_UShort y_ppem; /* vertical pixels per EM */ michael@0: michael@0: FT_Fixed x_scale; /* scaling values used to convert font */ michael@0: FT_Fixed y_scale; /* units to 26.6 fractional pixels */ michael@0: michael@0: FT_Pos ascender; /* ascender in 26.6 frac. pixels */ michael@0: FT_Pos descender; /* descender in 26.6 frac. pixels */ michael@0: FT_Pos height; /* text height in 26.6 frac. pixels */ michael@0: FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */ michael@0: michael@0: } FT_Size_Metrics; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Struct> */ michael@0: /* FT_SizeRec */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* FreeType root size class structure. A size object models a face */ michael@0: /* object at a given size. */ michael@0: /* */ michael@0: /* <Fields> */ michael@0: /* face :: Handle to the parent face object. */ michael@0: /* */ michael@0: /* generic :: A typeless pointer, unused by the FreeType library or */ michael@0: /* any of its drivers. It can be used by client */ michael@0: /* applications to link their own data to each size */ michael@0: /* object. */ michael@0: /* */ michael@0: /* metrics :: Metrics for this size object. This field is read-only. */ michael@0: /* */ michael@0: typedef struct FT_SizeRec_ michael@0: { michael@0: FT_Face face; /* parent face object */ michael@0: FT_Generic generic; /* generic pointer for client uses */ michael@0: FT_Size_Metrics metrics; /* size metrics */ michael@0: FT_Size_Internal internal; michael@0: michael@0: } FT_SizeRec; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Struct> */ michael@0: /* FT_SubGlyph */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* The subglyph structure is an internal object used to describe */ michael@0: /* subglyphs (for example, in the case of composites). */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The subglyph implementation is not part of the high-level API, */ michael@0: /* hence the forward structure declaration. */ michael@0: /* */ michael@0: /* You can however retrieve subglyph information with */ michael@0: /* @FT_Get_SubGlyph_Info. */ michael@0: /* */ michael@0: typedef struct FT_SubGlyphRec_* FT_SubGlyph; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Type> */ michael@0: /* FT_Slot_Internal */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* An opaque handle to an `FT_Slot_InternalRec' structure, used to */ michael@0: /* model private data of a given @FT_GlyphSlot object. */ michael@0: /* */ michael@0: typedef struct FT_Slot_InternalRec_* FT_Slot_Internal; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Struct> */ michael@0: /* FT_GlyphSlotRec */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* FreeType root glyph slot class structure. A glyph slot is a */ michael@0: /* container where individual glyphs can be loaded, be they in */ michael@0: /* outline or bitmap format. */ michael@0: /* */ michael@0: /* <Fields> */ michael@0: /* library :: A handle to the FreeType library instance */ michael@0: /* this slot belongs to. */ michael@0: /* */ michael@0: /* face :: A handle to the parent face object. */ michael@0: /* */ michael@0: /* next :: In some cases (like some font tools), several */ michael@0: /* glyph slots per face object can be a good */ michael@0: /* thing. As this is rare, the glyph slots are */ michael@0: /* listed through a direct, single-linked list */ michael@0: /* using its `next' field. */ michael@0: /* */ michael@0: /* generic :: A typeless pointer unused by the FreeType */ michael@0: /* library or any of its drivers. It can be */ michael@0: /* used by client applications to link their own */ michael@0: /* data to each glyph slot object. */ michael@0: /* */ michael@0: /* metrics :: The metrics of the last loaded glyph in the */ michael@0: /* slot. The returned values depend on the last */ michael@0: /* load flags (see the @FT_Load_Glyph API */ michael@0: /* function) and can be expressed either in 26.6 */ michael@0: /* fractional pixels or font units. */ michael@0: /* */ michael@0: /* Note that even when the glyph image is */ michael@0: /* transformed, the metrics are not. */ michael@0: /* */ michael@0: /* linearHoriAdvance :: The advance width of the unhinted glyph. */ michael@0: /* Its value is expressed in 16.16 fractional */ michael@0: /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */ michael@0: /* when loading the glyph. This field can be */ michael@0: /* important to perform correct WYSIWYG layout. */ michael@0: /* Only relevant for outline glyphs. */ michael@0: /* */ michael@0: /* linearVertAdvance :: The advance height of the unhinted glyph. */ michael@0: /* Its value is expressed in 16.16 fractional */ michael@0: /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */ michael@0: /* when loading the glyph. This field can be */ michael@0: /* important to perform correct WYSIWYG layout. */ michael@0: /* Only relevant for outline glyphs. */ michael@0: /* */ michael@0: /* advance :: This shorthand is, depending on */ michael@0: /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */ michael@0: /* (hinted) advance width for the glyph, in 26.6 */ michael@0: /* fractional pixel format. As specified with */ michael@0: /* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */ michael@0: /* `horiAdvance' or the `vertAdvance' value of */ michael@0: /* `metrics' field. */ michael@0: /* */ michael@0: /* format :: This field indicates the format of the image */ michael@0: /* contained in the glyph slot. Typically */ michael@0: /* @FT_GLYPH_FORMAT_BITMAP, */ michael@0: /* @FT_GLYPH_FORMAT_OUTLINE, or */ michael@0: /* @FT_GLYPH_FORMAT_COMPOSITE, but others are */ michael@0: /* possible. */ michael@0: /* */ michael@0: /* bitmap :: This field is used as a bitmap descriptor */ michael@0: /* when the slot format is */ michael@0: /* @FT_GLYPH_FORMAT_BITMAP. Note that the */ michael@0: /* address and content of the bitmap buffer can */ michael@0: /* change between calls of @FT_Load_Glyph and a */ michael@0: /* few other functions. */ michael@0: /* */ michael@0: /* bitmap_left :: This is the bitmap's left bearing expressed */ michael@0: /* in integer pixels. Of course, this is only */ michael@0: /* valid if the format is */ michael@0: /* @FT_GLYPH_FORMAT_BITMAP. */ michael@0: /* */ michael@0: /* bitmap_top :: This is the bitmap's top bearing expressed in */ michael@0: /* integer pixels. Remember that this is the */ michael@0: /* distance from the baseline to the top-most */ michael@0: /* glyph scanline, upwards y~coordinates being */ michael@0: /* *positive*. */ michael@0: /* */ michael@0: /* outline :: The outline descriptor for the current glyph */ michael@0: /* image if its format is */ michael@0: /* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */ michael@0: /* loaded, `outline' can be transformed, */ michael@0: /* distorted, embolded, etc. However, it must */ michael@0: /* not be freed. */ michael@0: /* */ michael@0: /* num_subglyphs :: The number of subglyphs in a composite glyph. */ michael@0: /* This field is only valid for the composite */ michael@0: /* glyph format that should normally only be */ michael@0: /* loaded with the @FT_LOAD_NO_RECURSE flag. */ michael@0: /* For now this is internal to FreeType. */ michael@0: /* */ michael@0: /* subglyphs :: An array of subglyph descriptors for */ michael@0: /* composite glyphs. There are `num_subglyphs' */ michael@0: /* elements in there. Currently internal to */ michael@0: /* FreeType. */ michael@0: /* */ michael@0: /* control_data :: Certain font drivers can also return the */ michael@0: /* control data for a given glyph image (e.g. */ michael@0: /* TrueType bytecode, Type~1 charstrings, etc.). */ michael@0: /* This field is a pointer to such data. */ michael@0: /* */ michael@0: /* control_len :: This is the length in bytes of the control */ michael@0: /* data. */ michael@0: /* */ michael@0: /* other :: Really wicked formats can use this pointer to */ michael@0: /* present their own glyph image to client */ michael@0: /* applications. Note that the application */ michael@0: /* needs to know about the image format. */ michael@0: /* */ michael@0: /* lsb_delta :: The difference between hinted and unhinted */ michael@0: /* left side bearing while autohinting is */ michael@0: /* active. Zero otherwise. */ michael@0: /* */ michael@0: /* rsb_delta :: The difference between hinted and unhinted */ michael@0: /* right side bearing while autohinting is */ michael@0: /* active. Zero otherwise. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* If @FT_Load_Glyph is called with default flags (see */ michael@0: /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */ michael@0: /* its native format (e.g., an outline glyph for TrueType and Type~1 */ michael@0: /* formats). */ michael@0: /* */ michael@0: /* This image can later be converted into a bitmap by calling */ michael@0: /* @FT_Render_Glyph. This function finds the current renderer for */ michael@0: /* the native image's format, then invokes it. */ michael@0: /* */ michael@0: /* The renderer is in charge of transforming the native image through */ michael@0: /* the slot's face transformation fields, then converting it into a */ michael@0: /* bitmap that is returned in `slot->bitmap'. */ michael@0: /* */ michael@0: /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */ michael@0: /* to specify the position of the bitmap relative to the current pen */ michael@0: /* position (e.g., coordinates (0,0) on the baseline). Of course, */ michael@0: /* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Here a small pseudo code fragment that shows how to use */ michael@0: /* `lsb_delta' and `rsb_delta': */ michael@0: /* */ michael@0: /* { */ michael@0: /* FT_Pos origin_x = 0; */ michael@0: /* FT_Pos prev_rsb_delta = 0; */ michael@0: /* */ michael@0: /* */ michael@0: /* for all glyphs do */ michael@0: /* <compute kern between current and previous glyph and add it to */ michael@0: /* `origin_x'> */ michael@0: /* */ michael@0: /* <load glyph with `FT_Load_Glyph'> */ michael@0: /* */ michael@0: /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */ michael@0: /* origin_x -= 64; */ michael@0: /* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */ michael@0: /* origin_x += 64; */ michael@0: /* */ michael@0: /* prev_rsb_delta = face->glyph->rsb_delta; */ michael@0: /* */ michael@0: /* <save glyph image, or render glyph, or ...> */ michael@0: /* */ michael@0: /* origin_x += face->glyph->advance.x; */ michael@0: /* endfor */ michael@0: /* } */ michael@0: /* */ michael@0: typedef struct FT_GlyphSlotRec_ michael@0: { michael@0: FT_Library library; michael@0: FT_Face face; michael@0: FT_GlyphSlot next; michael@0: FT_UInt reserved; /* retained for binary compatibility */ michael@0: FT_Generic generic; michael@0: michael@0: FT_Glyph_Metrics metrics; michael@0: FT_Fixed linearHoriAdvance; michael@0: FT_Fixed linearVertAdvance; michael@0: FT_Vector advance; michael@0: michael@0: FT_Glyph_Format format; michael@0: michael@0: FT_Bitmap bitmap; michael@0: FT_Int bitmap_left; michael@0: FT_Int bitmap_top; michael@0: michael@0: FT_Outline outline; michael@0: michael@0: FT_UInt num_subglyphs; michael@0: FT_SubGlyph subglyphs; michael@0: michael@0: void* control_data; michael@0: long control_len; michael@0: michael@0: FT_Pos lsb_delta; michael@0: FT_Pos rsb_delta; michael@0: michael@0: void* other; michael@0: michael@0: FT_Slot_Internal internal; michael@0: michael@0: } FT_GlyphSlotRec; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* F U N C T I O N S */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Init_FreeType */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Initialize a new FreeType library object. The set of modules */ michael@0: /* that are registered by this function is determined at build time. */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* alibrary :: A handle to a new library object. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* In case you want to provide your own memory allocating routines, */ michael@0: /* use @FT_New_Library instead, followed by a call to */ michael@0: /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */ michael@0: /* */ michael@0: /* For multi-threading applications each thread should have its own */ michael@0: /* FT_Library object. */ michael@0: /* */ michael@0: /* If you need reference-counting (cf. @FT_Reference_Library), use */ michael@0: /* @FT_New_Library and @FT_Done_Library. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Init_FreeType( FT_Library *alibrary ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Done_FreeType */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Destroy a given FreeType library object and all of its children, */ michael@0: /* including resources, drivers, faces, sizes, etc. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* library :: A handle to the target library object. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Done_FreeType( FT_Library library ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Enum> */ michael@0: /* FT_OPEN_XXX */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A list of bit-field constants used within the `flags' field of the */ michael@0: /* @FT_Open_Args structure. */ michael@0: /* */ michael@0: /* <Values> */ michael@0: /* FT_OPEN_MEMORY :: This is a memory-based stream. */ michael@0: /* */ michael@0: /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */ michael@0: /* */ michael@0: /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */ michael@0: /* name. */ michael@0: /* */ michael@0: /* FT_OPEN_DRIVER :: Use the `driver' field. */ michael@0: /* */ michael@0: /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */ michael@0: /* */ michael@0: /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */ michael@0: /* */ michael@0: /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */ michael@0: /* */ michael@0: /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */ michael@0: /* */ michael@0: /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */ michael@0: /* */ michael@0: /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */ michael@0: /* flags are mutually exclusive. */ michael@0: /* */ michael@0: #define FT_OPEN_MEMORY 0x1 michael@0: #define FT_OPEN_STREAM 0x2 michael@0: #define FT_OPEN_PATHNAME 0x4 michael@0: #define FT_OPEN_DRIVER 0x8 michael@0: #define FT_OPEN_PARAMS 0x10 michael@0: michael@0: #define ft_open_memory FT_OPEN_MEMORY /* deprecated */ michael@0: #define ft_open_stream FT_OPEN_STREAM /* deprecated */ michael@0: #define ft_open_pathname FT_OPEN_PATHNAME /* deprecated */ michael@0: #define ft_open_driver FT_OPEN_DRIVER /* deprecated */ michael@0: #define ft_open_params FT_OPEN_PARAMS /* deprecated */ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Struct> */ michael@0: /* FT_Parameter */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A simple structure used to pass more or less generic parameters to */ michael@0: /* @FT_Open_Face. */ michael@0: /* */ michael@0: /* <Fields> */ michael@0: /* tag :: A four-byte identification tag. */ michael@0: /* */ michael@0: /* data :: A pointer to the parameter data. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The ID and function of parameters are driver-specific. See the */ michael@0: /* various FT_PARAM_TAG_XXX flags for more information. */ michael@0: /* */ michael@0: typedef struct FT_Parameter_ michael@0: { michael@0: FT_ULong tag; michael@0: FT_Pointer data; michael@0: michael@0: } FT_Parameter; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Struct> */ michael@0: /* FT_Open_Args */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A structure used to indicate how to open a new font file or */ michael@0: /* stream. A pointer to such a structure can be used as a parameter */ michael@0: /* for the functions @FT_Open_Face and @FT_Attach_Stream. */ michael@0: /* */ michael@0: /* <Fields> */ michael@0: /* flags :: A set of bit flags indicating how to use the */ michael@0: /* structure. */ michael@0: /* */ michael@0: /* memory_base :: The first byte of the file in memory. */ michael@0: /* */ michael@0: /* memory_size :: The size in bytes of the file in memory. */ michael@0: /* */ michael@0: /* pathname :: A pointer to an 8-bit file pathname. */ michael@0: /* */ michael@0: /* stream :: A handle to a source stream object. */ michael@0: /* */ michael@0: /* driver :: This field is exclusively used by @FT_Open_Face; */ michael@0: /* it simply specifies the font driver to use to open */ michael@0: /* the face. If set to~0, FreeType tries to load the */ michael@0: /* face with each one of the drivers in its list. */ michael@0: /* */ michael@0: /* num_params :: The number of extra parameters. */ michael@0: /* */ michael@0: /* params :: Extra parameters passed to the font driver when */ michael@0: /* opening a new face. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The stream type is determined by the contents of `flags' that */ michael@0: /* are tested in the following order by @FT_Open_Face: */ michael@0: /* */ michael@0: /* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */ michael@0: /* memory file of `memory_size' bytes, located at `memory_address'. */ michael@0: /* The data are are not copied, and the client is responsible for */ michael@0: /* releasing and destroying them _after_ the corresponding call to */ michael@0: /* @FT_Done_Face. */ michael@0: /* */ michael@0: /* Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a */ michael@0: /* custom input stream `stream' is used. */ michael@0: /* */ michael@0: /* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */ michael@0: /* is a normal file and use `pathname' to open it. */ michael@0: /* */ michael@0: /* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to */ michael@0: /* open the file with the driver whose handler is in `driver'. */ michael@0: /* */ michael@0: /* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */ michael@0: /* `num_params' and `params' is used. They are ignored otherwise. */ michael@0: /* */ michael@0: /* Ideally, both the `pathname' and `params' fields should be tagged */ michael@0: /* as `const'; this is missing for API backwards compatibility. In */ michael@0: /* other words, applications should treat them as read-only. */ michael@0: /* */ michael@0: typedef struct FT_Open_Args_ michael@0: { michael@0: FT_UInt flags; michael@0: const FT_Byte* memory_base; michael@0: FT_Long memory_size; michael@0: FT_String* pathname; michael@0: FT_Stream stream; michael@0: FT_Module driver; michael@0: FT_Int num_params; michael@0: FT_Parameter* params; michael@0: michael@0: } FT_Open_Args; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_New_Face */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This function calls @FT_Open_Face to open a font by its pathname. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* library :: A handle to the library resource. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* pathname :: A path to the font file. */ michael@0: /* */ michael@0: /* face_index :: The index of the face within the font. The first */ michael@0: /* face has index~0. */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* aface :: A handle to a new face object. If `face_index' is */ michael@0: /* greater than or equal to zero, it must be non-NULL. */ michael@0: /* See @FT_Open_Face for more details. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Use @FT_Done_Face to destroy the created @FT_Face object (along */ michael@0: /* with its slot and sizes). */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_New_Face( FT_Library library, michael@0: const char* filepathname, michael@0: FT_Long face_index, michael@0: FT_Face *aface ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_New_Memory_Face */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This function calls @FT_Open_Face to open a font that has been */ michael@0: /* loaded into memory. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* library :: A handle to the library resource. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* file_base :: A pointer to the beginning of the font data. */ michael@0: /* */ michael@0: /* file_size :: The size of the memory chunk used by the font data. */ michael@0: /* */ michael@0: /* face_index :: The index of the face within the font. The first */ michael@0: /* face has index~0. */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* aface :: A handle to a new face object. If `face_index' is */ michael@0: /* greater than or equal to zero, it must be non-NULL. */ michael@0: /* See @FT_Open_Face for more details. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* You must not deallocate the memory before calling @FT_Done_Face. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_New_Memory_Face( FT_Library library, michael@0: const FT_Byte* file_base, michael@0: FT_Long file_size, michael@0: FT_Long face_index, michael@0: FT_Face *aface ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Open_Face */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Create a face object from a given resource described by */ michael@0: /* @FT_Open_Args. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* library :: A handle to the library resource. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* args :: A pointer to an `FT_Open_Args' structure that must */ michael@0: /* be filled by the caller. */ michael@0: /* */ michael@0: /* face_index :: The index of the face within the font. The first */ michael@0: /* face has index~0. */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* aface :: A handle to a new face object. If `face_index' is */ michael@0: /* greater than or equal to zero, it must be non-NULL. */ michael@0: /* See note below. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Unlike FreeType 1.x, this function automatically creates a glyph */ michael@0: /* slot for the face object that can be accessed directly through */ michael@0: /* `face->glyph'. */ michael@0: /* */ michael@0: /* FT_Open_Face can be used to quickly check whether the font */ michael@0: /* format of a given font resource is supported by FreeType. If the */ michael@0: /* `face_index' field is negative, the function's return value is~0 */ michael@0: /* if the font format is recognized, or non-zero otherwise; */ michael@0: /* the function returns a more or less empty face handle in `*aface' */ michael@0: /* (if `aface' isn't NULL). The only useful field in this special */ michael@0: /* case is `face->num_faces' that gives the number of faces within */ michael@0: /* the font file. After examination, the returned @FT_Face structure */ michael@0: /* should be deallocated with a call to @FT_Done_Face. */ michael@0: /* */ michael@0: /* Each new face object created with this function also owns a */ michael@0: /* default @FT_Size object, accessible as `face->size'. */ michael@0: /* */ michael@0: /* One @FT_Library instance can have multiple face objects, this is, */ michael@0: /* @FT_Open_Face and its siblings can be called multiple times using */ michael@0: /* the same `library' argument. */ michael@0: /* */ michael@0: /* See the discussion of reference counters in the description of */ michael@0: /* @FT_Reference_Face. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Open_Face( FT_Library library, michael@0: const FT_Open_Args* args, michael@0: FT_Long face_index, michael@0: FT_Face *aface ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Attach_File */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This function calls @FT_Attach_Stream to attach a file. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* face :: The target face object. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* filepathname :: The pathname. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Attach_File( FT_Face face, michael@0: const char* filepathname ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Attach_Stream */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* `Attach' data to a face object. Normally, this is used to read */ michael@0: /* additional information for the face object. For example, you can */ michael@0: /* attach an AFM file that comes with a Type~1 font to get the */ michael@0: /* kerning values and other metrics. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* face :: The target face object. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* parameters :: A pointer to @FT_Open_Args that must be filled by */ michael@0: /* the caller. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The meaning of the `attach' (i.e., what really happens when the */ michael@0: /* new file is read) is not fixed by FreeType itself. It really */ michael@0: /* depends on the font format (and thus the font driver). */ michael@0: /* */ michael@0: /* Client applications are expected to know what they are doing */ michael@0: /* when invoking this function. Most drivers simply do not implement */ michael@0: /* file attachments. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Attach_Stream( FT_Face face, michael@0: FT_Open_Args* parameters ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Reference_Face */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A counter gets initialized to~1 at the time an @FT_Face structure */ michael@0: /* is created. This function increments the counter. @FT_Done_Face */ michael@0: /* then only destroys a face if the counter is~1, otherwise it simply */ michael@0: /* decrements the counter. */ michael@0: /* */ michael@0: /* This function helps in managing life-cycles of structures that */ michael@0: /* reference @FT_Face objects. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A handle to a target face object. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Since> */ michael@0: /* 2.4.2 */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Reference_Face( FT_Face face ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Done_Face */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Discard a given face object, as well as all of its child slots and */ michael@0: /* sizes. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A handle to a target face object. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* See the discussion of reference counters in the description of */ michael@0: /* @FT_Reference_Face. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Done_Face( FT_Face face ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Select_Size */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Select a bitmap strike. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* face :: A handle to a target face object. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* strike_index :: The index of the bitmap strike in the */ michael@0: /* `available_sizes' field of @FT_FaceRec structure. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Select_Size( FT_Face face, michael@0: FT_Int strike_index ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Enum> */ michael@0: /* FT_Size_Request_Type */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* An enumeration type that lists the supported size request types. */ michael@0: /* */ michael@0: /* <Values> */ michael@0: /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */ michael@0: /* The nominal size. The `units_per_EM' field of @FT_FaceRec is */ michael@0: /* used to determine both scaling values. */ michael@0: /* */ michael@0: /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */ michael@0: /* The real dimension. The sum of the the `ascender' and (minus */ michael@0: /* of) the `descender' fields of @FT_FaceRec are used to determine */ michael@0: /* both scaling values. */ michael@0: /* */ michael@0: /* FT_SIZE_REQUEST_TYPE_BBOX :: */ michael@0: /* The font bounding box. The width and height of the `bbox' field */ michael@0: /* of @FT_FaceRec are used to determine the horizontal and vertical */ michael@0: /* scaling value, respectively. */ michael@0: /* */ michael@0: /* FT_SIZE_REQUEST_TYPE_CELL :: */ michael@0: /* The `max_advance_width' field of @FT_FaceRec is used to */ michael@0: /* determine the horizontal scaling value; the vertical scaling */ michael@0: /* value is determined the same way as */ michael@0: /* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */ michael@0: /* values are set to the smaller one. This type is useful if you */ michael@0: /* want to specify the font size for, say, a window of a given */ michael@0: /* dimension and 80x24 cells. */ michael@0: /* */ michael@0: /* FT_SIZE_REQUEST_TYPE_SCALES :: */ michael@0: /* Specify the scaling values directly. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The above descriptions only apply to scalable formats. For bitmap */ michael@0: /* formats, the behaviour is up to the driver. */ michael@0: /* */ michael@0: /* See the note section of @FT_Size_Metrics if you wonder how size */ michael@0: /* requesting relates to scaling values. */ michael@0: /* */ michael@0: typedef enum FT_Size_Request_Type_ michael@0: { michael@0: FT_SIZE_REQUEST_TYPE_NOMINAL, michael@0: FT_SIZE_REQUEST_TYPE_REAL_DIM, michael@0: FT_SIZE_REQUEST_TYPE_BBOX, michael@0: FT_SIZE_REQUEST_TYPE_CELL, michael@0: FT_SIZE_REQUEST_TYPE_SCALES, michael@0: michael@0: FT_SIZE_REQUEST_TYPE_MAX michael@0: michael@0: } FT_Size_Request_Type; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Struct> */ michael@0: /* FT_Size_RequestRec */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A structure used to model a size request. */ michael@0: /* */ michael@0: /* <Fields> */ michael@0: /* type :: See @FT_Size_Request_Type. */ michael@0: /* */ michael@0: /* width :: The desired width. */ michael@0: /* */ michael@0: /* height :: The desired height. */ michael@0: /* */ michael@0: /* horiResolution :: The horizontal resolution. If set to zero, */ michael@0: /* `width' is treated as a 26.6 fractional pixel */ michael@0: /* value. */ michael@0: /* */ michael@0: /* vertResolution :: The vertical resolution. If set to zero, */ michael@0: /* `height' is treated as a 26.6 fractional pixel */ michael@0: /* value. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* If `width' is zero, then the horizontal scaling value is set equal */ michael@0: /* to the vertical scaling value, and vice versa. */ michael@0: /* */ michael@0: typedef struct FT_Size_RequestRec_ michael@0: { michael@0: FT_Size_Request_Type type; michael@0: FT_Long width; michael@0: FT_Long height; michael@0: FT_UInt horiResolution; michael@0: FT_UInt vertResolution; michael@0: michael@0: } FT_Size_RequestRec; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Struct> */ michael@0: /* FT_Size_Request */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A handle to a size request structure. */ michael@0: /* */ michael@0: typedef struct FT_Size_RequestRec_ *FT_Size_Request; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Request_Size */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Resize the scale of the active @FT_Size object in a face. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* face :: A handle to a target face object. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* req :: A pointer to a @FT_Size_RequestRec. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Although drivers may select the bitmap strike matching the */ michael@0: /* request, you should not rely on this if you intend to select a */ michael@0: /* particular bitmap strike. Use @FT_Select_Size instead in that */ michael@0: /* case. */ michael@0: /* */ michael@0: /* The relation between the requested size and the resulting glyph */ michael@0: /* size is dependent entirely on how the size is defined in the */ michael@0: /* source face. The font designer chooses the final size of each */ michael@0: /* glyph relative to this size. For more information refer to */ michael@0: /* `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html' */ michael@0: /* */ michael@0: /* Don't use this function if you are using the FreeType cache API. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Request_Size( FT_Face face, michael@0: FT_Size_Request req ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Set_Char_Size */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This function calls @FT_Request_Size to request the nominal size */ michael@0: /* (in points). */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* face :: A handle to a target face object. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* char_width :: The nominal width, in 26.6 fractional points. */ michael@0: /* */ michael@0: /* char_height :: The nominal height, in 26.6 fractional points. */ michael@0: /* */ michael@0: /* horz_resolution :: The horizontal resolution in dpi. */ michael@0: /* */ michael@0: /* vert_resolution :: The vertical resolution in dpi. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* If either the character width or height is zero, it is set equal */ michael@0: /* to the other value. */ michael@0: /* */ michael@0: /* If either the horizontal or vertical resolution is zero, it is set */ michael@0: /* equal to the other value. */ michael@0: /* */ michael@0: /* A character width or height smaller than 1pt is set to 1pt; if */ michael@0: /* both resolution values are zero, they are set to 72dpi. */ michael@0: /* */ michael@0: /* Don't use this function if you are using the FreeType cache API. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Set_Char_Size( FT_Face face, michael@0: FT_F26Dot6 char_width, michael@0: FT_F26Dot6 char_height, michael@0: FT_UInt horz_resolution, michael@0: FT_UInt vert_resolution ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Set_Pixel_Sizes */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This function calls @FT_Request_Size to request the nominal size */ michael@0: /* (in pixels). */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* face :: A handle to the target face object. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* pixel_width :: The nominal width, in pixels. */ michael@0: /* */ michael@0: /* pixel_height :: The nominal height, in pixels. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* You should not rely on the resulting glyphs matching, or being */ michael@0: /* constrained, to this pixel size. Refer to @FT_Request_Size to */ michael@0: /* understand how requested sizes relate to actual sizes. */ michael@0: /* */ michael@0: /* Don't use this function if you are using the FreeType cache API. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Set_Pixel_Sizes( FT_Face face, michael@0: FT_UInt pixel_width, michael@0: FT_UInt pixel_height ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Load_Glyph */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A function used to load a single glyph into the glyph slot of a */ michael@0: /* face object. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* face :: A handle to the target face object where the glyph */ michael@0: /* is loaded. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* glyph_index :: The index of the glyph in the font file. For */ michael@0: /* CID-keyed fonts (either in PS or in CFF format) */ michael@0: /* this argument specifies the CID value. */ michael@0: /* */ michael@0: /* load_flags :: A flag indicating what to load for this glyph. The */ michael@0: /* @FT_LOAD_XXX constants can be used to control the */ michael@0: /* glyph loading process (e.g., whether the outline */ michael@0: /* should be scaled, whether to load bitmaps or not, */ michael@0: /* whether to hint the outline, etc). */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The loaded glyph may be transformed. See @FT_Set_Transform for */ michael@0: /* the details. */ michael@0: /* */ michael@0: /* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */ michael@0: /* returned for invalid CID values (this is, for CID values that */ michael@0: /* don't have a corresponding glyph in the font). See the discussion */ michael@0: /* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Load_Glyph( FT_Face face, michael@0: FT_UInt glyph_index, michael@0: FT_Int32 load_flags ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Load_Char */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A function used to load a single glyph into the glyph slot of a */ michael@0: /* face object, according to its character code. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* face :: A handle to a target face object where the glyph */ michael@0: /* is loaded. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* char_code :: The glyph's character code, according to the */ michael@0: /* current charmap used in the face. */ michael@0: /* */ michael@0: /* load_flags :: A flag indicating what to load for this glyph. The */ michael@0: /* @FT_LOAD_XXX constants can be used to control the */ michael@0: /* glyph loading process (e.g., whether the outline */ michael@0: /* should be scaled, whether to load bitmaps or not, */ michael@0: /* whether to hint the outline, etc). */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Load_Char( FT_Face face, michael@0: FT_ULong char_code, michael@0: FT_Int32 load_flags ); michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @enum: michael@0: * FT_LOAD_XXX michael@0: * michael@0: * @description: michael@0: * A list of bit-field constants used with @FT_Load_Glyph to indicate michael@0: * what kind of operations to perform during glyph loading. michael@0: * michael@0: * @values: michael@0: * FT_LOAD_DEFAULT :: michael@0: * Corresponding to~0, this value is used as the default glyph load michael@0: * operation. In this case, the following happens: michael@0: * michael@0: * 1. FreeType looks for a bitmap for the glyph corresponding to the michael@0: * face's current size. If one is found, the function returns. michael@0: * The bitmap data can be accessed from the glyph slot (see note michael@0: * below). michael@0: * michael@0: * 2. If no embedded bitmap is searched or found, FreeType looks for a michael@0: * scalable outline. If one is found, it is loaded from the font michael@0: * file, scaled to device pixels, then `hinted' to the pixel grid michael@0: * in order to optimize it. The outline data can be accessed from michael@0: * the glyph slot (see note below). michael@0: * michael@0: * Note that by default, the glyph loader doesn't render outlines into michael@0: * bitmaps. The following flags are used to modify this default michael@0: * behaviour to more specific and useful cases. michael@0: * michael@0: * FT_LOAD_NO_SCALE :: michael@0: * Don't scale the loaded outline glyph but keep it in font units. michael@0: * michael@0: * This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and michael@0: * unsets @FT_LOAD_RENDER. michael@0: * michael@0: * If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using michael@0: * FT_LOAD_NO_SCALE usually yields meaningless outlines because the michael@0: * subglyphs must be scaled and positioned with hinting instructions. michael@0: * This can be solved by loading the font without FT_LOAD_NO_SCALE and michael@0: * setting the character size to `font->units_per_EM'. michael@0: * michael@0: * FT_LOAD_NO_HINTING :: michael@0: * Disable hinting. This generally generates `blurrier' bitmap glyphs michael@0: * when the glyph are rendered in any of the anti-aliased modes. See michael@0: * also the note below. michael@0: * michael@0: * This flag is implied by @FT_LOAD_NO_SCALE. michael@0: * michael@0: * FT_LOAD_RENDER :: michael@0: * Call @FT_Render_Glyph after the glyph is loaded. By default, the michael@0: * glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be michael@0: * overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME. michael@0: * michael@0: * This flag is unset by @FT_LOAD_NO_SCALE. michael@0: * michael@0: * FT_LOAD_NO_BITMAP :: michael@0: * Ignore bitmap strikes when loading. Bitmap-only fonts ignore this michael@0: * flag. michael@0: * michael@0: * @FT_LOAD_NO_SCALE always sets this flag. michael@0: * michael@0: * FT_LOAD_VERTICAL_LAYOUT :: michael@0: * Load the glyph for vertical text layout. In particular, the michael@0: * `advance' value in the @FT_GlyphSlotRec structure is set to the michael@0: * `vertAdvance' value of the `metrics' field. michael@0: * michael@0: * In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use michael@0: * this flag currently. Reason is that in this case vertical metrics michael@0: * get synthesized, and those values are not always consistent across michael@0: * various font formats. michael@0: * michael@0: * FT_LOAD_FORCE_AUTOHINT :: michael@0: * Indicates that the auto-hinter is preferred over the font's native michael@0: * hinter. See also the note below. michael@0: * michael@0: * FT_LOAD_CROP_BITMAP :: michael@0: * Indicates that the font driver should crop the loaded bitmap glyph michael@0: * (i.e., remove all space around its black bits). Not all drivers michael@0: * implement this. michael@0: * michael@0: * FT_LOAD_PEDANTIC :: michael@0: * Indicates that the font driver should perform pedantic verifications michael@0: * during glyph loading. This is mostly used to detect broken glyphs michael@0: * in fonts. By default, FreeType tries to handle broken fonts also. michael@0: * michael@0: * In particular, errors from the TrueType bytecode engine are not michael@0: * passed to the application if this flag is not set; this might michael@0: * result in partially hinted or distorted glyphs in case a glyph's michael@0: * bytecode is buggy. michael@0: * michael@0: * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH :: michael@0: * Ignored. Deprecated. michael@0: * michael@0: * FT_LOAD_NO_RECURSE :: michael@0: * This flag is only used internally. It merely indicates that the michael@0: * font driver should not load composite glyphs recursively. Instead, michael@0: * it should set the `num_subglyph' and `subglyphs' values of the michael@0: * glyph slot accordingly, and set `glyph->format' to michael@0: * @FT_GLYPH_FORMAT_COMPOSITE. michael@0: * michael@0: * The description of sub-glyphs is not available to client michael@0: * applications for now. michael@0: * michael@0: * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM. michael@0: * michael@0: * FT_LOAD_IGNORE_TRANSFORM :: michael@0: * Indicates that the transform matrix set by @FT_Set_Transform should michael@0: * be ignored. michael@0: * michael@0: * FT_LOAD_MONOCHROME :: michael@0: * This flag is used with @FT_LOAD_RENDER to indicate that you want to michael@0: * render an outline glyph to a 1-bit monochrome bitmap glyph, with michael@0: * 8~pixels packed into each byte of the bitmap data. michael@0: * michael@0: * Note that this has no effect on the hinting algorithm used. You michael@0: * should rather use @FT_LOAD_TARGET_MONO so that the michael@0: * monochrome-optimized hinting algorithm is used. michael@0: * michael@0: * FT_LOAD_LINEAR_DESIGN :: michael@0: * Indicates that the `linearHoriAdvance' and `linearVertAdvance' michael@0: * fields of @FT_GlyphSlotRec should be kept in font units. See michael@0: * @FT_GlyphSlotRec for details. michael@0: * michael@0: * FT_LOAD_NO_AUTOHINT :: michael@0: * Disable auto-hinter. See also the note below. michael@0: * michael@0: * FT_LOAD_COLOR :: michael@0: * This flag is used to request loading of color embedded-bitmap michael@0: * images. The resulting color bitmaps, if available, will have the michael@0: * @FT_PIXEL_MODE_BGRA format. When the flag is not used and color michael@0: * bitmaps are found, they will be converted to 256-level gray michael@0: * bitmaps transparently. Those bitmaps will be in the michael@0: * @FT_PIXEL_MODE_GRAY format. michael@0: * michael@0: * @note: michael@0: * By default, hinting is enabled and the font's native hinter (see michael@0: * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can michael@0: * disable hinting by setting @FT_LOAD_NO_HINTING or change the michael@0: * precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set michael@0: * @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be michael@0: * used at all. michael@0: * michael@0: * See the description of @FT_FACE_FLAG_TRICKY for a special exception michael@0: * (affecting only a handful of Asian fonts). michael@0: * michael@0: * Besides deciding which hinter to use, you can also decide which michael@0: * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details. michael@0: * michael@0: * Note that the auto-hinter needs a valid Unicode cmap (either a native michael@0: * one or synthesized by FreeType) for producing correct results. If a michael@0: * font provides an incorrect mapping (for example, assigning the michael@0: * character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a michael@0: * mathematical integral sign), the auto-hinter might produce useless michael@0: * results. michael@0: * michael@0: */ michael@0: #define FT_LOAD_DEFAULT 0x0 michael@0: #define FT_LOAD_NO_SCALE ( 1L << 0 ) michael@0: #define FT_LOAD_NO_HINTING ( 1L << 1 ) michael@0: #define FT_LOAD_RENDER ( 1L << 2 ) michael@0: #define FT_LOAD_NO_BITMAP ( 1L << 3 ) michael@0: #define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 ) michael@0: #define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 ) michael@0: #define FT_LOAD_CROP_BITMAP ( 1L << 6 ) michael@0: #define FT_LOAD_PEDANTIC ( 1L << 7 ) michael@0: #define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 ) michael@0: #define FT_LOAD_NO_RECURSE ( 1L << 10 ) michael@0: #define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 ) michael@0: #define FT_LOAD_MONOCHROME ( 1L << 12 ) michael@0: #define FT_LOAD_LINEAR_DESIGN ( 1L << 13 ) michael@0: #define FT_LOAD_NO_AUTOHINT ( 1L << 15 ) michael@0: /* Bits 16..19 are used by `FT_LOAD_TARGET_' */ michael@0: #define FT_LOAD_COLOR ( 1L << 20 ) michael@0: michael@0: /* */ michael@0: michael@0: /* used internally only by certain font drivers! */ michael@0: #define FT_LOAD_ADVANCE_ONLY ( 1L << 8 ) michael@0: #define FT_LOAD_SBITS_ONLY ( 1L << 14 ) michael@0: michael@0: michael@0: /************************************************************************** michael@0: * michael@0: * @enum: michael@0: * FT_LOAD_TARGET_XXX michael@0: * michael@0: * @description: michael@0: * A list of values that are used to select a specific hinting algorithm michael@0: * to use by the hinter. You should OR one of these values to your michael@0: * `load_flags' when calling @FT_Load_Glyph. michael@0: * michael@0: * Note that font's native hinters may ignore the hinting algorithm you michael@0: * have specified (e.g., the TrueType bytecode interpreter). You can set michael@0: * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used. michael@0: * michael@0: * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it michael@0: * always implies @FT_LOAD_FORCE_AUTOHINT. michael@0: * michael@0: * @values: michael@0: * FT_LOAD_TARGET_NORMAL :: michael@0: * This corresponds to the default hinting algorithm, optimized for michael@0: * standard gray-level rendering. For monochrome output, use michael@0: * @FT_LOAD_TARGET_MONO instead. michael@0: * michael@0: * FT_LOAD_TARGET_LIGHT :: michael@0: * A lighter hinting algorithm for non-monochrome modes. Many michael@0: * generated glyphs are more fuzzy but better resemble its original michael@0: * shape. A bit like rendering on Mac OS~X. michael@0: * michael@0: * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT. michael@0: * michael@0: * FT_LOAD_TARGET_MONO :: michael@0: * Strong hinting algorithm that should only be used for monochrome michael@0: * output. The result is probably unpleasant if the glyph is rendered michael@0: * in non-monochrome modes. michael@0: * michael@0: * FT_LOAD_TARGET_LCD :: michael@0: * A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally michael@0: * decimated LCD displays. michael@0: * michael@0: * FT_LOAD_TARGET_LCD_V :: michael@0: * A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically michael@0: * decimated LCD displays. michael@0: * michael@0: * @note: michael@0: * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your michael@0: * `load_flags'. They can't be ORed. michael@0: * michael@0: * If @FT_LOAD_RENDER is also set, the glyph is rendered in the michael@0: * corresponding mode (i.e., the mode that matches the used algorithm michael@0: * best). An exeption is FT_LOAD_TARGET_MONO since it implies michael@0: * @FT_LOAD_MONOCHROME. michael@0: * michael@0: * You can use a hinting algorithm that doesn't correspond to the same michael@0: * rendering mode. As an example, it is possible to use the `light' michael@0: * hinting algorithm and have the results rendered in horizontal LCD michael@0: * pixel mode, with code like michael@0: * michael@0: * { michael@0: * FT_Load_Glyph( face, glyph_index, michael@0: * load_flags | FT_LOAD_TARGET_LIGHT ); michael@0: * michael@0: * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD ); michael@0: * } michael@0: * michael@0: */ michael@0: #define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 ) michael@0: michael@0: #define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) michael@0: #define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) michael@0: #define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ) michael@0: #define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD ) michael@0: #define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V ) michael@0: michael@0: michael@0: /************************************************************************** michael@0: * michael@0: * @macro: michael@0: * FT_LOAD_TARGET_MODE michael@0: * michael@0: * @description: michael@0: * Return the @FT_Render_Mode corresponding to a given michael@0: * @FT_LOAD_TARGET_XXX value. michael@0: * michael@0: */ michael@0: #define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) ) michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Set_Transform */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A function used to set the transformation that is applied to glyph */ michael@0: /* images when they are loaded into a glyph slot through */ michael@0: /* @FT_Load_Glyph. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* face :: A handle to the source face object. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */ michael@0: /* the identity matrix. */ michael@0: /* delta :: A pointer to the translation vector. Use~0 for the null */ michael@0: /* vector. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The transformation is only applied to scalable image formats after */ michael@0: /* the glyph has been loaded. It means that hinting is unaltered by */ michael@0: /* the transformation and is performed on the character size given in */ michael@0: /* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */ michael@0: /* */ michael@0: /* Note that this also transforms the `face.glyph.advance' field, but */ michael@0: /* *not* the values in `face.glyph.metrics'. */ michael@0: /* */ michael@0: FT_EXPORT( void ) michael@0: FT_Set_Transform( FT_Face face, michael@0: FT_Matrix* matrix, michael@0: FT_Vector* delta ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Enum> */ michael@0: /* FT_Render_Mode */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* An enumeration type that lists the render modes supported by */ michael@0: /* FreeType~2. Each mode corresponds to a specific type of scanline */ michael@0: /* conversion performed on the outline. */ michael@0: /* */ michael@0: /* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */ michael@0: /* field in the @FT_GlyphSlotRec structure gives the format of the */ michael@0: /* returned bitmap. */ michael@0: /* */ michael@0: /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */ michael@0: /* */ michael@0: /* <Values> */ michael@0: /* FT_RENDER_MODE_NORMAL :: */ michael@0: /* This is the default render mode; it corresponds to 8-bit */ michael@0: /* anti-aliased bitmaps. */ michael@0: /* */ michael@0: /* FT_RENDER_MODE_LIGHT :: */ michael@0: /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */ michael@0: /* defined as a separate value because render modes are also used */ michael@0: /* indirectly to define hinting algorithm selectors. See */ michael@0: /* @FT_LOAD_TARGET_XXX for details. */ michael@0: /* */ michael@0: /* FT_RENDER_MODE_MONO :: */ michael@0: /* This mode corresponds to 1-bit bitmaps (with 2~levels of */ michael@0: /* opacity). */ michael@0: /* */ michael@0: /* FT_RENDER_MODE_LCD :: */ michael@0: /* This mode corresponds to horizontal RGB and BGR sub-pixel */ michael@0: /* displays like LCD screens. It produces 8-bit bitmaps that are */ michael@0: /* 3~times the width of the original glyph outline in pixels, and */ michael@0: /* which use the @FT_PIXEL_MODE_LCD mode. */ michael@0: /* */ michael@0: /* FT_RENDER_MODE_LCD_V :: */ michael@0: /* This mode corresponds to vertical RGB and BGR sub-pixel displays */ michael@0: /* (like PDA screens, rotated LCD displays, etc.). It produces */ michael@0: /* 8-bit bitmaps that are 3~times the height of the original */ michael@0: /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */ michael@0: /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */ michael@0: /* (not active in the default builds). It is up to the caller to */ michael@0: /* either call @FT_Library_SetLcdFilter (if available) or do the */ michael@0: /* filtering itself. */ michael@0: /* */ michael@0: /* The selected render mode only affects vector glyphs of a font. */ michael@0: /* Embedded bitmaps often have a different pixel mode like */ michael@0: /* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */ michael@0: /* them into 8-bit pixmaps. */ michael@0: /* */ michael@0: typedef enum FT_Render_Mode_ michael@0: { michael@0: FT_RENDER_MODE_NORMAL = 0, michael@0: FT_RENDER_MODE_LIGHT, michael@0: FT_RENDER_MODE_MONO, michael@0: FT_RENDER_MODE_LCD, michael@0: FT_RENDER_MODE_LCD_V, michael@0: michael@0: FT_RENDER_MODE_MAX michael@0: michael@0: } FT_Render_Mode; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Enum> */ michael@0: /* ft_render_mode_xxx */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* These constants are deprecated. Use the corresponding */ michael@0: /* @FT_Render_Mode values instead. */ michael@0: /* */ michael@0: /* <Values> */ michael@0: /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */ michael@0: /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */ michael@0: /* */ michael@0: #define ft_render_mode_normal FT_RENDER_MODE_NORMAL michael@0: #define ft_render_mode_mono FT_RENDER_MODE_MONO michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Render_Glyph */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Convert a given glyph image to a bitmap. It does so by inspecting */ michael@0: /* the glyph image format, finding the relevant renderer, and */ michael@0: /* invoking it. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* slot :: A handle to the glyph slot containing the image to */ michael@0: /* convert. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* render_mode :: This is the render mode used to render the glyph */ michael@0: /* image into a bitmap. See @FT_Render_Mode for a */ michael@0: /* list of possible values. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* To get meaningful results, font scaling values must be set with */ michael@0: /* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Render_Glyph( FT_GlyphSlot slot, michael@0: FT_Render_Mode render_mode ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Enum> */ michael@0: /* FT_Kerning_Mode */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* An enumeration used to specify which kerning values to return in */ michael@0: /* @FT_Get_Kerning. */ michael@0: /* */ michael@0: /* <Values> */ michael@0: /* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */ michael@0: /* distances (value is~0). */ michael@0: /* */ michael@0: /* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */ michael@0: /* distances. */ michael@0: /* */ michael@0: /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */ michael@0: /* units. */ michael@0: /* */ michael@0: typedef enum FT_Kerning_Mode_ michael@0: { michael@0: FT_KERNING_DEFAULT = 0, michael@0: FT_KERNING_UNFITTED, michael@0: FT_KERNING_UNSCALED michael@0: michael@0: } FT_Kerning_Mode; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Const> */ michael@0: /* ft_kerning_default */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This constant is deprecated. Please use @FT_KERNING_DEFAULT */ michael@0: /* instead. */ michael@0: /* */ michael@0: #define ft_kerning_default FT_KERNING_DEFAULT michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Const> */ michael@0: /* ft_kerning_unfitted */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This constant is deprecated. Please use @FT_KERNING_UNFITTED */ michael@0: /* instead. */ michael@0: /* */ michael@0: #define ft_kerning_unfitted FT_KERNING_UNFITTED michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Const> */ michael@0: /* ft_kerning_unscaled */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This constant is deprecated. Please use @FT_KERNING_UNSCALED */ michael@0: /* instead. */ michael@0: /* */ michael@0: #define ft_kerning_unscaled FT_KERNING_UNSCALED michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Get_Kerning */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Return the kerning vector between two glyphs of a same face. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A handle to a source face object. */ michael@0: /* */ michael@0: /* left_glyph :: The index of the left glyph in the kern pair. */ michael@0: /* */ michael@0: /* right_glyph :: The index of the right glyph in the kern pair. */ michael@0: /* */ michael@0: /* kern_mode :: See @FT_Kerning_Mode for more information. */ michael@0: /* Determines the scale and dimension of the returned */ michael@0: /* kerning vector. */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* akerning :: The kerning vector. This is either in font units */ michael@0: /* or in pixels (26.6 format) for scalable formats, */ michael@0: /* and in pixels for fixed-sizes formats. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Only horizontal layouts (left-to-right & right-to-left) are */ michael@0: /* supported by this method. Other layouts, or more sophisticated */ michael@0: /* kernings, are out of the scope of this API function -- they can be */ michael@0: /* implemented through format-specific interfaces. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Get_Kerning( FT_Face face, michael@0: FT_UInt left_glyph, michael@0: FT_UInt right_glyph, michael@0: FT_UInt kern_mode, michael@0: FT_Vector *akerning ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Get_Track_Kerning */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Return the track kerning for a given face object at a given size. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A handle to a source face object. */ michael@0: /* */ michael@0: /* point_size :: The point size in 16.16 fractional points. */ michael@0: /* */ michael@0: /* degree :: The degree of tightness. Increasingly negative */ michael@0: /* values represent tighter track kerning, while */ michael@0: /* increasingly positive values represent looser track */ michael@0: /* kerning. Value zero means no track kerning. */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* akerning :: The kerning in 16.16 fractional points, to be */ michael@0: /* uniformly applied between all glyphs. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Currently, only the Type~1 font driver supports track kerning, */ michael@0: /* using data from AFM files (if attached with @FT_Attach_File or */ michael@0: /* @FT_Attach_Stream). */ michael@0: /* */ michael@0: /* Only very few AFM files come with track kerning data; please refer */ michael@0: /* to the Adobe's AFM specification for more details. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Get_Track_Kerning( FT_Face face, michael@0: FT_Fixed point_size, michael@0: FT_Int degree, michael@0: FT_Fixed* akerning ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Get_Glyph_Name */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Retrieve the ASCII name of a given glyph in a face. This only */ michael@0: /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A handle to a source face object. */ michael@0: /* */ michael@0: /* glyph_index :: The glyph index. */ michael@0: /* */ michael@0: /* buffer_max :: The maximum number of bytes available in the */ michael@0: /* buffer. */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* buffer :: A pointer to a target buffer where the name is */ michael@0: /* copied to. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* An error is returned if the face doesn't provide glyph names or if */ michael@0: /* the glyph index is invalid. In all cases of failure, the first */ michael@0: /* byte of `buffer' is set to~0 to indicate an empty name. */ michael@0: /* */ michael@0: /* The glyph name is truncated to fit within the buffer if it is too */ michael@0: /* long. The returned string is always zero-terminated. */ michael@0: /* */ michael@0: /* Be aware that FreeType reorders glyph indices internally so that */ michael@0: /* glyph index~0 always corresponds to the `missing glyph' (called */ michael@0: /* `.notdef'). */ michael@0: /* */ michael@0: /* This function is not compiled within the library if the config */ michael@0: /* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */ michael@0: /* `ftoptions.h'. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Get_Glyph_Name( FT_Face face, michael@0: FT_UInt glyph_index, michael@0: FT_Pointer buffer, michael@0: FT_UInt buffer_max ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Get_Postscript_Name */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Retrieve the ASCII PostScript name of a given face, if available. */ michael@0: /* This only works with PostScript and TrueType fonts. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A handle to the source face object. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* A pointer to the face's PostScript name. NULL if unavailable. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The returned pointer is owned by the face and is destroyed with */ michael@0: /* it. */ michael@0: /* */ michael@0: FT_EXPORT( const char* ) michael@0: FT_Get_Postscript_Name( FT_Face face ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Select_Charmap */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Select a given charmap by its encoding tag (as listed in */ michael@0: /* `freetype.h'). */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* face :: A handle to the source face object. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* encoding :: A handle to the selected encoding. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* This function returns an error if no charmap in the face */ michael@0: /* corresponds to the encoding queried here. */ michael@0: /* */ michael@0: /* Because many fonts contain more than a single cmap for Unicode */ michael@0: /* encoding, this function has some special code to select the one */ michael@0: /* that covers Unicode best (`best' in the sense that a UCS-4 cmap is */ michael@0: /* preferred to a UCS-2 cmap). It is thus preferable to */ michael@0: /* @FT_Set_Charmap in this case. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Select_Charmap( FT_Face face, michael@0: FT_Encoding encoding ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Set_Charmap */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Select a given charmap for character code to glyph index mapping. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* face :: A handle to the source face object. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* charmap :: A handle to the selected charmap. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* This function returns an error if the charmap is not part of */ michael@0: /* the face (i.e., if it is not listed in the `face->charmaps' */ michael@0: /* table). */ michael@0: /* */ michael@0: /* It also fails if a type~14 charmap is selected. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Set_Charmap( FT_Face face, michael@0: FT_CharMap charmap ); michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @function: michael@0: * FT_Get_Charmap_Index michael@0: * michael@0: * @description: michael@0: * Retrieve index of a given charmap. michael@0: * michael@0: * @input: michael@0: * charmap :: michael@0: * A handle to a charmap. michael@0: * michael@0: * @return: michael@0: * The index into the array of character maps within the face to which michael@0: * `charmap' belongs. If an error occurs, -1 is returned. michael@0: * michael@0: */ michael@0: FT_EXPORT( FT_Int ) michael@0: FT_Get_Charmap_Index( FT_CharMap charmap ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Get_Char_Index */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Return the glyph index of a given character code. This function */ michael@0: /* uses a charmap object to do the mapping. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A handle to the source face object. */ michael@0: /* */ michael@0: /* charcode :: The character code. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* The glyph index. 0~means `undefined character code'. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* If you use FreeType to manipulate the contents of font files */ michael@0: /* directly, be aware that the glyph index returned by this function */ michael@0: /* doesn't always correspond to the internal indices used within the */ michael@0: /* file. This is done to ensure that value~0 always corresponds to */ michael@0: /* the `missing glyph'. If the first glyph is not named `.notdef', */ michael@0: /* then for Type~1 and Type~42 fonts, `.notdef' will be moved into */ michael@0: /* the glyph ID~0 position, and whatever was there will be moved to */ michael@0: /* the position `.notdef' had. For Type~1 fonts, if there is no */ michael@0: /* `.notdef' glyph at all, then one will be created at index~0 and */ michael@0: /* whatever was there will be moved to the last index -- Type~42 */ michael@0: /* fonts are considered invalid under this condition. */ michael@0: /* */ michael@0: FT_EXPORT( FT_UInt ) michael@0: FT_Get_Char_Index( FT_Face face, michael@0: FT_ULong charcode ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Get_First_Char */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This function is used to return the first character code in the */ michael@0: /* current charmap of a given face. It also returns the */ michael@0: /* corresponding glyph index. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A handle to the source face object. */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* agindex :: Glyph index of first character code. 0~if charmap is */ michael@0: /* empty. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* The charmap's first character code. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* You should use this function with @FT_Get_Next_Char to be able to */ michael@0: /* parse all character codes available in a given charmap. The code */ michael@0: /* should look like this: */ michael@0: /* */ michael@0: /* { */ michael@0: /* FT_ULong charcode; */ michael@0: /* FT_UInt gindex; */ michael@0: /* */ michael@0: /* */ michael@0: /* charcode = FT_Get_First_Char( face, &gindex ); */ michael@0: /* while ( gindex != 0 ) */ michael@0: /* { */ michael@0: /* ... do something with (charcode,gindex) pair ... */ michael@0: /* */ michael@0: /* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */ michael@0: /* } */ michael@0: /* } */ michael@0: /* */ michael@0: /* Note that `*agindex' is set to~0 if the charmap is empty. The */ michael@0: /* result itself can be~0 in two cases: if the charmap is empty or */ michael@0: /* if the value~0 is the first valid character code. */ michael@0: /* */ michael@0: FT_EXPORT( FT_ULong ) michael@0: FT_Get_First_Char( FT_Face face, michael@0: FT_UInt *agindex ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Get_Next_Char */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This function is used to return the next character code in the */ michael@0: /* current charmap of a given face following the value `char_code', */ michael@0: /* as well as the corresponding glyph index. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A handle to the source face object. */ michael@0: /* char_code :: The starting character code. */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* agindex :: Glyph index of next character code. 0~if charmap */ michael@0: /* is empty. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* The charmap's next character code. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* You should use this function with @FT_Get_First_Char to walk */ michael@0: /* over all character codes available in a given charmap. See the */ michael@0: /* note for this function for a simple code example. */ michael@0: /* */ michael@0: /* Note that `*agindex' is set to~0 when there are no more codes in */ michael@0: /* the charmap. */ michael@0: /* */ michael@0: FT_EXPORT( FT_ULong ) michael@0: FT_Get_Next_Char( FT_Face face, michael@0: FT_ULong char_code, michael@0: FT_UInt *agindex ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Get_Name_Index */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Return the glyph index of a given glyph name. This function uses */ michael@0: /* driver specific objects to do the translation. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A handle to the source face object. */ michael@0: /* */ michael@0: /* glyph_name :: The glyph name. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* The glyph index. 0~means `undefined character code'. */ michael@0: /* */ michael@0: FT_EXPORT( FT_UInt ) michael@0: FT_Get_Name_Index( FT_Face face, michael@0: FT_String* glyph_name ); michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @macro: michael@0: * FT_SUBGLYPH_FLAG_XXX michael@0: * michael@0: * @description: michael@0: * A list of constants used to describe subglyphs. Please refer to the michael@0: * TrueType specification for the meaning of the various flags. michael@0: * michael@0: * @values: michael@0: * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS :: michael@0: * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES :: michael@0: * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID :: michael@0: * FT_SUBGLYPH_FLAG_SCALE :: michael@0: * FT_SUBGLYPH_FLAG_XY_SCALE :: michael@0: * FT_SUBGLYPH_FLAG_2X2 :: michael@0: * FT_SUBGLYPH_FLAG_USE_MY_METRICS :: michael@0: * michael@0: */ michael@0: #define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1 michael@0: #define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2 michael@0: #define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4 michael@0: #define FT_SUBGLYPH_FLAG_SCALE 8 michael@0: #define FT_SUBGLYPH_FLAG_XY_SCALE 0x40 michael@0: #define FT_SUBGLYPH_FLAG_2X2 0x80 michael@0: #define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200 michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @func: michael@0: * FT_Get_SubGlyph_Info michael@0: * michael@0: * @description: michael@0: * Retrieve a description of a given subglyph. Only use it if michael@0: * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is michael@0: * returned otherwise. michael@0: * michael@0: * @input: michael@0: * glyph :: michael@0: * The source glyph slot. michael@0: * michael@0: * sub_index :: michael@0: * The index of the subglyph. Must be less than michael@0: * `glyph->num_subglyphs'. michael@0: * michael@0: * @output: michael@0: * p_index :: michael@0: * The glyph index of the subglyph. michael@0: * michael@0: * p_flags :: michael@0: * The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX. michael@0: * michael@0: * p_arg1 :: michael@0: * The subglyph's first argument (if any). michael@0: * michael@0: * p_arg2 :: michael@0: * The subglyph's second argument (if any). michael@0: * michael@0: * p_transform :: michael@0: * The subglyph transformation (if any). michael@0: * michael@0: * @return: michael@0: * FreeType error code. 0~means success. michael@0: * michael@0: * @note: michael@0: * The values of `*p_arg1', `*p_arg2', and `*p_transform' must be michael@0: * interpreted depending on the flags returned in `*p_flags'. See the michael@0: * TrueType specification for details. michael@0: * michael@0: */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Get_SubGlyph_Info( FT_GlyphSlot glyph, michael@0: FT_UInt sub_index, michael@0: FT_Int *p_index, michael@0: FT_UInt *p_flags, michael@0: FT_Int *p_arg1, michael@0: FT_Int *p_arg2, michael@0: FT_Matrix *p_transform ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Enum> */ michael@0: /* FT_FSTYPE_XXX */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A list of bit flags used in the `fsType' field of the OS/2 table */ michael@0: /* in a TrueType or OpenType font and the `FSType' entry in a */ michael@0: /* PostScript font. These bit flags are returned by */ michael@0: /* @FT_Get_FSType_Flags; they inform client applications of embedding */ michael@0: /* and subsetting restrictions associated with a font. */ michael@0: /* */ michael@0: /* See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for */ michael@0: /* more details. */ michael@0: /* */ michael@0: /* <Values> */ michael@0: /* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */ michael@0: /* Fonts with no fsType bit set may be embedded and permanently */ michael@0: /* installed on the remote system by an application. */ michael@0: /* */ michael@0: /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */ michael@0: /* Fonts that have only this bit set must not be modified, embedded */ michael@0: /* or exchanged in any manner without first obtaining permission of */ michael@0: /* the font software copyright owner. */ michael@0: /* */ michael@0: /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */ michael@0: /* If this bit is set, the font may be embedded and temporarily */ michael@0: /* loaded on the remote system. Documents containing Preview & */ michael@0: /* Print fonts must be opened `read-only'; no edits can be applied */ michael@0: /* to the document. */ michael@0: /* */ michael@0: /* FT_FSTYPE_EDITABLE_EMBEDDING :: */ michael@0: /* If this bit is set, the font may be embedded but must only be */ michael@0: /* installed temporarily on other systems. In contrast to Preview */ michael@0: /* & Print fonts, documents containing editable fonts may be opened */ michael@0: /* for reading, editing is permitted, and changes may be saved. */ michael@0: /* */ michael@0: /* FT_FSTYPE_NO_SUBSETTING :: */ michael@0: /* If this bit is set, the font may not be subsetted prior to */ michael@0: /* embedding. */ michael@0: /* */ michael@0: /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */ michael@0: /* If this bit is set, only bitmaps contained in the font may be */ michael@0: /* embedded; no outline data may be embedded. If there are no */ michael@0: /* bitmaps available in the font, then the font is unembeddable. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* While the fsType flags can indicate that a font may be embedded, a */ michael@0: /* license with the font vendor may be separately required to use the */ michael@0: /* font in this way. */ michael@0: /* */ michael@0: #define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000 michael@0: #define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002 michael@0: #define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004 michael@0: #define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008 michael@0: #define FT_FSTYPE_NO_SUBSETTING 0x0100 michael@0: #define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200 michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Get_FSType_Flags */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Return the fsType flags for a font. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A handle to the source face object. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* The fsType flags, @FT_FSTYPE_XXX. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Use this function rather than directly reading the `fs_type' field */ michael@0: /* in the @PS_FontInfoRec structure, which is only guaranteed to */ michael@0: /* return the correct results for Type~1 fonts. */ michael@0: /* */ michael@0: /* <Since> */ michael@0: /* 2.3.8 */ michael@0: /* */ michael@0: FT_EXPORT( FT_UShort ) michael@0: FT_Get_FSType_Flags( FT_Face face ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Section> */ michael@0: /* glyph_variants */ michael@0: /* */ michael@0: /* <Title> */ michael@0: /* Glyph Variants */ michael@0: /* */ michael@0: /* <Abstract> */ michael@0: /* The FreeType~2 interface to Unicode Ideographic Variation */ michael@0: /* Sequences (IVS), using the SFNT cmap format~14. */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Many CJK characters have variant forms. They are a sort of grey */ michael@0: /* area somewhere between being totally irrelevant and semantically */ michael@0: /* distinct; for this reason, the Unicode consortium decided to */ michael@0: /* introduce Ideographic Variation Sequences (IVS), consisting of a */ michael@0: /* Unicode base character and one of 240 variant selectors */ michael@0: /* (U+E0100-U+E01EF), instead of further extending the already huge */ michael@0: /* code range for CJK characters. */ michael@0: /* */ michael@0: /* An IVS is registered and unique; for further details please refer */ michael@0: /* to Unicode Technical Standard #37, the Ideographic Variation */ michael@0: /* Database: */ michael@0: /* */ michael@0: /* http://www.unicode.org/reports/tr37/ */ michael@0: /* */ michael@0: /* To date (November 2012), the character with the most variants is */ michael@0: /* U+9089, having 31 such IVS. */ michael@0: /* */ michael@0: /* Adobe and MS decided to support IVS with a new cmap subtable */ michael@0: /* (format~14). It is an odd subtable because it is not a mapping of */ michael@0: /* input code points to glyphs, but contains lists of all variants */ michael@0: /* supported by the font. */ michael@0: /* */ michael@0: /* A variant may be either `default' or `non-default'. A default */ michael@0: /* variant is the one you will get for that code point if you look it */ michael@0: /* up in the standard Unicode cmap. A non-default variant is a */ michael@0: /* different glyph. */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Face_GetCharVariantIndex */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Return the glyph index of a given character code as modified by */ michael@0: /* the variation selector. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: */ michael@0: /* A handle to the source face object. */ michael@0: /* */ michael@0: /* charcode :: */ michael@0: /* The character code point in Unicode. */ michael@0: /* */ michael@0: /* variantSelector :: */ michael@0: /* The Unicode code point of the variation selector. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* The glyph index. 0~means either `undefined character code', or */ michael@0: /* `undefined selector code', or `no variation selector cmap */ michael@0: /* subtable', or `current CharMap is not Unicode'. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* If you use FreeType to manipulate the contents of font files */ michael@0: /* directly, be aware that the glyph index returned by this function */ michael@0: /* doesn't always correspond to the internal indices used within */ michael@0: /* the file. This is done to ensure that value~0 always corresponds */ michael@0: /* to the `missing glyph'. */ michael@0: /* */ michael@0: /* This function is only meaningful if */ michael@0: /* a) the font has a variation selector cmap sub table, */ michael@0: /* and */ michael@0: /* b) the current charmap has a Unicode encoding. */ michael@0: /* */ michael@0: /* <Since> */ michael@0: /* 2.3.6 */ michael@0: /* */ michael@0: FT_EXPORT( FT_UInt ) michael@0: FT_Face_GetCharVariantIndex( FT_Face face, michael@0: FT_ULong charcode, michael@0: FT_ULong variantSelector ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Face_GetCharVariantIsDefault */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Check whether this variant of this Unicode character is the one to */ michael@0: /* be found in the `cmap'. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: */ michael@0: /* A handle to the source face object. */ michael@0: /* */ michael@0: /* charcode :: */ michael@0: /* The character codepoint in Unicode. */ michael@0: /* */ michael@0: /* variantSelector :: */ michael@0: /* The Unicode codepoint of the variation selector. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* 1~if found in the standard (Unicode) cmap, 0~if found in the */ michael@0: /* variation selector cmap, or -1 if it is not a variant. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* This function is only meaningful if the font has a variation */ michael@0: /* selector cmap subtable. */ michael@0: /* */ michael@0: /* <Since> */ michael@0: /* 2.3.6 */ michael@0: /* */ michael@0: FT_EXPORT( FT_Int ) michael@0: FT_Face_GetCharVariantIsDefault( FT_Face face, michael@0: FT_ULong charcode, michael@0: FT_ULong variantSelector ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Face_GetVariantSelectors */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Return a zero-terminated list of Unicode variant selectors found */ michael@0: /* in the font. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: */ michael@0: /* A handle to the source face object. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* A pointer to an array of selector code points, or NULL if there is */ michael@0: /* no valid variant selector cmap subtable. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The last item in the array is~0; the array is owned by the */ michael@0: /* @FT_Face object but can be overwritten or released on the next */ michael@0: /* call to a FreeType function. */ michael@0: /* */ michael@0: /* <Since> */ michael@0: /* 2.3.6 */ michael@0: /* */ michael@0: FT_EXPORT( FT_UInt32* ) michael@0: FT_Face_GetVariantSelectors( FT_Face face ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Face_GetVariantsOfChar */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Return a zero-terminated list of Unicode variant selectors found */ michael@0: /* for the specified character code. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: */ michael@0: /* A handle to the source face object. */ michael@0: /* */ michael@0: /* charcode :: */ michael@0: /* The character codepoint in Unicode. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* A pointer to an array of variant selector code points that are */ michael@0: /* active for the given character, or NULL if the corresponding list */ michael@0: /* is empty. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The last item in the array is~0; the array is owned by the */ michael@0: /* @FT_Face object but can be overwritten or released on the next */ michael@0: /* call to a FreeType function. */ michael@0: /* */ michael@0: /* <Since> */ michael@0: /* 2.3.6 */ michael@0: /* */ michael@0: FT_EXPORT( FT_UInt32* ) michael@0: FT_Face_GetVariantsOfChar( FT_Face face, michael@0: FT_ULong charcode ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Face_GetCharsOfVariant */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Return a zero-terminated list of Unicode character codes found for */ michael@0: /* the specified variant selector. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: */ michael@0: /* A handle to the source face object. */ michael@0: /* */ michael@0: /* variantSelector :: */ michael@0: /* The variant selector code point in Unicode. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* A list of all the code points that are specified by this selector */ michael@0: /* (both default and non-default codes are returned) or NULL if there */ michael@0: /* is no valid cmap or the variant selector is invalid. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The last item in the array is~0; the array is owned by the */ michael@0: /* @FT_Face object but can be overwritten or released on the next */ michael@0: /* call to a FreeType function. */ michael@0: /* */ michael@0: /* <Since> */ michael@0: /* 2.3.6 */ michael@0: /* */ michael@0: FT_EXPORT( FT_UInt32* ) michael@0: FT_Face_GetCharsOfVariant( FT_Face face, michael@0: FT_ULong variantSelector ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Section> */ michael@0: /* computations */ michael@0: /* */ michael@0: /* <Title> */ michael@0: /* Computations */ michael@0: /* */ michael@0: /* <Abstract> */ michael@0: /* Crunching fixed numbers and vectors. */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This section contains various functions used to perform */ michael@0: /* computations on 16.16 fixed-float numbers or 2d vectors. */ michael@0: /* */ michael@0: /* <Order> */ michael@0: /* FT_MulDiv */ michael@0: /* FT_MulFix */ michael@0: /* FT_DivFix */ michael@0: /* FT_RoundFix */ michael@0: /* FT_CeilFix */ michael@0: /* FT_FloorFix */ michael@0: /* FT_Vector_Transform */ michael@0: /* FT_Matrix_Multiply */ michael@0: /* FT_Matrix_Invert */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_MulDiv */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A very simple function used to perform the computation `(a*b)/c' */ michael@0: /* with maximum accuracy (it uses a 64-bit intermediate integer */ michael@0: /* whenever necessary). */ michael@0: /* */ michael@0: /* This function isn't necessarily as fast as some processor specific */ michael@0: /* operations, but is at least completely portable. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* a :: The first multiplier. */ michael@0: /* b :: The second multiplier. */ michael@0: /* c :: The divisor. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* The result of `(a*b)/c'. This function never traps when trying to */ michael@0: /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */ michael@0: /* on the signs of `a' and `b'. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Long ) michael@0: FT_MulDiv( FT_Long a, michael@0: FT_Long b, michael@0: FT_Long c ); michael@0: michael@0: michael@0: /* */ michael@0: michael@0: /* The following #if 0 ... #endif is for the documentation formatter, */ michael@0: /* hiding the internal `FT_MULFIX_INLINED' macro. */ michael@0: michael@0: #if 0 michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_MulFix */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A very simple function used to perform the computation */ michael@0: /* `(a*b)/0x10000' with maximum accuracy. Most of the time this is */ michael@0: /* used to multiply a given value by a 16.16 fixed-point factor. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* a :: The first multiplier. */ michael@0: /* b :: The second multiplier. Use a 16.16 factor here whenever */ michael@0: /* possible (see note below). */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* The result of `(a*b)/0x10000'. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* This function has been optimized for the case where the absolute */ michael@0: /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */ michael@0: /* As this happens mainly when scaling from notional units to */ michael@0: /* fractional pixels in FreeType, it resulted in noticeable speed */ michael@0: /* improvements between versions 2.x and 1.x. */ michael@0: /* */ michael@0: /* As a conclusion, always try to place a 16.16 factor as the */ michael@0: /* _second_ argument of this function; this can make a great */ michael@0: /* difference. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Long ) michael@0: FT_MulFix( FT_Long a, michael@0: FT_Long b ); michael@0: michael@0: /* */ michael@0: #endif michael@0: michael@0: #ifdef FT_MULFIX_INLINED michael@0: #define FT_MulFix( a, b ) FT_MULFIX_INLINED( a, b ) michael@0: #else michael@0: FT_EXPORT( FT_Long ) michael@0: FT_MulFix( FT_Long a, michael@0: FT_Long b ); michael@0: #endif michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_DivFix */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A very simple function used to perform the computation */ michael@0: /* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */ michael@0: /* used to divide a given value by a 16.16 fixed-point factor. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* a :: The first multiplier. */ michael@0: /* b :: The second multiplier. Use a 16.16 factor here whenever */ michael@0: /* possible (see note below). */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* The result of `(a*0x10000)/b'. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The optimization for FT_DivFix() is simple: If (a~<<~16) fits in */ michael@0: /* 32~bits, then the division is computed directly. Otherwise, we */ michael@0: /* use a specialized version of @FT_MulDiv. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Long ) michael@0: FT_DivFix( FT_Long a, michael@0: FT_Long b ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_RoundFix */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A very simple function used to round a 16.16 fixed number. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* a :: The number to be rounded. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* The result of `(a + 0x8000) & -0x10000'. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Fixed ) michael@0: FT_RoundFix( FT_Fixed a ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_CeilFix */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A very simple function used to compute the ceiling function of a */ michael@0: /* 16.16 fixed number. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* a :: The number for which the ceiling function is to be computed. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* The result of `(a + 0x10000 - 1) & -0x10000'. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Fixed ) michael@0: FT_CeilFix( FT_Fixed a ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_FloorFix */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A very simple function used to compute the floor function of a */ michael@0: /* 16.16 fixed number. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* a :: The number for which the floor function is to be computed. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* The result of `a & -0x10000'. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Fixed ) michael@0: FT_FloorFix( FT_Fixed a ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Vector_Transform */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Transform a single vector through a 2x2 matrix. */ michael@0: /* */ michael@0: /* <InOut> */ michael@0: /* vector :: The target vector to transform. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* matrix :: A pointer to the source 2x2 matrix. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The result is undefined if either `vector' or `matrix' is invalid. */ michael@0: /* */ michael@0: FT_EXPORT( void ) michael@0: FT_Vector_Transform( FT_Vector* vec, michael@0: const FT_Matrix* matrix ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Section> */ michael@0: /* version */ michael@0: /* */ michael@0: /* <Title> */ michael@0: /* FreeType Version */ michael@0: /* */ michael@0: /* <Abstract> */ michael@0: /* Functions and macros related to FreeType versions. */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Note that those functions and macros are of limited use because */ michael@0: /* even a new release of FreeType with only documentation changes */ michael@0: /* increases the version number. */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /************************************************************************* michael@0: * michael@0: * @enum: michael@0: * FREETYPE_XXX michael@0: * michael@0: * @description: michael@0: * These three macros identify the FreeType source code version. michael@0: * Use @FT_Library_Version to access them at runtime. michael@0: * michael@0: * @values: michael@0: * FREETYPE_MAJOR :: The major version number. michael@0: * FREETYPE_MINOR :: The minor version number. michael@0: * FREETYPE_PATCH :: The patch level. michael@0: * michael@0: * @note: michael@0: * The version number of FreeType if built as a dynamic link library michael@0: * with the `libtool' package is _not_ controlled by these three michael@0: * macros. michael@0: * michael@0: */ michael@0: #define FREETYPE_MAJOR 2 michael@0: #define FREETYPE_MINOR 5 michael@0: #define FREETYPE_PATCH 3 michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Library_Version */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Return the version of the FreeType library being used. This is */ michael@0: /* useful when dynamically linking to the library, since one cannot */ michael@0: /* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */ michael@0: /* @FREETYPE_PATCH. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* library :: A source library handle. */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* amajor :: The major version number. */ michael@0: /* */ michael@0: /* aminor :: The minor version number. */ michael@0: /* */ michael@0: /* apatch :: The patch version number. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The reason why this function takes a `library' argument is because */ michael@0: /* certain programs implement library initialization in a custom way */ michael@0: /* that doesn't use @FT_Init_FreeType. */ michael@0: /* */ michael@0: /* In such cases, the library version might not be available before */ michael@0: /* the library object has been created. */ michael@0: /* */ michael@0: FT_EXPORT( void ) michael@0: FT_Library_Version( FT_Library library, michael@0: FT_Int *amajor, michael@0: FT_Int *aminor, michael@0: FT_Int *apatch ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Face_CheckTrueTypePatents */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Parse all bytecode instructions of a TrueType font file to check */ michael@0: /* whether any of the patented opcodes are used. This is only useful */ michael@0: /* if you want to be able to use the unpatented hinter with */ michael@0: /* fonts that do *not* use these opcodes. */ michael@0: /* */ michael@0: /* Note that this function parses *all* glyph instructions in the */ michael@0: /* font file, which may be slow. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A face handle. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* 1~if this is a TrueType font that uses one of the patented */ michael@0: /* opcodes, 0~otherwise. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Since May 2010, TrueType hinting is no longer patented. */ michael@0: /* */ michael@0: /* <Since> */ michael@0: /* 2.3.5 */ michael@0: /* */ michael@0: FT_EXPORT( FT_Bool ) michael@0: FT_Face_CheckTrueTypePatents( FT_Face face ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Face_SetUnpatentedHinting */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Enable or disable the unpatented hinter for a given face. */ michael@0: /* Only enable it if you have determined that the face doesn't */ michael@0: /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A face handle. */ michael@0: /* */ michael@0: /* value :: New boolean setting. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* The old setting value. This will always be false if this is not */ michael@0: /* an SFNT font, or if the unpatented hinter is not compiled in this */ michael@0: /* instance of the library. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Since May 2010, TrueType hinting is no longer patented. */ michael@0: /* */ michael@0: /* <Since> */ michael@0: /* 2.3.5 */ michael@0: /* */ michael@0: FT_EXPORT( FT_Bool ) michael@0: FT_Face_SetUnpatentedHinting( FT_Face face, michael@0: FT_Bool value ); michael@0: michael@0: /* */ michael@0: michael@0: michael@0: FT_END_HEADER michael@0: michael@0: #endif /* __FREETYPE_H__ */ michael@0: michael@0: michael@0: /* END */