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