CS代考计算机代写 flex algorithm scheme cache interpreter compiler data structure database /***************************************************************************/

/***************************************************************************/
/* */
/* freetype.h */
/* */
/* FreeType high-level API and common types (specification only). */
/* */
/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/

#ifndef __FREETYPE_H__
#define __FREETYPE_H__

#ifndef FT_FREETYPE_H
#error “`ft2build.h’ hasn’t been included yet!”
#error “Please always use macros to include FreeType header files.”
#error “Example:”
#error ” #include
#error ” #include FT_FREETYPE_H”
#endif

#include
#include FT_CONFIG_CONFIG_H
#include FT_TYPES_H
#include FT_ERRORS_H

FT_BEGIN_HEADER

/*************************************************************************/
/* */
/*

*/
/* header_inclusion */
/* */
/* */<br /> /* FreeType’s header inclusion scheme */<br /> /* */<br /> /* <Abstract> */<br /> /* How client applications should include FreeType header files. */<br /> /* */<br /> /* <Description> */<br /> /* To be as flexible as possible (and for historical reasons), */<br /> /* FreeType uses a very special inclusion scheme to load header */<br /> /* files, for example */<br /> /* */<br /> /* { */<br /> /* #include <ft2build.h> */<br /> /* */<br /> /* #include FT_FREETYPE_H */<br /> /* #include FT_OUTLINE_H */<br /> /* } */<br /> /* */<br /> /* A compiler and its preprocessor only needs an include path to find */<br /> /* the file `ft2build.h’; the exact locations and names of the other */<br /> /* FreeType header files are hidden by preprocessor macro names, */<br /> /* loaded by `ft2build.h’. The API documentation always gives the */<br /> /* header macro name needed for a particular function. */<br /> /* */<br /> /*************************************************************************/</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Section> */<br /> /* user_allocation */<br /> /* */<br /> /* <Title> */<br /> /* User allocation */<br /> /* */<br /> /* <Abstract> */<br /> /* How client applications should allocate FreeType data structures. */<br /> /* */<br /> /* <Description> */<br /> /* FreeType assumes that structures allocated by the user and passed */<br /> /* as arguments are zeroed out except for the actual data. In other */<br /> /* words, it is recommended to use `calloc’ (or variants of it) */<br /> /* instead of `malloc’ for allocation. */<br /> /* */<br /> /*************************************************************************/</p> <p> /*************************************************************************/<br /> /*************************************************************************/<br /> /* */<br /> /* B A S I C T Y P E S */<br /> /* */<br /> /*************************************************************************/<br /> /*************************************************************************/</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Section> */<br /> /* base_interface */<br /> /* */<br /> /* <Title> */<br /> /* Base Interface */<br /> /* */<br /> /* <Abstract> */<br /> /* The FreeType~2 base font interface. */<br /> /* */<br /> /* <Description> */<br /> /* This section describes the most important public high-level API */<br /> /* functions of FreeType~2. */<br /> /* */<br /> /* <Order> */<br /> /* FT_Library */<br /> /* FT_Face */<br /> /* FT_Size */<br /> /* FT_GlyphSlot */<br /> /* FT_CharMap */<br /> /* FT_Encoding */<br /> /* FT_ENC_TAG */<br /> /* */<br /> /* FT_FaceRec */<br /> /* */<br /> /* FT_FACE_FLAG_SCALABLE */<br /> /* FT_FACE_FLAG_FIXED_SIZES */<br /> /* FT_FACE_FLAG_FIXED_WIDTH */<br /> /* FT_FACE_FLAG_HORIZONTAL */<br /> /* FT_FACE_FLAG_VERTICAL */<br /> /* FT_FACE_FLAG_COLOR */<br /> /* FT_FACE_FLAG_SFNT */<br /> /* FT_FACE_FLAG_CID_KEYED */<br /> /* FT_FACE_FLAG_TRICKY */<br /> /* FT_FACE_FLAG_KERNING */<br /> /* FT_FACE_FLAG_MULTIPLE_MASTERS */<br /> /* FT_FACE_FLAG_GLYPH_NAMES */<br /> /* FT_FACE_FLAG_EXTERNAL_STREAM */<br /> /* FT_FACE_FLAG_HINTER */<br /> /* FT_FACE_FLAG_TRICKY */<br /> /* */<br /> /* FT_HAS_HORIZONTAL */<br /> /* FT_HAS_VERTICAL */<br /> /* FT_HAS_KERNING */<br /> /* FT_HAS_FIXED_SIZES */<br /> /* FT_HAS_GLYPH_NAMES */<br /> /* FT_HAS_MULTIPLE_MASTERS */<br /> /* FT_HAS_COLOR */<br /> /* */<br /> /* FT_IS_SFNT */<br /> /* FT_IS_SCALABLE */<br /> /* FT_IS_FIXED_WIDTH */<br /> /* FT_IS_CID_KEYED */<br /> /* FT_IS_TRICKY */<br /> /* */<br /> /* FT_STYLE_FLAG_BOLD */<br /> /* FT_STYLE_FLAG_ITALIC */<br /> /* */<br /> /* FT_SizeRec */<br /> /* FT_Size_Metrics */<br /> /* */<br /> /* FT_GlyphSlotRec */<br /> /* FT_Glyph_Metrics */<br /> /* FT_SubGlyph */<br /> /* */<br /> /* FT_Bitmap_Size */<br /> /* */<br /> /* FT_Init_FreeType */<br /> /* FT_Done_FreeType */<br /> /* */<br /> /* FT_New_Face */<br /> /* FT_Done_Face */<br /> /* FT_Reference_Face */<br /> /* FT_New_Memory_Face */<br /> /* FT_Open_Face */<br /> /* FT_Open_Args */<br /> /* FT_Parameter */<br /> /* FT_Attach_File */<br /> /* FT_Attach_Stream */<br /> /* */<br /> /* FT_Set_Char_Size */<br /> /* FT_Set_Pixel_Sizes */<br /> /* FT_Request_Size */<br /> /* FT_Select_Size */<br /> /* FT_Size_Request_Type */<br /> /* FT_Size_RequestRec */<br /> /* FT_Size_Request */<br /> /* FT_Set_Transform */<br /> /* FT_Load_Glyph */<br /> /* FT_Get_Char_Index */<br /> /* FT_Get_First_Char */<br /> /* FT_Get_Next_Char */<br /> /* FT_Get_Name_Index */<br /> /* FT_Load_Char */<br /> /* */<br /> /* FT_OPEN_MEMORY */<br /> /* FT_OPEN_STREAM */<br /> /* FT_OPEN_PATHNAME */<br /> /* FT_OPEN_DRIVER */<br /> /* FT_OPEN_PARAMS */<br /> /* */<br /> /* FT_LOAD_DEFAULT */<br /> /* FT_LOAD_RENDER */<br /> /* FT_LOAD_MONOCHROME */<br /> /* FT_LOAD_LINEAR_DESIGN */<br /> /* FT_LOAD_NO_SCALE */<br /> /* FT_LOAD_NO_HINTING */<br /> /* FT_LOAD_NO_BITMAP */<br /> /* FT_LOAD_NO_AUTOHINT */<br /> /* FT_LOAD_COLOR */<br /> /* */<br /> /* FT_LOAD_VERTICAL_LAYOUT */<br /> /* FT_LOAD_IGNORE_TRANSFORM */<br /> /* FT_LOAD_FORCE_AUTOHINT */<br /> /* FT_LOAD_NO_RECURSE */<br /> /* FT_LOAD_PEDANTIC */<br /> /* */<br /> /* FT_LOAD_TARGET_NORMAL */<br /> /* FT_LOAD_TARGET_LIGHT */<br /> /* FT_LOAD_TARGET_MONO */<br /> /* FT_LOAD_TARGET_LCD */<br /> /* FT_LOAD_TARGET_LCD_V */<br /> /* */<br /> /* FT_LOAD_TARGET_MODE */<br /> /* */<br /> /* FT_Render_Glyph */<br /> /* FT_Render_Mode */<br /> /* FT_Get_Kerning */<br /> /* FT_Kerning_Mode */<br /> /* FT_Get_Track_Kerning */<br /> /* FT_Get_Glyph_Name */<br /> /* FT_Get_Postscript_Name */<br /> /* */<br /> /* FT_CharMapRec */<br /> /* FT_Select_Charmap */<br /> /* FT_Set_Charmap */<br /> /* FT_Get_Charmap_Index */<br /> /* */<br /> /* FT_Get_FSType_Flags */<br /> /* FT_Get_SubGlyph_Info */<br /> /* */<br /> /* FT_Face_Internal */<br /> /* FT_Size_Internal */<br /> /* FT_Slot_Internal */<br /> /* */<br /> /* FT_FACE_FLAG_XXX */<br /> /* FT_STYLE_FLAG_XXX */<br /> /* FT_OPEN_XXX */<br /> /* FT_LOAD_XXX */<br /> /* FT_LOAD_TARGET_XXX */<br /> /* FT_SUBGLYPH_FLAG_XXX */<br /> /* FT_FSTYPE_XXX */<br /> /* */<br /> /* FT_HAS_FAST_GLYPHS */<br /> /* */<br /> /*************************************************************************/</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Struct> */<br /> /* FT_Glyph_Metrics */<br /> /* */<br /> /* <Description> */<br /> /* A structure used to model the metrics of a single glyph. The */<br /> /* values are expressed in 26.6 fractional pixel format; if the flag */<br /> /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */<br /> /* are expressed in font units instead. */<br /> /* */<br /> /* <Fields> */<br /> /* width :: */<br /> /* The glyph’s width. */<br /> /* */<br /> /* height :: */<br /> /* The glyph’s height. */<br /> /* */<br /> /* horiBearingX :: */<br /> /* Left side bearing for horizontal layout. */<br /> /* */<br /> /* horiBearingY :: */<br /> /* Top side bearing for horizontal layout. */<br /> /* */<br /> /* horiAdvance :: */<br /> /* Advance width for horizontal layout. */<br /> /* */<br /> /* vertBearingX :: */<br /> /* Left side bearing for vertical layout. */<br /> /* */<br /> /* vertBearingY :: */<br /> /* Top side bearing for vertical layout. Larger positive values */<br /> /* mean further below the vertical glyph origin. */<br /> /* */<br /> /* vertAdvance :: */<br /> /* Advance height for vertical layout. Positive values mean the */<br /> /* glyph has a positive advance downward. */<br /> /* */<br /> /* <Note> */<br /> /* If not disabled with @FT_LOAD_NO_HINTING, the values represent */<br /> /* dimensions of the hinted glyph (in case hinting is applicable). */<br /> /* */<br /> /* Stroking a glyph with an outside border does not increase */<br /> /* `horiAdvance’ or `vertAdvance’; you have to manually adjust these */<br /> /* values to account for the added width and height. */<br /> /* */<br /> typedef struct FT_Glyph_Metrics_<br /> {<br /> FT_Pos width;<br /> FT_Pos height;</p> <p> FT_Pos horiBearingX;<br /> FT_Pos horiBearingY;<br /> FT_Pos horiAdvance;</p> <p> FT_Pos vertBearingX;<br /> FT_Pos vertBearingY;<br /> FT_Pos vertAdvance;</p> <p> } FT_Glyph_Metrics;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Struct> */<br /> /* FT_Bitmap_Size */<br /> /* */<br /> /* <Description> */<br /> /* This structure models the metrics of a bitmap strike (i.e., a set */<br /> /* of glyphs for a given point size and resolution) in a bitmap font. */<br /> /* It is used for the `available_sizes’ field of @FT_Face. */<br /> /* */<br /> /* <Fields> */<br /> /* height :: The vertical distance, in pixels, between two */<br /> /* consecutive baselines. It is always positive. */<br /> /* */<br /> /* width :: The average width, in pixels, of all glyphs in the */<br /> /* strike. */<br /> /* */<br /> /* size :: The nominal size of the strike in 26.6 fractional */<br /> /* points. This field is not very useful. */<br /> /* */<br /> /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */<br /> /* pixels. */<br /> /* */<br /> /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */<br /> /* pixels. */<br /> /* */<br /> /* <Note> */<br /> /* Windows FNT: */<br /> /* The nominal size given in a FNT font is not reliable. Thus when */<br /> /* the driver finds it incorrect, it sets `size’ to some calculated */<br /> /* values and sets `x_ppem’ and `y_ppem’ to the pixel width and */<br /> /* height given in the font, respectively. */<br /> /* */<br /> /* TrueType embedded bitmaps: */<br /> /* `size’, `width’, and `height’ values are not contained in the */<br /> /* bitmap strike itself. They are computed from the global font */<br /> /* parameters. */<br /> /* */<br /> typedef struct FT_Bitmap_Size_<br /> {<br /> FT_Short height;<br /> FT_Short width;</p> <p> FT_Pos size;</p> <p> FT_Pos x_ppem;<br /> FT_Pos y_ppem;</p> <p> } FT_Bitmap_Size;</p> <p> /*************************************************************************/<br /> /*************************************************************************/<br /> /* */<br /> /* O B J E C T C L A S S E S */<br /> /* */<br /> /*************************************************************************/<br /> /*************************************************************************/</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Type> */<br /> /* FT_Library */<br /> /* */<br /> /* <Description> */<br /> /* A handle to a FreeType library instance. Each `library’ is */<br /> /* completely independent from the others; it is the `root’ of a set */<br /> /* of objects like fonts, faces, sizes, etc. */<br /> /* */<br /> /* It also embeds a memory manager (see @FT_Memory), as well as a */<br /> /* scan-line converter object (see @FT_Raster). */<br /> /* */<br /> /* In multi-threaded applications it is easiest to use one */<br /> /* `FT_Library’ object per thread. In case this is too cumbersome, */<br /> /* a single `FT_Library’ object across threads is possible also */<br /> /* (since FreeType version 2.5.6), as long as a mutex lock is used */<br /> /* around @FT_New_Face and @FT_Done_Face. */<br /> /* */<br /> /* <Note> */<br /> /* Library objects are normally created by @FT_Init_FreeType, and */<br /> /* destroyed with @FT_Done_FreeType. If you need reference-counting */<br /> /* (cf. @FT_Reference_Library), use @FT_New_Library and */<br /> /* @FT_Done_Library. */<br /> /* */<br /> typedef struct FT_LibraryRec_ *FT_Library;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Section> */<br /> /* module_management */<br /> /* */<br /> /*************************************************************************/</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Type> */<br /> /* FT_Module */<br /> /* */<br /> /* <Description> */<br /> /* A handle to a given FreeType module object. Each module can be a */<br /> /* font driver, a renderer, or anything else that provides services */<br /> /* to the formers. */<br /> /* */<br /> typedef struct FT_ModuleRec_* FT_Module;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Type> */<br /> /* FT_Driver */<br /> /* */<br /> /* <Description> */<br /> /* A handle to a given FreeType font driver object. Each font driver */<br /> /* is a special module capable of creating faces from font files. */<br /> /* */<br /> typedef struct FT_DriverRec_* FT_Driver;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Type> */<br /> /* FT_Renderer */<br /> /* */<br /> /* <Description> */<br /> /* A handle to a given FreeType renderer. A renderer is a special */<br /> /* module in charge of converting a glyph image to a bitmap, when */<br /> /* necessary. Each renderer supports a given glyph image format, and */<br /> /* one or more target surface depths. */<br /> /* */<br /> typedef struct FT_RendererRec_* FT_Renderer;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Section> */<br /> /* base_interface */<br /> /* */<br /> /*************************************************************************/</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Type> */<br /> /* FT_Face */<br /> /* */<br /> /* <Description> */<br /> /* A handle to a given typographic face object. A face object models */<br /> /* a given typeface, in a given style. */<br /> /* */<br /> /* <Note> */<br /> /* Each face object also owns a single @FT_GlyphSlot object, as well */<br /> /* as one or more @FT_Size objects. */<br /> /* */<br /> /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */<br /> /* a given filepathname or a custom input stream. */<br /> /* */<br /> /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */<br /> /* */<br /> /* An `FT_Face’ object can only be safely used from one thread at a */<br /> /* time. Similarly, creation and destruction of `FT_Face’ with the */<br /> /* same @FT_Library object can only be done from one thread at a */<br /> /* time. On the other hand, functions like @FT_Load_Glyph and its */<br /> /* siblings are thread-safe and do not need the lock to be held as */<br /> /* long as the same `FT_Face’ object is not used from multiple */<br /> /* threads at the same time. */<br /> /* */<br /> /* <Also> */<br /> /* See @FT_FaceRec for the publicly accessible fields of a given face */<br /> /* object. */<br /> /* */<br /> typedef struct FT_FaceRec_* FT_Face;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Type> */<br /> /* FT_Size */<br /> /* */<br /> /* <Description> */<br /> /* A handle to an object used to model a face scaled to a given */<br /> /* character size. */<br /> /* */<br /> /* <Note> */<br /> /* Each @FT_Face has an _active_ @FT_Size object that is used by */<br /> /* functions like @FT_Load_Glyph to determine the scaling */<br /> /* transformation that in turn is used to load and hint glyphs and */<br /> /* metrics. */<br /> /* */<br /> /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */<br /> /* @FT_Request_Size or even @FT_Select_Size to change the content */<br /> /* (i.e., the scaling values) of the active @FT_Size. */<br /> /* */<br /> /* You can use @FT_New_Size to create additional size objects for a */<br /> /* given @FT_Face, but they won’t be used by other functions until */<br /> /* you activate it through @FT_Activate_Size. Only one size can be */<br /> /* activated at any given time per face. */<br /> /* */<br /> /* <Also> */<br /> /* See @FT_SizeRec for the publicly accessible fields of a given size */<br /> /* object. */<br /> /* */<br /> typedef struct FT_SizeRec_* FT_Size;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Type> */<br /> /* FT_GlyphSlot */<br /> /* */<br /> /* <Description> */<br /> /* A handle to a given `glyph slot’. A slot is a container where it */<br /> /* is possible to load any of the glyphs contained in its parent */<br /> /* face. */<br /> /* */<br /> /* In other words, each time you call @FT_Load_Glyph or */<br /> /* @FT_Load_Char, the slot’s content is erased by the new glyph data, */<br /> /* i.e., the glyph’s metrics, its image (bitmap or outline), and */<br /> /* other control information. */<br /> /* */<br /> /* <Also> */<br /> /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */<br /> /* */<br /> typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Type> */<br /> /* FT_CharMap */<br /> /* */<br /> /* <Description> */<br /> /* A handle to a given character map. A charmap is used to translate */<br /> /* character codes in a given encoding into glyph indexes for its */<br /> /* parent’s face. Some font formats may provide several charmaps per */<br /> /* font. */<br /> /* */<br /> /* Each face object owns zero or more charmaps, but only one of them */<br /> /* can be `active’ and used by @FT_Get_Char_Index or @FT_Load_Char. */<br /> /* */<br /> /* The list of available charmaps in a face is available through the */<br /> /* `face->num_charmaps’ and `face->charmaps’ fields of @FT_FaceRec. */<br /> /* */<br /> /* The currently active charmap is available as `face->charmap’. */<br /> /* You should call @FT_Set_Charmap to change it. */<br /> /* */<br /> /* <Note> */<br /> /* When a new face is created (either through @FT_New_Face or */<br /> /* @FT_Open_Face), the library looks for a Unicode charmap within */<br /> /* the list and automatically activates it. */<br /> /* */<br /> /* <Also> */<br /> /* See @FT_CharMapRec for the publicly accessible fields of a given */<br /> /* character map. */<br /> /* */<br /> typedef struct FT_CharMapRec_* FT_CharMap;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Macro> */<br /> /* FT_ENC_TAG */<br /> /* */<br /> /* <Description> */<br /> /* This macro converts four-letter tags into an unsigned long. It is */<br /> /* used to define `encoding’ identifiers (see @FT_Encoding). */<br /> /* */<br /> /* <Note> */<br /> /* Since many 16-bit compilers don’t like 32-bit enumerations, you */<br /> /* should redefine this macro in case of problems to something like */<br /> /* this: */<br /> /* */<br /> /* { */<br /> /* #define FT_ENC_TAG( value, a, b, c, d ) value */<br /> /* } */<br /> /* */<br /> /* to get a simple enumeration without assigning special numbers. */<br /> /* */</p> <p>#ifndef FT_ENC_TAG<br /> #define FT_ENC_TAG( value, a, b, c, d ) \<br /> value = ( ( (FT_UInt32)(a) << 24 ) | \ ( (FT_UInt32)(b) << 16 ) | \ ( (FT_UInt32)(c) << 8 ) | \ (FT_UInt32)(d) ) #endif /* FT_ENC_TAG */ /*************************************************************************/ /* */ /* <Enum> */<br /> /* FT_Encoding */<br /> /* */<br /> /* <Description> */<br /> /* An enumeration used to specify character sets supported by */<br /> /* charmaps. Used in the @FT_Select_Charmap API function. */<br /> /* */<br /> /* <Note> */<br /> /* Despite the name, this enumeration lists specific character */<br /> /* repertories (i.e., charsets), and not text encoding methods (e.g., */<br /> /* UTF-8, UTF-16, etc.). */<br /> /* */<br /> /* Other encodings might be defined in the future. */<br /> /* */<br /> /* <Values> */<br /> /* FT_ENCODING_NONE :: */<br /> /* The encoding value~0 is reserved. */<br /> /* */<br /> /* FT_ENCODING_UNICODE :: */<br /> /* Corresponds to the Unicode character set. This value covers */<br /> /* all versions of the Unicode repertoire, including ASCII and */<br /> /* Latin-1. Most fonts include a Unicode charmap, but not all */<br /> /* of them. */<br /> /* */<br /> /* For example, if you want to access Unicode value U+1F028 (and */<br /> /* the font contains it), use value 0x1F028 as the input value for */<br /> /* @FT_Get_Char_Index. */<br /> /* */<br /> /* FT_ENCODING_MS_SYMBOL :: */<br /> /* Corresponds to the Microsoft Symbol encoding, used to encode */<br /> /* mathematical symbols and wingdings. For more information, see */<br /> /* `http://www.microsoft.com/typography/otspec/recom.htm’, */<br /> /* `http://www.kostis.net/charsets/symbol.htm’, and */<br /> /* `http://www.kostis.net/charsets/wingding.htm’. */<br /> /* */<br /> /* This encoding uses character codes from the PUA (Private Unicode */<br /> /* Area) in the range U+F020-U+F0FF. */<br /> /* */<br /> /* FT_ENCODING_SJIS :: */<br /> /* Corresponds to Japanese SJIS encoding. More info at */<br /> /* at `http://en.wikipedia.org/wiki/Shift_JIS’. */<br /> /* See note on multi-byte encodings below. */<br /> /* */<br /> /* FT_ENCODING_GB2312 :: */<br /> /* Corresponds to an encoding system for Simplified Chinese as used */<br /> /* used in mainland China. */<br /> /* */<br /> /* FT_ENCODING_BIG5 :: */<br /> /* Corresponds to an encoding system for Traditional Chinese as */<br /> /* used in Taiwan and Hong Kong. */<br /> /* */<br /> /* FT_ENCODING_WANSUNG :: */<br /> /* Corresponds to the Korean encoding system known as Wansung. */<br /> /* For more information see */<br /> /* `https://msdn.microsoft.com/en-US/goglobal/cc305154′. */<br /> /* */<br /> /* FT_ENCODING_JOHAB :: */<br /> /* The Korean standard character set (KS~C 5601-1992), which */<br /> /* corresponds to MS Windows code page 1361. This character set */<br /> /* includes all possible Hangeul character combinations. */<br /> /* */<br /> /* FT_ENCODING_ADOBE_LATIN_1 :: */<br /> /* Corresponds to a Latin-1 encoding as defined in a Type~1 */<br /> /* PostScript font. It is limited to 256 character codes. */<br /> /* */<br /> /* FT_ENCODING_ADOBE_STANDARD :: */<br /> /* Corresponds to the Adobe Standard encoding, as found in Type~1, */<br /> /* CFF, and OpenType/CFF fonts. It is limited to 256 character */<br /> /* codes. */<br /> /* */<br /> /* FT_ENCODING_ADOBE_EXPERT :: */<br /> /* Corresponds to the Adobe Expert encoding, as found in Type~1, */<br /> /* CFF, and OpenType/CFF fonts. It is limited to 256 character */<br /> /* codes. */<br /> /* */<br /> /* FT_ENCODING_ADOBE_CUSTOM :: */<br /> /* Corresponds to a custom encoding, as found in Type~1, CFF, and */<br /> /* OpenType/CFF fonts. It is limited to 256 character codes. */<br /> /* */<br /> /* FT_ENCODING_APPLE_ROMAN :: */<br /> /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */<br /> /* and OpenType fonts contain a charmap for this encoding, since */<br /> /* older versions of Mac OS are able to use it. */<br /> /* */<br /> /* FT_ENCODING_OLD_LATIN_2 :: */<br /> /* This value is deprecated and was never used nor reported by */<br /> /* FreeType. Don’t use or test for it. */<br /> /* */<br /> /* FT_ENCODING_MS_SJIS :: */<br /> /* Same as FT_ENCODING_SJIS. Deprecated. */<br /> /* */<br /> /* FT_ENCODING_MS_GB2312 :: */<br /> /* Same as FT_ENCODING_GB2312. Deprecated. */<br /> /* */<br /> /* FT_ENCODING_MS_BIG5 :: */<br /> /* Same as FT_ENCODING_BIG5. Deprecated. */<br /> /* */<br /> /* FT_ENCODING_MS_WANSUNG :: */<br /> /* Same as FT_ENCODING_WANSUNG. Deprecated. */<br /> /* */<br /> /* FT_ENCODING_MS_JOHAB :: */<br /> /* Same as FT_ENCODING_JOHAB. Deprecated. */<br /> /* */<br /> /* <Note> */<br /> /* By default, FreeType automatically synthesizes a Unicode charmap */<br /> /* for PostScript fonts, using their glyph names dictionaries. */<br /> /* However, it also reports the encodings defined explicitly in the */<br /> /* font file, for the cases when they are needed, with the Adobe */<br /> /* values as well. */<br /> /* */<br /> /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */<br /> /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */<br /> /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */<br /> /* which encoding is really present. If, for example, the */<br /> /* `cs_registry’ field is `KOI8′ and the `cs_encoding’ field is `R’, */<br /> /* the font is encoded in KOI8-R. */<br /> /* */<br /> /* FT_ENCODING_NONE is always set (with a single exception) by the */<br /> /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */<br /> /* `charset’ field of the @FT_WinFNT_HeaderRec structure to find out */<br /> /* which encoding is really present. For example, */<br /> /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */<br /> /* Russian). */<br /> /* */<br /> /* FT_ENCODING_NONE is set if `platform_id’ is @TT_PLATFORM_MACINTOSH */<br /> /* and `encoding_id’ is not @TT_MAC_ID_ROMAN (otherwise it is set to */<br /> /* FT_ENCODING_APPLE_ROMAN). */<br /> /* */<br /> /* If `platform_id’ is @TT_PLATFORM_MACINTOSH, use the function */<br /> /* @FT_Get_CMap_Language_ID to query the Mac language ID that may */<br /> /* be needed to be able to distinguish Apple encoding variants. See */<br /> /* */<br /> /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt */<br /> /* */<br /> /* to get an idea how to do that. Basically, if the language ID */<br /> /* is~0, don’t use it, otherwise subtract 1 from the language ID. */<br /> /* Then examine `encoding_id’. If, for example, `encoding_id’ is */<br /> /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */<br /> /* `TT_MAC_LANGID_GREEK’, it is the Greek encoding, not Roman. */<br /> /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI’ means the Farsi */<br /> /* variant the Arabic encoding. */<br /> /* */<br /> typedef enum FT_Encoding_<br /> {<br /> FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),</p> <p> FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, ‘s’, ‘y’, ‘m’, ‘b’ ),<br /> FT_ENC_TAG( FT_ENCODING_UNICODE, ‘u’, ‘n’, ‘i’, ‘c’ ),</p> <p> FT_ENC_TAG( FT_ENCODING_SJIS, ‘s’, ‘j’, ‘i’, ‘s’ ),<br /> FT_ENC_TAG( FT_ENCODING_GB2312, ‘g’, ‘b’, ‘ ‘, ‘ ‘ ),<br /> FT_ENC_TAG( FT_ENCODING_BIG5, ‘b’, ‘i’, ‘g’, ‘5’ ),<br /> FT_ENC_TAG( FT_ENCODING_WANSUNG, ‘w’, ‘a’, ‘n’, ‘s’ ),<br /> FT_ENC_TAG( FT_ENCODING_JOHAB, ‘j’, ‘o’, ‘h’, ‘a’ ),</p> <p> /* for backwards compatibility */<br /> FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS,<br /> FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312,<br /> FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5,<br /> FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,<br /> FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB,</p> <p> FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, ‘A’, ‘D’, ‘O’, ‘B’ ),<br /> FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, ‘A’, ‘D’, ‘B’, ‘E’ ),<br /> FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, ‘A’, ‘D’, ‘B’, ‘C’ ),<br /> FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, ‘l’, ‘a’, ‘t’, ‘1’ ),</p> <p> FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, ‘l’, ‘a’, ‘t’, ‘2’ ),</p> <p> FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, ‘a’, ‘r’, ‘m’, ‘n’ )</p> <p> } FT_Encoding;</p> <p> /* these constants are deprecated; use the corresponding `FT_Encoding’ */<br /> /* values instead */<br /> #define ft_encoding_none FT_ENCODING_NONE<br /> #define ft_encoding_unicode FT_ENCODING_UNICODE<br /> #define ft_encoding_symbol FT_ENCODING_MS_SYMBOL<br /> #define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1<br /> #define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2<br /> #define ft_encoding_sjis FT_ENCODING_SJIS<br /> #define ft_encoding_gb2312 FT_ENCODING_GB2312<br /> #define ft_encoding_big5 FT_ENCODING_BIG5<br /> #define ft_encoding_wansung FT_ENCODING_WANSUNG<br /> #define ft_encoding_johab FT_ENCODING_JOHAB</p> <p>#define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD<br /> #define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT<br /> #define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM<br /> #define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Struct> */<br /> /* FT_CharMapRec */<br /> /* */<br /> /* <Description> */<br /> /* The base charmap structure. */<br /> /* */<br /> /* <Fields> */<br /> /* face :: A handle to the parent face object. */<br /> /* */<br /> /* encoding :: An @FT_Encoding tag identifying the charmap. Use */<br /> /* this with @FT_Select_Charmap. */<br /> /* */<br /> /* platform_id :: An ID number describing the platform for the */<br /> /* following encoding ID. This comes directly from */<br /> /* the TrueType specification and should be emulated */<br /> /* for other formats. */<br /> /* */<br /> /* encoding_id :: A platform specific encoding number. This also */<br /> /* comes from the TrueType specification and should be */<br /> /* emulated similarly. */<br /> /* */<br /> typedef struct FT_CharMapRec_<br /> {<br /> FT_Face face;<br /> FT_Encoding encoding;<br /> FT_UShort platform_id;<br /> FT_UShort encoding_id;</p> <p> } FT_CharMapRec;</p> <p> /*************************************************************************/<br /> /*************************************************************************/<br /> /* */<br /> /* B A S E O B J E C T C L A S S E S */<br /> /* */<br /> /*************************************************************************/<br /> /*************************************************************************/</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Type> */<br /> /* FT_Face_Internal */<br /> /* */<br /> /* <Description> */<br /> /* An opaque handle to an `FT_Face_InternalRec’ structure, used to */<br /> /* model private data of a given @FT_Face object. */<br /> /* */<br /> /* This structure might change between releases of FreeType~2 and is */<br /> /* not generally available to client applications. */<br /> /* */<br /> typedef struct FT_Face_InternalRec_* FT_Face_Internal;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Struct> */<br /> /* FT_FaceRec */<br /> /* */<br /> /* <Description> */<br /> /* FreeType root face class structure. A face object models a */<br /> /* typeface in a font file. */<br /> /* */<br /> /* <Fields> */<br /> /* num_faces :: The number of faces in the font file. Some */<br /> /* font formats can have multiple faces in */<br /> /* a font file. */<br /> /* */<br /> /* face_index :: This field holds two different values. */<br /> /* Bits 0-15 are the index of the face in the */<br /> /* font file (starting with value~0). They */<br /> /* are set to~0 if there is only one face in */<br /> /* the font file. */<br /> /* */<br /> /* Bits 16-30 are relevant to GX variation */<br /> /* fonts only, holding the named instance */<br /> /* index for the current face index (starting */<br /> /* with value~1; value~0 indicates font access */<br /> /* without GX variation data). For non-GX */<br /> /* fonts, bits 16-30 are ignored. If we have */<br /> /* the third named instance of face~4, say, */<br /> /* `face_index’ is set to 0x00030004. */<br /> /* */<br /> /* Bit 31 is always zero (this is, */<br /> /* `face_index’ is always a positive value). */<br /> /* */<br /> /* face_flags :: A set of bit flags that give important */<br /> /* information about the face; see */<br /> /* @FT_FACE_FLAG_XXX for the details. */<br /> /* */<br /> /* style_flags :: The lower 16~bits contain a set of bit */<br /> /* flags indicating the style of the face; see */<br /> /* @FT_STYLE_FLAG_XXX for the details. Bits */<br /> /* 16-30 hold the number of named instances */<br /> /* available for the current face if we have a */<br /> /* GX variation (sub)font. Bit 31 is always */<br /> /* zero (this is, `style_flags’ is always a */<br /> /* positive value). */<br /> /* */<br /> /* num_glyphs :: The number of glyphs in the face. If the */<br /> /* face is scalable and has sbits (see */<br /> /* `num_fixed_sizes’), it is set to the number */<br /> /* of outline glyphs. */<br /> /* */<br /> /* For CID-keyed fonts, this value gives the */<br /> /* highest CID used in the font. */<br /> /* */<br /> /* family_name :: The face’s family name. This is an ASCII */<br /> /* string, usually in English, that describes */<br /> /* the typeface’s family (like `Times New */<br /> /* Roman’, `Bodoni’, `Garamond’, etc). This */<br /> /* is a least common denominator used to list */<br /> /* fonts. Some formats (TrueType & OpenType) */<br /> /* provide localized and Unicode versions of */<br /> /* this string. Applications should use the */<br /> /* format specific interface to access them. */<br /> /* Can be NULL (e.g., in fonts embedded in a */<br /> /* PDF file). */<br /> /* */<br /> /* In case the font doesn’t provide a specific */<br /> /* family name entry, FreeType tries to */<br /> /* synthesize one, deriving it from other name */<br /> /* entries. */<br /> /* */<br /> /* style_name :: The face’s style name. This is an ASCII */<br /> /* string, usually in English, that describes */<br /> /* the typeface’s style (like `Italic’, */<br /> /* `Bold’, `Condensed’, etc). Not all font */<br /> /* formats provide a style name, so this field */<br /> /* is optional, and can be set to NULL. As */<br /> /* for `family_name’, some formats provide */<br /> /* localized and Unicode versions of this */<br /> /* string. Applications should use the format */<br /> /* specific interface to access them. */<br /> /* */<br /> /* num_fixed_sizes :: The number of bitmap strikes in the face. */<br /> /* Even if the face is scalable, there might */<br /> /* still be bitmap strikes, which are called */<br /> /* `sbits’ in that case. */<br /> /* */<br /> /* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */<br /> /* strikes in the face. It is set to NULL if */<br /> /* there is no bitmap strike. */<br /> /* */<br /> /* num_charmaps :: The number of charmaps in the face. */<br /> /* */<br /> /* charmaps :: An array of the charmaps of the face. */<br /> /* */<br /> /* generic :: A field reserved for client uses. See the */<br /> /* @FT_Generic type description. */<br /> /* */<br /> /* bbox :: The font bounding box. Coordinates are */<br /> /* expressed in font units (see */<br /> /* `units_per_EM’). The box is large enough */<br /> /* to contain any glyph from the font. Thus, */<br /> /* `bbox.yMax’ can be seen as the `maximum */<br /> /* ascender’, and `bbox.yMin’ as the `minimum */<br /> /* descender’. Only relevant for scalable */<br /> /* formats. */<br /> /* */<br /> /* Note that the bounding box might be off by */<br /> /* (at least) one pixel for hinted fonts. See */<br /> /* @FT_Size_Metrics for further discussion. */<br /> /* */<br /> /* units_per_EM :: The number of font units per EM square for */<br /> /* this face. This is typically 2048 for */<br /> /* TrueType fonts, and 1000 for Type~1 fonts. */<br /> /* Only relevant for scalable formats. */<br /> /* */<br /> /* ascender :: The typographic ascender of the face, */<br /> /* expressed in font units. For font formats */<br /> /* not having this information, it is set to */<br /> /* `bbox.yMax’. Only relevant for scalable */<br /> /* formats. */<br /> /* */<br /> /* descender :: The typographic descender of the face, */<br /> /* expressed in font units. For font formats */<br /> /* not having this information, it is set to */<br /> /* `bbox.yMin’. Note that this field is */<br /> /* usually negative. Only relevant for */<br /> /* scalable formats. */<br /> /* */<br /> /* height :: This value is the vertical distance */<br /> /* between two consecutive baselines, */<br /> /* expressed in font units. It is always */<br /> /* positive. Only relevant for scalable */<br /> /* formats. */<br /> /* */<br /> /* If you want the global glyph height, use */<br /> /* `ascender – descender’. */<br /> /* */<br /> /* max_advance_width :: The maximum advance width, in font units, */<br /> /* for all glyphs in this face. This can be */<br /> /* used to make word wrapping computations */<br /> /* faster. Only relevant for scalable */<br /> /* formats. */<br /> /* */<br /> /* max_advance_height :: The maximum advance height, in font units, */<br /> /* for all glyphs in this face. This is only */<br /> /* relevant for vertical layouts, and is set */<br /> /* to `height’ for fonts that do not provide */<br /> /* vertical metrics. Only relevant for */<br /> /* scalable formats. */<br /> /* */<br /> /* underline_position :: The position, in font units, of the */<br /> /* underline line for this face. It is the */<br /> /* center of the underlining stem. Only */<br /> /* relevant for scalable formats. */<br /> /* */<br /> /* underline_thickness :: The thickness, in font units, of the */<br /> /* underline for this face. Only relevant for */<br /> /* scalable formats. */<br /> /* */<br /> /* glyph :: The face’s associated glyph slot(s). */<br /> /* */<br /> /* size :: The current active size for this face. */<br /> /* */<br /> /* charmap :: The current active charmap for this face. */<br /> /* */<br /> /* <Note> */<br /> /* Fields may be changed after a call to @FT_Attach_File or */<br /> /* @FT_Attach_Stream. */<br /> /* */<br /> typedef struct FT_FaceRec_<br /> {<br /> FT_Long num_faces;<br /> FT_Long face_index;</p> <p> FT_Long face_flags;<br /> FT_Long style_flags;</p> <p> FT_Long num_glyphs;</p> <p> FT_String* family_name;<br /> FT_String* style_name;</p> <p> FT_Int num_fixed_sizes;<br /> FT_Bitmap_Size* available_sizes;</p> <p> FT_Int num_charmaps;<br /> FT_CharMap* charmaps;</p> <p> FT_Generic generic;</p> <p> /*# The following member variables (down to `underline_thickness’) */<br /> /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */<br /> /*# for bitmap fonts. */<br /> FT_BBox bbox;</p> <p> FT_UShort units_per_EM;<br /> FT_Short ascender;<br /> FT_Short descender;<br /> FT_Short height;</p> <p> FT_Short max_advance_width;<br /> FT_Short max_advance_height;</p> <p> FT_Short underline_position;<br /> FT_Short underline_thickness;</p> <p> FT_GlyphSlot glyph;<br /> FT_Size size;<br /> FT_CharMap charmap;</p> <p> /*@private begin */</p> <p> FT_Driver driver;<br /> FT_Memory memory;<br /> FT_Stream stream;</p> <p> FT_ListRec sizes_list;</p> <p> FT_Generic autohint; /* face-specific auto-hinter data */<br /> void* extensions; /* unused */</p> <p> FT_Face_Internal internal;</p> <p> /*@private end */</p> <p> } FT_FaceRec;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Enum> */<br /> /* FT_FACE_FLAG_XXX */<br /> /* */<br /> /* <Description> */<br /> /* A list of bit flags used in the `face_flags’ field of the */<br /> /* @FT_FaceRec structure. They inform client applications of */<br /> /* properties of the corresponding face. */<br /> /* */<br /> /* <Values> */<br /> /* FT_FACE_FLAG_SCALABLE :: */<br /> /* Indicates that the face contains outline glyphs. This doesn’t */<br /> /* prevent bitmap strikes, i.e., a face can have both this and */<br /> /* and @FT_FACE_FLAG_FIXED_SIZES set. */<br /> /* */<br /> /* FT_FACE_FLAG_FIXED_SIZES :: */<br /> /* Indicates that the face contains bitmap strikes. See also the */<br /> /* `num_fixed_sizes’ and `available_sizes’ fields of @FT_FaceRec. */<br /> /* */<br /> /* FT_FACE_FLAG_FIXED_WIDTH :: */<br /> /* Indicates that the face contains fixed-width characters (like */<br /> /* Courier, Lucido, MonoType, etc.). */<br /> /* */<br /> /* FT_FACE_FLAG_SFNT :: */<br /> /* Indicates that the face uses the `sfnt’ storage scheme. For */<br /> /* now, this means TrueType and OpenType. */<br /> /* */<br /> /* FT_FACE_FLAG_HORIZONTAL :: */<br /> /* Indicates that the face contains horizontal glyph metrics. This */<br /> /* should be set for all common formats. */<br /> /* */<br /> /* FT_FACE_FLAG_VERTICAL :: */<br /> /* Indicates that the face contains vertical glyph metrics. This */<br /> /* is only available in some formats, not all of them. */<br /> /* */<br /> /* FT_FACE_FLAG_KERNING :: */<br /> /* Indicates that the face contains kerning information. If set, */<br /> /* the kerning distance can be retrieved through the function */<br /> /* @FT_Get_Kerning. Otherwise the function always return the */<br /> /* vector (0,0). Note that FreeType doesn’t handle kerning data */<br /> /* from the `GPOS’ table (as present in some OpenType fonts). */<br /> /* */<br /> /* FT_FACE_FLAG_FAST_GLYPHS :: */<br /> /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */<br /> /* */<br /> /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */<br /> /* Indicates that the font contains multiple masters and is capable */<br /> /* of interpolating between them. See the multiple-masters */<br /> /* specific API for details. */<br /> /* */<br /> /* FT_FACE_FLAG_GLYPH_NAMES :: */<br /> /* Indicates that the font contains glyph names that can be */<br /> /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */<br /> /* fonts contain broken glyph name tables. Use the function */<br /> /* @FT_Has_PS_Glyph_Names when needed. */<br /> /* */<br /> /* FT_FACE_FLAG_EXTERNAL_STREAM :: */<br /> /* Used internally by FreeType to indicate that a face’s stream was */<br /> /* provided by the client application and should not be destroyed */<br /> /* when @FT_Done_Face is called. Don’t read or test this flag. */<br /> /* */<br /> /* FT_FACE_FLAG_HINTER :: */<br /> /* Set if the font driver has a hinting machine of its own. For */<br /> /* example, with TrueType fonts, it makes sense to use data from */<br /> /* the SFNT `gasp’ table only if the native TrueType hinting engine */<br /> /* (with the bytecode interpreter) is available and active. */<br /> /* */<br /> /* FT_FACE_FLAG_CID_KEYED :: */<br /> /* Set if the font is CID-keyed. In that case, the font is not */<br /> /* accessed by glyph indices but by CID values. For subsetted */<br /> /* CID-keyed fonts this has the consequence that not all index */<br /> /* values are a valid argument to FT_Load_Glyph. Only the CID */<br /> /* values for which corresponding glyphs in the subsetted font */<br /> /* exist make FT_Load_Glyph return successfully; in all other cases */<br /> /* you get an `FT_Err_Invalid_Argument’ error. */<br /> /* */<br /> /* Note that CID-keyed fonts that are in an SFNT wrapper don’t */<br /> /* have this flag set since the glyphs are accessed in the normal */<br /> /* way (using contiguous indices); the `CID-ness’ isn’t visible to */<br /> /* the application. */<br /> /* */<br /> /* FT_FACE_FLAG_TRICKY :: */<br /> /* Set if the font is `tricky’, this is, it always needs the */<br /> /* font format’s native hinting engine to get a reasonable result. */<br /> /* A typical example is the Chinese font `mingli.ttf’ that uses */<br /> /* TrueType bytecode instructions to move and scale all of its */<br /> /* subglyphs. */<br /> /* */<br /> /* It is not possible to auto-hint such fonts using */<br /> /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */<br /> /* @FT_LOAD_NO_HINTING. You have to set both @FT_LOAD_NO_HINTING */<br /> /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */<br /> /* probably never want this except for demonstration purposes. */<br /> /* */<br /> /* Currently, there are about a dozen TrueType fonts in the list of */<br /> /* tricky fonts; they are hard-coded in file `ttobjs.c’. */<br /> /* */<br /> /* FT_FACE_FLAG_COLOR :: */<br /> /* Set if the font has color glyph tables. To access color glyphs */<br /> /* use @FT_LOAD_COLOR. */<br /> /* */<br /> #define FT_FACE_FLAG_SCALABLE ( 1L << 0 ) #define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 ) #define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 ) #define FT_FACE_FLAG_SFNT ( 1L << 3 ) #define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 ) #define FT_FACE_FLAG_VERTICAL ( 1L << 5 ) #define FT_FACE_FLAG_KERNING ( 1L << 6 ) #define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 ) #define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 ) #define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 ) #define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 ) #define FT_FACE_FLAG_HINTER ( 1L << 11 ) #define FT_FACE_FLAG_CID_KEYED ( 1L << 12 ) #define FT_FACE_FLAG_TRICKY ( 1L << 13 ) #define FT_FACE_FLAG_COLOR ( 1L << 14 ) /************************************************************************* * * @macro: * FT_HAS_HORIZONTAL( face ) * * @description: * A macro that returns true whenever a face object contains * horizontal metrics (this is true for all font formats though). * * @also: * @FT_HAS_VERTICAL can be used to check for vertical metrics. * */ #define FT_HAS_HORIZONTAL( face ) \ ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )</p> <p> /*************************************************************************<br /> *<br /> * @macro:<br /> * FT_HAS_VERTICAL( face )<br /> *<br /> * @description:<br /> * A macro that returns true whenever a face object contains real<br /> * vertical metrics (and not only synthesized ones).<br /> *<br /> */<br /> #define FT_HAS_VERTICAL( face ) \<br /> ( face->face_flags & FT_FACE_FLAG_VERTICAL )</p> <p> /*************************************************************************<br /> *<br /> * @macro:<br /> * FT_HAS_KERNING( face )<br /> *<br /> * @description:<br /> * A macro that returns true whenever a face object contains kerning<br /> * data that can be accessed with @FT_Get_Kerning.<br /> *<br /> */<br /> #define FT_HAS_KERNING( face ) \<br /> ( face->face_flags & FT_FACE_FLAG_KERNING )</p> <p> /*************************************************************************<br /> *<br /> * @macro:<br /> * FT_IS_SCALABLE( face )<br /> *<br /> * @description:<br /> * A macro that returns true whenever a face object contains a scalable<br /> * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,<br /> * and PFR font formats.<br /> *<br /> */<br /> #define FT_IS_SCALABLE( face ) \<br /> ( face->face_flags & FT_FACE_FLAG_SCALABLE )</p> <p> /*************************************************************************<br /> *<br /> * @macro:<br /> * FT_IS_SFNT( face )<br /> *<br /> * @description:<br /> * A macro that returns true whenever a face object contains a font<br /> * whose format is based on the SFNT storage scheme. This usually<br /> * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded<br /> * bitmap fonts.<br /> *<br /> * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and<br /> * @FT_TRUETYPE_TABLES_H are available.<br /> *<br /> */<br /> #define FT_IS_SFNT( face ) \<br /> ( face->face_flags & FT_FACE_FLAG_SFNT )</p> <p> /*************************************************************************<br /> *<br /> * @macro:<br /> * FT_IS_FIXED_WIDTH( face )<br /> *<br /> * @description:<br /> * A macro that returns true whenever a face object contains a font face<br /> * that contains fixed-width (or `monospace’, `fixed-pitch’, etc.)<br /> * glyphs.<br /> *<br /> */<br /> #define FT_IS_FIXED_WIDTH( face ) \<br /> ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )</p> <p> /*************************************************************************<br /> *<br /> * @macro:<br /> * FT_HAS_FIXED_SIZES( face )<br /> *<br /> * @description:<br /> * A macro that returns true whenever a face object contains some<br /> * embedded bitmaps. See the `available_sizes’ field of the<br /> * @FT_FaceRec structure.<br /> *<br /> */<br /> #define FT_HAS_FIXED_SIZES( face ) \<br /> ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )</p> <p> /*************************************************************************<br /> *<br /> * @macro:<br /> * FT_HAS_FAST_GLYPHS( face )<br /> *<br /> * @description:<br /> * Deprecated.<br /> *<br /> */<br /> #define FT_HAS_FAST_GLYPHS( face ) 0</p> <p> /*************************************************************************<br /> *<br /> * @macro:<br /> * FT_HAS_GLYPH_NAMES( face )<br /> *<br /> * @description:<br /> * A macro that returns true whenever a face object contains some glyph<br /> * names that can be accessed through @FT_Get_Glyph_Name.<br /> *<br /> */<br /> #define FT_HAS_GLYPH_NAMES( face ) \<br /> ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )</p> <p> /*************************************************************************<br /> *<br /> * @macro:<br /> * FT_HAS_MULTIPLE_MASTERS( face )<br /> *<br /> * @description:<br /> * A macro that returns true whenever a face object contains some<br /> * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H<br /> * are then available to choose the exact design you want.<br /> *<br /> */<br /> #define FT_HAS_MULTIPLE_MASTERS( face ) \<br /> ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )</p> <p> /*************************************************************************<br /> *<br /> * @macro:<br /> * FT_IS_CID_KEYED( face )<br /> *<br /> * @description:<br /> * A macro that returns true whenever a face object contains a CID-keyed<br /> * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more<br /> * details.<br /> *<br /> * If this macro is true, all functions defined in @FT_CID_H are<br /> * available.<br /> *<br /> */<br /> #define FT_IS_CID_KEYED( face ) \<br /> ( face->face_flags & FT_FACE_FLAG_CID_KEYED )</p> <p> /*************************************************************************<br /> *<br /> * @macro:<br /> * FT_IS_TRICKY( face )<br /> *<br /> * @description:<br /> * A macro that returns true whenever a face represents a `tricky’ font.<br /> * See the discussion of @FT_FACE_FLAG_TRICKY for more details.<br /> *<br /> */<br /> #define FT_IS_TRICKY( face ) \<br /> ( face->face_flags & FT_FACE_FLAG_TRICKY )</p> <p> /*************************************************************************<br /> *<br /> * @macro:<br /> * FT_HAS_COLOR( face )<br /> *<br /> * @description:<br /> * A macro that returns true whenever a face object contains<br /> * tables for color glyphs.<br /> *<br /> */<br /> #define FT_HAS_COLOR( face ) \<br /> ( face->face_flags & FT_FACE_FLAG_COLOR )</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Const> */<br /> /* FT_STYLE_FLAG_XXX */<br /> /* */<br /> /* <Description> */<br /> /* A list of bit flags used to indicate the style of a given face. */<br /> /* These are used in the `style_flags’ field of @FT_FaceRec. */<br /> /* */<br /> /* <Values> */<br /> /* FT_STYLE_FLAG_ITALIC :: */<br /> /* Indicates that a given face style is italic or oblique. */<br /> /* */<br /> /* FT_STYLE_FLAG_BOLD :: */<br /> /* Indicates that a given face is bold. */<br /> /* */<br /> /* <Note> */<br /> /* The style information as provided by FreeType is very basic. More */<br /> /* details are beyond the scope and should be done on a higher level */<br /> /* (for example, by analyzing various fields of the `OS/2′ table in */<br /> /* SFNT based fonts). */<br /> /* */<br /> #define FT_STYLE_FLAG_ITALIC ( 1 << 0 ) #define FT_STYLE_FLAG_BOLD ( 1 << 1 ) /*************************************************************************/ /* */ /* <Type> */<br /> /* FT_Size_Internal */<br /> /* */<br /> /* <Description> */<br /> /* An opaque handle to an `FT_Size_InternalRec’ structure, used to */<br /> /* model private data of a given @FT_Size object. */<br /> /* */<br /> typedef struct FT_Size_InternalRec_* FT_Size_Internal;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Struct> */<br /> /* FT_Size_Metrics */<br /> /* */<br /> /* <Description> */<br /> /* The size metrics structure gives the metrics of a size object. */<br /> /* */<br /> /* <Fields> */<br /> /* x_ppem :: The width of the scaled EM square in pixels, hence */<br /> /* the term `ppem’ (pixels per EM). It is also */<br /> /* referred to as `nominal width’. */<br /> /* */<br /> /* y_ppem :: The height of the scaled EM square in pixels, */<br /> /* hence the term `ppem’ (pixels per EM). It is also */<br /> /* referred to as `nominal height’. */<br /> /* */<br /> /* x_scale :: A 16.16 fractional scaling value used to convert */<br /> /* horizontal metrics from font units to 26.6 */<br /> /* fractional pixels. Only relevant for scalable */<br /> /* font formats. */<br /> /* */<br /> /* y_scale :: A 16.16 fractional scaling value used to convert */<br /> /* vertical metrics from font units to 26.6 */<br /> /* fractional pixels. Only relevant for scalable */<br /> /* font formats. */<br /> /* */<br /> /* ascender :: The ascender in 26.6 fractional pixels. See */<br /> /* @FT_FaceRec for the details. */<br /> /* */<br /> /* descender :: The descender in 26.6 fractional pixels. See */<br /> /* @FT_FaceRec for the details. */<br /> /* */<br /> /* height :: The height in 26.6 fractional pixels. See */<br /> /* @FT_FaceRec for the details. */<br /> /* */<br /> /* max_advance :: The maximum advance width in 26.6 fractional */<br /> /* pixels. See @FT_FaceRec for the details. */<br /> /* */<br /> /* <Note> */<br /> /* The scaling values, if relevant, are determined first during a */<br /> /* size changing operation. The remaining fields are then set by the */<br /> /* driver. For scalable formats, they are usually set to scaled */<br /> /* values of the corresponding fields in @FT_FaceRec. */<br /> /* */<br /> /* Note that due to glyph hinting, these values might not be exact */<br /> /* for certain fonts. Thus they must be treated as unreliable */<br /> /* with an error margin of at least one pixel! */<br /> /* */<br /> /* Indeed, the only way to get the exact metrics is to render _all_ */<br /> /* glyphs. As this would be a definite performance hit, it is up to */<br /> /* client applications to perform such computations. */<br /> /* */<br /> /* The FT_Size_Metrics structure is valid for bitmap fonts also. */<br /> /* */<br /> typedef struct FT_Size_Metrics_<br /> {<br /> FT_UShort x_ppem; /* horizontal pixels per EM */<br /> FT_UShort y_ppem; /* vertical pixels per EM */</p> <p> FT_Fixed x_scale; /* scaling values used to convert font */<br /> FT_Fixed y_scale; /* units to 26.6 fractional pixels */</p> <p> FT_Pos ascender; /* ascender in 26.6 frac. pixels */<br /> FT_Pos descender; /* descender in 26.6 frac. pixels */<br /> FT_Pos height; /* text height in 26.6 frac. pixels */<br /> FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */</p> <p> } FT_Size_Metrics;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Struct> */<br /> /* FT_SizeRec */<br /> /* */<br /> /* <Description> */<br /> /* FreeType root size class structure. A size object models a face */<br /> /* object at a given size. */<br /> /* */<br /> /* <Fields> */<br /> /* face :: Handle to the parent face object. */<br /> /* */<br /> /* generic :: A typeless pointer, unused by the FreeType library or */<br /> /* any of its drivers. It can be used by client */<br /> /* applications to link their own data to each size */<br /> /* object. */<br /> /* */<br /> /* metrics :: Metrics for this size object. This field is read-only. */<br /> /* */<br /> typedef struct FT_SizeRec_<br /> {<br /> FT_Face face; /* parent face object */<br /> FT_Generic generic; /* generic pointer for client uses */<br /> FT_Size_Metrics metrics; /* size metrics */<br /> FT_Size_Internal internal;</p> <p> } FT_SizeRec;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Struct> */<br /> /* FT_SubGlyph */<br /> /* */<br /> /* <Description> */<br /> /* The subglyph structure is an internal object used to describe */<br /> /* subglyphs (for example, in the case of composites). */<br /> /* */<br /> /* <Note> */<br /> /* The subglyph implementation is not part of the high-level API, */<br /> /* hence the forward structure declaration. */<br /> /* */<br /> /* You can however retrieve subglyph information with */<br /> /* @FT_Get_SubGlyph_Info. */<br /> /* */<br /> typedef struct FT_SubGlyphRec_* FT_SubGlyph;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Type> */<br /> /* FT_Slot_Internal */<br /> /* */<br /> /* <Description> */<br /> /* An opaque handle to an `FT_Slot_InternalRec’ structure, used to */<br /> /* model private data of a given @FT_GlyphSlot object. */<br /> /* */<br /> typedef struct FT_Slot_InternalRec_* FT_Slot_Internal;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Struct> */<br /> /* FT_GlyphSlotRec */<br /> /* */<br /> /* <Description> */<br /> /* FreeType root glyph slot class structure. A glyph slot is a */<br /> /* container where individual glyphs can be loaded, be they in */<br /> /* outline or bitmap format. */<br /> /* */<br /> /* <Fields> */<br /> /* library :: A handle to the FreeType library instance */<br /> /* this slot belongs to. */<br /> /* */<br /> /* face :: A handle to the parent face object. */<br /> /* */<br /> /* next :: In some cases (like some font tools), several */<br /> /* glyph slots per face object can be a good */<br /> /* thing. As this is rare, the glyph slots are */<br /> /* listed through a direct, single-linked list */<br /> /* using its `next’ field. */<br /> /* */<br /> /* generic :: A typeless pointer unused by the FreeType */<br /> /* library or any of its drivers. It can be */<br /> /* used by client applications to link their own */<br /> /* data to each glyph slot object. */<br /> /* */<br /> /* metrics :: The metrics of the last loaded glyph in the */<br /> /* slot. The returned values depend on the last */<br /> /* load flags (see the @FT_Load_Glyph API */<br /> /* function) and can be expressed either in 26.6 */<br /> /* fractional pixels or font units. */<br /> /* */<br /> /* Note that even when the glyph image is */<br /> /* transformed, the metrics are not. */<br /> /* */<br /> /* linearHoriAdvance :: The advance width of the unhinted glyph. */<br /> /* Its value is expressed in 16.16 fractional */<br /> /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */<br /> /* when loading the glyph. This field can be */<br /> /* important to perform correct WYSIWYG layout. */<br /> /* Only relevant for outline glyphs. */<br /> /* */<br /> /* linearVertAdvance :: The advance height of the unhinted glyph. */<br /> /* Its value is expressed in 16.16 fractional */<br /> /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */<br /> /* when loading the glyph. This field can be */<br /> /* important to perform correct WYSIWYG layout. */<br /> /* Only relevant for outline glyphs. */<br /> /* */<br /> /* advance :: This shorthand is, depending on */<br /> /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */<br /> /* (hinted) advance width for the glyph, in 26.6 */<br /> /* fractional pixel format. As specified with */<br /> /* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */<br /> /* `horiAdvance’ or the `vertAdvance’ value of */<br /> /* `metrics’ field. */<br /> /* */<br /> /* format :: This field indicates the format of the image */<br /> /* contained in the glyph slot. Typically */<br /> /* @FT_GLYPH_FORMAT_BITMAP, */<br /> /* @FT_GLYPH_FORMAT_OUTLINE, or */<br /> /* @FT_GLYPH_FORMAT_COMPOSITE, but others are */<br /> /* possible. */<br /> /* */<br /> /* bitmap :: This field is used as a bitmap descriptor */<br /> /* when the slot format is */<br /> /* @FT_GLYPH_FORMAT_BITMAP. Note that the */<br /> /* address and content of the bitmap buffer can */<br /> /* change between calls of @FT_Load_Glyph and a */<br /> /* few other functions. */<br /> /* */<br /> /* bitmap_left :: The bitmap’s left bearing expressed in */<br /> /* integer pixels. Only valid if the format is */<br /> /* @FT_GLYPH_FORMAT_BITMAP, this is, if the */<br /> /* glyph slot contains a bitmap. */<br /> /* */<br /> /* bitmap_top :: The bitmap’s top bearing expressed in integer */<br /> /* pixels. Remember that this is the distance */<br /> /* from the baseline to the top-most glyph */<br /> /* scanline, upwards y~coordinates being */<br /> /* *positive*. */<br /> /* */<br /> /* outline :: The outline descriptor for the current glyph */<br /> /* image if its format is */<br /> /* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */<br /> /* loaded, `outline’ can be transformed, */<br /> /* distorted, embolded, etc. However, it must */<br /> /* not be freed. */<br /> /* */<br /> /* num_subglyphs :: The number of subglyphs in a composite glyph. */<br /> /* This field is only valid for the composite */<br /> /* glyph format that should normally only be */<br /> /* loaded with the @FT_LOAD_NO_RECURSE flag. */<br /> /* */<br /> /* subglyphs :: An array of subglyph descriptors for */<br /> /* composite glyphs. There are `num_subglyphs’ */<br /> /* elements in there. Currently internal to */<br /> /* FreeType. */<br /> /* */<br /> /* control_data :: Certain font drivers can also return the */<br /> /* control data for a given glyph image (e.g. */<br /> /* TrueType bytecode, Type~1 charstrings, etc.). */<br /> /* This field is a pointer to such data. */<br /> /* */<br /> /* control_len :: This is the length in bytes of the control */<br /> /* data. */<br /> /* */<br /> /* other :: Really wicked formats can use this pointer to */<br /> /* present their own glyph image to client */<br /> /* applications. Note that the application */<br /> /* needs to know about the image format. */<br /> /* */<br /> /* lsb_delta :: The difference between hinted and unhinted */<br /> /* left side bearing while auto-hinting is */<br /> /* active. Zero otherwise. */<br /> /* */<br /> /* rsb_delta :: The difference between hinted and unhinted */<br /> /* right side bearing while auto-hinting is */<br /> /* active. Zero otherwise. */<br /> /* */<br /> /* <Note> */<br /> /* If @FT_Load_Glyph is called with default flags (see */<br /> /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */<br /> /* its native format (e.g., an outline glyph for TrueType and Type~1 */<br /> /* formats). */<br /> /* */<br /> /* This image can later be converted into a bitmap by calling */<br /> /* @FT_Render_Glyph. This function finds the current renderer for */<br /> /* the native image’s format, then invokes it. */<br /> /* */<br /> /* The renderer is in charge of transforming the native image through */<br /> /* the slot’s face transformation fields, then converting it into a */<br /> /* bitmap that is returned in `slot->bitmap’. */<br /> /* */<br /> /* Note that `slot->bitmap_left’ and `slot->bitmap_top’ are also used */<br /> /* to specify the position of the bitmap relative to the current pen */<br /> /* position (e.g., coordinates (0,0) on the baseline). Of course, */<br /> /* `slot->format’ is also changed to @FT_GLYPH_FORMAT_BITMAP. */<br /> /* */<br /> /* <Note> */<br /> /* Here is a small pseudo code fragment that shows how to use */<br /> /* `lsb_delta’ and `rsb_delta’: */<br /> /* */<br /> /* { */<br /> /* FT_Pos origin_x = 0; */<br /> /* FT_Pos prev_rsb_delta = 0; */<br /> /* */<br /> /* */<br /> /* for all glyphs do */<br /> /* <compute kern between current and previous glyph and add it to */ /* `origin_x'> */<br /> /* */<br /> /* <load glyph with `FT_Load_Glyph'> */<br /> /* */<br /> /* if ( prev_rsb_delta – face->glyph->lsb_delta >= 32 ) */<br /> /* origin_x -= 64; */<br /> /* else if ( prev_rsb_delta – face->glyph->lsb_delta < -32 ) */ /* origin_x += 64; */ /* */ /* prev_rsb_delta = face->glyph->rsb_delta; */<br /> /* */<br /> /* <save glyph image, or render glyph, or ...> */<br /> /* */<br /> /* origin_x += face->glyph->advance.x; */<br /> /* endfor */<br /> /* } */<br /> /* */<br /> typedef struct FT_GlyphSlotRec_<br /> {<br /> FT_Library library;<br /> FT_Face face;<br /> FT_GlyphSlot next;<br /> FT_UInt reserved; /* retained for binary compatibility */<br /> FT_Generic generic;</p> <p> FT_Glyph_Metrics metrics;<br /> FT_Fixed linearHoriAdvance;<br /> FT_Fixed linearVertAdvance;<br /> FT_Vector advance;</p> <p> FT_Glyph_Format format;</p> <p> FT_Bitmap bitmap;<br /> FT_Int bitmap_left;<br /> FT_Int bitmap_top;</p> <p> FT_Outline outline;</p> <p> FT_UInt num_subglyphs;<br /> FT_SubGlyph subglyphs;</p> <p> void* control_data;<br /> long control_len;</p> <p> FT_Pos lsb_delta;<br /> FT_Pos rsb_delta;</p> <p> void* other;</p> <p> FT_Slot_Internal internal;</p> <p> } FT_GlyphSlotRec;</p> <p> /*************************************************************************/<br /> /*************************************************************************/<br /> /* */<br /> /* F U N C T I O N S */<br /> /* */<br /> /*************************************************************************/<br /> /*************************************************************************/</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Init_FreeType */<br /> /* */<br /> /* <Description> */<br /> /* Initialize a new FreeType library object. The set of modules */<br /> /* that are registered by this function is determined at build time. */<br /> /* */<br /> /* <Output> */<br /> /* alibrary :: A handle to a new library object. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* In case you want to provide your own memory allocating routines, */<br /> /* use @FT_New_Library instead, followed by a call to */<br /> /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */<br /> /* */<br /> /* See the documentation of @FT_Library and @FT_Face for */<br /> /* multi-threading issues. */<br /> /* */<br /> /* If you need reference-counting (cf. @FT_Reference_Library), use */<br /> /* @FT_New_Library and @FT_Done_Library. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Init_FreeType( FT_Library *alibrary );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Done_FreeType */<br /> /* */<br /> /* <Description> */<br /> /* Destroy a given FreeType library object and all of its children, */<br /> /* including resources, drivers, faces, sizes, etc. */<br /> /* */<br /> /* <Input> */<br /> /* library :: A handle to the target library object. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Done_FreeType( FT_Library library );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Enum> */<br /> /* FT_OPEN_XXX */<br /> /* */<br /> /* <Description> */<br /> /* A list of bit field constants used within the `flags’ field of the */<br /> /* @FT_Open_Args structure. */<br /> /* */<br /> /* <Values> */<br /> /* FT_OPEN_MEMORY :: This is a memory-based stream. */<br /> /* */<br /> /* FT_OPEN_STREAM :: Copy the stream from the `stream’ field. */<br /> /* */<br /> /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */<br /> /* name. */<br /> /* */<br /> /* FT_OPEN_DRIVER :: Use the `driver’ field. */<br /> /* */<br /> /* FT_OPEN_PARAMS :: Use the `num_params’ and `params’ fields. */<br /> /* */<br /> /* <Note> */<br /> /* The `FT_OPEN_MEMORY’, `FT_OPEN_STREAM’, and `FT_OPEN_PATHNAME’ */<br /> /* flags are mutually exclusive. */<br /> /* */<br /> #define FT_OPEN_MEMORY 0x1<br /> #define FT_OPEN_STREAM 0x2<br /> #define FT_OPEN_PATHNAME 0x4<br /> #define FT_OPEN_DRIVER 0x8<br /> #define FT_OPEN_PARAMS 0x10</p> <p> /* these constants are deprecated; use the corresponding `FT_OPEN_XXX’ */<br /> /* values instead */<br /> #define ft_open_memory FT_OPEN_MEMORY<br /> #define ft_open_stream FT_OPEN_STREAM<br /> #define ft_open_pathname FT_OPEN_PATHNAME<br /> #define ft_open_driver FT_OPEN_DRIVER<br /> #define ft_open_params FT_OPEN_PARAMS</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Struct> */<br /> /* FT_Parameter */<br /> /* */<br /> /* <Description> */<br /> /* A simple structure used to pass more or less generic parameters to */<br /> /* @FT_Open_Face. */<br /> /* */<br /> /* <Fields> */<br /> /* tag :: A four-byte identification tag. */<br /> /* */<br /> /* data :: A pointer to the parameter data. */<br /> /* */<br /> /* <Note> */<br /> /* The ID and function of parameters are driver-specific. See the */<br /> /* various FT_PARAM_TAG_XXX flags for more information. */<br /> /* */<br /> typedef struct FT_Parameter_<br /> {<br /> FT_ULong tag;<br /> FT_Pointer data;</p> <p> } FT_Parameter;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Struct> */<br /> /* FT_Open_Args */<br /> /* */<br /> /* <Description> */<br /> /* A structure used to indicate how to open a new font file or */<br /> /* stream. A pointer to such a structure can be used as a parameter */<br /> /* for the functions @FT_Open_Face and @FT_Attach_Stream. */<br /> /* */<br /> /* <Fields> */<br /> /* flags :: A set of bit flags indicating how to use the */<br /> /* structure. */<br /> /* */<br /> /* memory_base :: The first byte of the file in memory. */<br /> /* */<br /> /* memory_size :: The size in bytes of the file in memory. */<br /> /* */<br /> /* pathname :: A pointer to an 8-bit file pathname. */<br /> /* */<br /> /* stream :: A handle to a source stream object. */<br /> /* */<br /> /* driver :: This field is exclusively used by @FT_Open_Face; */<br /> /* it simply specifies the font driver to use to open */<br /> /* the face. If set to~0, FreeType tries to load the */<br /> /* face with each one of the drivers in its list. */<br /> /* */<br /> /* num_params :: The number of extra parameters. */<br /> /* */<br /> /* params :: Extra parameters passed to the font driver when */<br /> /* opening a new face. */<br /> /* */<br /> /* <Note> */<br /> /* The stream type is determined by the contents of `flags’ that */<br /> /* are tested in the following order by @FT_Open_Face: */<br /> /* */<br /> /* If the @FT_OPEN_MEMORY bit is set, assume that this is a */<br /> /* memory file of `memory_size’ bytes, located at `memory_address’. */<br /> /* The data are are not copied, and the client is responsible for */<br /> /* releasing and destroying them _after_ the corresponding call to */<br /> /* @FT_Done_Face. */<br /> /* */<br /> /* Otherwise, if the @FT_OPEN_STREAM bit is set, assume that a */<br /> /* custom input stream `stream’ is used. */<br /> /* */<br /> /* Otherwise, if the @FT_OPEN_PATHNAME bit is set, assume that this */<br /> /* is a normal file and use `pathname’ to open it. */<br /> /* */<br /> /* If the @FT_OPEN_DRIVER bit is set, @FT_Open_Face only tries to */<br /> /* open the file with the driver whose handler is in `driver’. */<br /> /* */<br /> /* If the @FT_OPEN_PARAMS bit is set, the parameters given by */<br /> /* `num_params’ and `params’ is used. They are ignored otherwise. */<br /> /* */<br /> /* Ideally, both the `pathname’ and `params’ fields should be tagged */<br /> /* as `const’; this is missing for API backwards compatibility. In */<br /> /* other words, applications should treat them as read-only. */<br /> /* */<br /> typedef struct FT_Open_Args_<br /> {<br /> FT_UInt flags;<br /> const FT_Byte* memory_base;<br /> FT_Long memory_size;<br /> FT_String* pathname;<br /> FT_Stream stream;<br /> FT_Module driver;<br /> FT_Int num_params;<br /> FT_Parameter* params;</p> <p> } FT_Open_Args;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_New_Face */<br /> /* */<br /> /* <Description> */<br /> /* This function calls @FT_Open_Face to open a font by its pathname. */<br /> /* */<br /> /* <InOut> */<br /> /* library :: A handle to the library resource. */<br /> /* */<br /> /* <Input> */<br /> /* pathname :: A path to the font file. */<br /> /* */<br /> /* face_index :: See @FT_Open_Face for a detailed description of this */<br /> /* parameter. */<br /> /* */<br /> /* <Output> */<br /> /* aface :: A handle to a new face object. If `face_index’ is */<br /> /* greater than or equal to zero, it must be non-NULL. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* Use @FT_Done_Face to destroy the created @FT_Face object (along */<br /> /* with its slot and sizes). */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_New_Face( FT_Library library,<br /> const char* filepathname,<br /> FT_Long face_index,<br /> FT_Face *aface );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_New_Memory_Face */<br /> /* */<br /> /* <Description> */<br /> /* This function calls @FT_Open_Face to open a font that has been */<br /> /* loaded into memory. */<br /> /* */<br /> /* <InOut> */<br /> /* library :: A handle to the library resource. */<br /> /* */<br /> /* <Input> */<br /> /* file_base :: A pointer to the beginning of the font data. */<br /> /* */<br /> /* file_size :: The size of the memory chunk used by the font data. */<br /> /* */<br /> /* face_index :: See @FT_Open_Face for a detailed description of this */<br /> /* parameter. */<br /> /* */<br /> /* <Output> */<br /> /* aface :: A handle to a new face object. If `face_index’ is */<br /> /* greater than or equal to zero, it must be non-NULL. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* You must not deallocate the memory before calling @FT_Done_Face. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_New_Memory_Face( FT_Library library,<br /> const FT_Byte* file_base,<br /> FT_Long file_size,<br /> FT_Long face_index,<br /> FT_Face *aface );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Open_Face */<br /> /* */<br /> /* <Description> */<br /> /* Create a face object from a given resource described by */<br /> /* @FT_Open_Args. */<br /> /* */<br /> /* <InOut> */<br /> /* library :: A handle to the library resource. */<br /> /* */<br /> /* <Input> */<br /> /* args :: A pointer to an `FT_Open_Args’ structure that must */<br /> /* be filled by the caller. */<br /> /* */<br /> /* face_index :: This field holds two different values. Bits 0-15 */<br /> /* are the index of the face in the font file (starting */<br /> /* with value~0). Set it to~0 if there is only one */<br /> /* face in the font file. */<br /> /* */<br /> /* Bits 16-30 are relevant to GX variation fonts only, */<br /> /* specifying the named instance index for the current */<br /> /* face index (starting with value~1; value~0 makes */<br /> /* FreeType ignore named instances). For non-GX fonts, */<br /> /* bits 16-30 are ignored. Assuming that you want to */<br /> /* access the third named instance in face~4, */<br /> /* `face_index’ should be set to 0x00030004. If you */<br /> /* want to access face~4 without GX variation handling, */<br /> /* simply set `face_index’ to value~4. */<br /> /* */<br /> /* FT_Open_Face and its siblings can be used to quickly */<br /> /* check whether the font format of a given font */<br /> /* resource is supported by FreeType. In general, if */<br /> /* the `face_index’ argument is negative, the */<br /> /* function’s return value is~0 if the font format is */<br /> /* recognized, or non-zero otherwise. The function */<br /> /* allocates a more or less empty face handle in */<br /> /* `*aface’ (if `aface’ isn’t NULL); the only two */<br /> /* useful fields in this special case are */<br /> /* `face->num_faces’ and `face->style_flags’. For any */<br /> /* negative value of `face_index’, `face->num_faces’ */<br /> /* gives the number of faces within the font file. For */<br /> /* the negative value `-(N+1)’ (with `N’ a 16-bit */<br /> /* value), bits 16-30 in `face->style_flags’ give the */<br /> /* number of named instances in face `N’ if we have a */<br /> /* GX variation font (or zero otherwise). After */<br /> /* examination, the returned @FT_Face structure should */<br /> /* be deallocated with a call to @FT_Done_Face. */<br /> /* */<br /> /* <Output> */<br /> /* aface :: A handle to a new face object. If `face_index’ is */<br /> /* greater than or equal to zero, it must be non-NULL. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* Unlike FreeType 1.x, this function automatically creates a glyph */<br /> /* slot for the face object that can be accessed directly through */<br /> /* `face->glyph’. */<br /> /* */<br /> /* Each new face object created with this function also owns a */<br /> /* default @FT_Size object, accessible as `face->size’. */<br /> /* */<br /> /* One @FT_Library instance can have multiple face objects, this is, */<br /> /* @FT_Open_Face and its siblings can be called multiple times using */<br /> /* the same `library’ argument. */<br /> /* */<br /> /* See the discussion of reference counters in the description of */<br /> /* @FT_Reference_Face. */<br /> /* */<br /> /* To loop over all faces, use code similar to the following snippet */<br /> /* (omitting the error handling). */<br /> /* */<br /> /* { */<br /> /* … */<br /> /* FT_Face face; */<br /> /* FT_Long i, num_faces; */<br /> /* */<br /> /* */<br /> /* error = FT_Open_Face( library, args, -1, &face ); */<br /> /* if ( error ) { … } */<br /> /* */<br /> /* num_faces = face->num_faces; */<br /> /* FT_Done_Face( face ); */<br /> /* */<br /> /* for ( i = 0; i < num_faces; i++ ) */ /* { */ /* ... */ /* error = FT_Open_Face( library, args, i, &face ); */ /* ... */ /* FT_Done_Face( face ); */ /* ... */ /* } */ /* } */ /* */ /* To loop over all valid values for `face_index', use something */ /* similar to the following snippet, again without error handling. */ /* The code accesses all faces immediately (thus only a single call */ /* of `FT_Open_Face' within the do-loop), with and without named */ /* instances. */ /* */ /* { */ /* ... */ /* FT_Face face; */ /* */ /* FT_Long num_faces = 0; */ /* FT_Long num_instances = 0; */ /* */ /* FT_Long face_idx = 0; */ /* FT_Long instance_idx = 0; */ /* */ /* */ /* do */ /* { */ /* FT_Long id = ( instance_idx << 16 ) + face_idx; */ /* */ /* */ /* error = FT_Open_Face( library, args, id, &face ); */ /* if ( error ) { ... } */ /* */ /* num_faces = face->num_faces; */<br /> /* num_instances = face->style_flags >> 16; */<br /> /* */<br /> /* … */<br /> /* */<br /> /* FT_Done_Face( face ); */<br /> /* */<br /> /* if ( instance_idx < num_instances ) */ /* instance_idx++; */ /* else */ /* { */ /* face_idx++; */ /* instance_idx = 0; */ /* } */ /* */ /* } while ( face_idx < num_faces ) */ /* } */ /* */ FT_EXPORT( FT_Error ) FT_Open_Face( FT_Library library, const FT_Open_Args* args, FT_Long face_index, FT_Face *aface ); /*************************************************************************/ /* */ /* <Function> */<br /> /* FT_Attach_File */<br /> /* */<br /> /* <Description> */<br /> /* This function calls @FT_Attach_Stream to attach a file. */<br /> /* */<br /> /* <InOut> */<br /> /* face :: The target face object. */<br /> /* */<br /> /* <Input> */<br /> /* filepathname :: The pathname. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Attach_File( FT_Face face,<br /> const char* filepathname );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Attach_Stream */<br /> /* */<br /> /* <Description> */<br /> /* `Attach’ data to a face object. Normally, this is used to read */<br /> /* additional information for the face object. For example, you can */<br /> /* attach an AFM file that comes with a Type~1 font to get the */<br /> /* kerning values and other metrics. */<br /> /* */<br /> /* <InOut> */<br /> /* face :: The target face object. */<br /> /* */<br /> /* <Input> */<br /> /* parameters :: A pointer to @FT_Open_Args that must be filled by */<br /> /* the caller. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* The meaning of the `attach’ (i.e., what really happens when the */<br /> /* new file is read) is not fixed by FreeType itself. It really */<br /> /* depends on the font format (and thus the font driver). */<br /> /* */<br /> /* Client applications are expected to know what they are doing */<br /> /* when invoking this function. Most drivers simply do not implement */<br /> /* file attachments. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Attach_Stream( FT_Face face,<br /> FT_Open_Args* parameters );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Reference_Face */<br /> /* */<br /> /* <Description> */<br /> /* A counter gets initialized to~1 at the time an @FT_Face structure */<br /> /* is created. This function increments the counter. @FT_Done_Face */<br /> /* then only destroys a face if the counter is~1, otherwise it simply */<br /> /* decrements the counter. */<br /> /* */<br /> /* This function helps in managing life-cycles of structures that */<br /> /* reference @FT_Face objects. */<br /> /* */<br /> /* <Input> */<br /> /* face :: A handle to a target face object. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Since> */<br /> /* 2.4.2 */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Reference_Face( FT_Face face );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Done_Face */<br /> /* */<br /> /* <Description> */<br /> /* Discard a given face object, as well as all of its child slots and */<br /> /* sizes. */<br /> /* */<br /> /* <Input> */<br /> /* face :: A handle to a target face object. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* See the discussion of reference counters in the description of */<br /> /* @FT_Reference_Face. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Done_Face( FT_Face face );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Select_Size */<br /> /* */<br /> /* <Description> */<br /> /* Select a bitmap strike. */<br /> /* */<br /> /* <InOut> */<br /> /* face :: A handle to a target face object. */<br /> /* */<br /> /* <Input> */<br /> /* strike_index :: The index of the bitmap strike in the */<br /> /* `available_sizes’ field of @FT_FaceRec structure. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Select_Size( FT_Face face,<br /> FT_Int strike_index );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Enum> */<br /> /* FT_Size_Request_Type */<br /> /* */<br /> /* <Description> */<br /> /* An enumeration type that lists the supported size request types. */<br /> /* */<br /> /* <Values> */<br /> /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */<br /> /* The nominal size. The `units_per_EM’ field of @FT_FaceRec is */<br /> /* used to determine both scaling values. */<br /> /* */<br /> /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */<br /> /* The real dimension. The sum of the the `ascender’ and (minus */<br /> /* of) the `descender’ fields of @FT_FaceRec are used to determine */<br /> /* both scaling values. */<br /> /* */<br /> /* FT_SIZE_REQUEST_TYPE_BBOX :: */<br /> /* The font bounding box. The width and height of the `bbox’ field */<br /> /* of @FT_FaceRec are used to determine the horizontal and vertical */<br /> /* scaling value, respectively. */<br /> /* */<br /> /* FT_SIZE_REQUEST_TYPE_CELL :: */<br /> /* The `max_advance_width’ field of @FT_FaceRec is used to */<br /> /* determine the horizontal scaling value; the vertical scaling */<br /> /* value is determined the same way as */<br /> /* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */<br /> /* values are set to the smaller one. This type is useful if you */<br /> /* want to specify the font size for, say, a window of a given */<br /> /* dimension and 80×24 cells. */<br /> /* */<br /> /* FT_SIZE_REQUEST_TYPE_SCALES :: */<br /> /* Specify the scaling values directly. */<br /> /* */<br /> /* <Note> */<br /> /* The above descriptions only apply to scalable formats. For bitmap */<br /> /* formats, the behaviour is up to the driver. */<br /> /* */<br /> /* See the note section of @FT_Size_Metrics if you wonder how size */<br /> /* requesting relates to scaling values. */<br /> /* */<br /> typedef enum FT_Size_Request_Type_<br /> {<br /> FT_SIZE_REQUEST_TYPE_NOMINAL,<br /> FT_SIZE_REQUEST_TYPE_REAL_DIM,<br /> FT_SIZE_REQUEST_TYPE_BBOX,<br /> FT_SIZE_REQUEST_TYPE_CELL,<br /> FT_SIZE_REQUEST_TYPE_SCALES,</p> <p> FT_SIZE_REQUEST_TYPE_MAX</p> <p> } FT_Size_Request_Type;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Struct> */<br /> /* FT_Size_RequestRec */<br /> /* */<br /> /* <Description> */<br /> /* A structure used to model a size request. */<br /> /* */<br /> /* <Fields> */<br /> /* type :: See @FT_Size_Request_Type. */<br /> /* */<br /> /* width :: The desired width. */<br /> /* */<br /> /* height :: The desired height. */<br /> /* */<br /> /* horiResolution :: The horizontal resolution. If set to zero, */<br /> /* `width’ is treated as a 26.6 fractional pixel */<br /> /* value. */<br /> /* */<br /> /* vertResolution :: The vertical resolution. If set to zero, */<br /> /* `height’ is treated as a 26.6 fractional pixel */<br /> /* value. */<br /> /* */<br /> /* <Note> */<br /> /* If `width’ is zero, then the horizontal scaling value is set equal */<br /> /* to the vertical scaling value, and vice versa. */<br /> /* */<br /> typedef struct FT_Size_RequestRec_<br /> {<br /> FT_Size_Request_Type type;<br /> FT_Long width;<br /> FT_Long height;<br /> FT_UInt horiResolution;<br /> FT_UInt vertResolution;</p> <p> } FT_Size_RequestRec;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Struct> */<br /> /* FT_Size_Request */<br /> /* */<br /> /* <Description> */<br /> /* A handle to a size request structure. */<br /> /* */<br /> typedef struct FT_Size_RequestRec_ *FT_Size_Request;</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Request_Size */<br /> /* */<br /> /* <Description> */<br /> /* Resize the scale of the active @FT_Size object in a face. */<br /> /* */<br /> /* <InOut> */<br /> /* face :: A handle to a target face object. */<br /> /* */<br /> /* <Input> */<br /> /* req :: A pointer to a @FT_Size_RequestRec. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* Although drivers may select the bitmap strike matching the */<br /> /* request, you should not rely on this if you intend to select a */<br /> /* particular bitmap strike. Use @FT_Select_Size instead in that */<br /> /* case. */<br /> /* */<br /> /* The relation between the requested size and the resulting glyph */<br /> /* size is dependent entirely on how the size is defined in the */<br /> /* source face. The font designer chooses the final size of each */<br /> /* glyph relative to this size. For more information refer to */<br /> /* `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html’ */<br /> /* */<br /> /* Don’t use this function if you are using the FreeType cache API. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Request_Size( FT_Face face,<br /> FT_Size_Request req );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Set_Char_Size */<br /> /* */<br /> /* <Description> */<br /> /* This function calls @FT_Request_Size to request the nominal size */<br /> /* (in points). */<br /> /* */<br /> /* <InOut> */<br /> /* face :: A handle to a target face object. */<br /> /* */<br /> /* <Input> */<br /> /* char_width :: The nominal width, in 26.6 fractional points. */<br /> /* */<br /> /* char_height :: The nominal height, in 26.6 fractional points. */<br /> /* */<br /> /* horz_resolution :: The horizontal resolution in dpi. */<br /> /* */<br /> /* vert_resolution :: The vertical resolution in dpi. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* If either the character width or height is zero, it is set equal */<br /> /* to the other value. */<br /> /* */<br /> /* If either the horizontal or vertical resolution is zero, it is set */<br /> /* equal to the other value. */<br /> /* */<br /> /* A character width or height smaller than 1pt is set to 1pt; if */<br /> /* both resolution values are zero, they are set to 72dpi. */<br /> /* */<br /> /* Don’t use this function if you are using the FreeType cache API. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Set_Char_Size( FT_Face face,<br /> FT_F26Dot6 char_width,<br /> FT_F26Dot6 char_height,<br /> FT_UInt horz_resolution,<br /> FT_UInt vert_resolution );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Set_Pixel_Sizes */<br /> /* */<br /> /* <Description> */<br /> /* This function calls @FT_Request_Size to request the nominal size */<br /> /* (in pixels). */<br /> /* */<br /> /* <InOut> */<br /> /* face :: A handle to the target face object. */<br /> /* */<br /> /* <Input> */<br /> /* pixel_width :: The nominal width, in pixels. */<br /> /* */<br /> /* pixel_height :: The nominal height, in pixels. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* You should not rely on the resulting glyphs matching, or being */<br /> /* constrained, to this pixel size. Refer to @FT_Request_Size to */<br /> /* understand how requested sizes relate to actual sizes. */<br /> /* */<br /> /* Don’t use this function if you are using the FreeType cache API. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Set_Pixel_Sizes( FT_Face face,<br /> FT_UInt pixel_width,<br /> FT_UInt pixel_height );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Load_Glyph */<br /> /* */<br /> /* <Description> */<br /> /* A function used to load a single glyph into the glyph slot of a */<br /> /* face object. */<br /> /* */<br /> /* <InOut> */<br /> /* face :: A handle to the target face object where the glyph */<br /> /* is loaded. */<br /> /* */<br /> /* <Input> */<br /> /* glyph_index :: The index of the glyph in the font file. For */<br /> /* CID-keyed fonts (either in PS or in CFF format) */<br /> /* this argument specifies the CID value. */<br /> /* */<br /> /* load_flags :: A flag indicating what to load for this glyph. The */<br /> /* @FT_LOAD_XXX constants can be used to control the */<br /> /* glyph loading process (e.g., whether the outline */<br /> /* should be scaled, whether to load bitmaps or not, */<br /> /* whether to hint the outline, etc). */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* The loaded glyph may be transformed. See @FT_Set_Transform for */<br /> /* the details. */<br /> /* */<br /> /* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument’ is */<br /> /* returned for invalid CID values (this is, for CID values that */<br /> /* don’t have a corresponding glyph in the font). See the discussion */<br /> /* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Load_Glyph( FT_Face face,<br /> FT_UInt glyph_index,<br /> FT_Int32 load_flags );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Load_Char */<br /> /* */<br /> /* <Description> */<br /> /* A function used to load a single glyph into the glyph slot of a */<br /> /* face object, according to its character code. */<br /> /* */<br /> /* <InOut> */<br /> /* face :: A handle to a target face object where the glyph */<br /> /* is loaded. */<br /> /* */<br /> /* <Input> */<br /> /* char_code :: The glyph’s character code, according to the */<br /> /* current charmap used in the face. */<br /> /* */<br /> /* load_flags :: A flag indicating what to load for this glyph. The */<br /> /* @FT_LOAD_XXX constants can be used to control the */<br /> /* glyph loading process (e.g., whether the outline */<br /> /* should be scaled, whether to load bitmaps or not, */<br /> /* whether to hint the outline, etc). */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Load_Char( FT_Face face,<br /> FT_ULong char_code,<br /> FT_Int32 load_flags );</p> <p> /*************************************************************************<br /> *<br /> * @enum:<br /> * FT_LOAD_XXX<br /> *<br /> * @description:<br /> * A list of bit field constants used with @FT_Load_Glyph to indicate<br /> * what kind of operations to perform during glyph loading.<br /> *<br /> * @values:<br /> * FT_LOAD_DEFAULT ::<br /> * Corresponding to~0, this value is used as the default glyph load<br /> * operation. In this case, the following happens:<br /> *<br /> * 1. FreeType looks for a bitmap for the glyph corresponding to the<br /> * face’s current size. If one is found, the function returns.<br /> * The bitmap data can be accessed from the glyph slot (see note<br /> * below).<br /> *<br /> * 2. If no embedded bitmap is searched or found, FreeType looks for a<br /> * scalable outline. If one is found, it is loaded from the font<br /> * file, scaled to device pixels, then `hinted’ to the pixel grid<br /> * in order to optimize it. The outline data can be accessed from<br /> * the glyph slot (see note below).<br /> *<br /> * Note that by default, the glyph loader doesn’t render outlines into<br /> * bitmaps. The following flags are used to modify this default<br /> * behaviour to more specific and useful cases.<br /> *<br /> * FT_LOAD_NO_SCALE ::<br /> * Don’t scale the loaded outline glyph but keep it in font units.<br /> *<br /> * This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and<br /> * unsets @FT_LOAD_RENDER.<br /> *<br /> * If the font is `tricky’ (see @FT_FACE_FLAG_TRICKY for more), using<br /> * FT_LOAD_NO_SCALE usually yields meaningless outlines because the<br /> * subglyphs must be scaled and positioned with hinting instructions.<br /> * This can be solved by loading the font without FT_LOAD_NO_SCALE and<br /> * setting the character size to `font->units_per_EM’.<br /> *<br /> * FT_LOAD_NO_HINTING ::<br /> * Disable hinting. This generally generates `blurrier’ bitmap glyphs<br /> * when the glyph are rendered in any of the anti-aliased modes. See<br /> * also the note below.<br /> *<br /> * This flag is implied by @FT_LOAD_NO_SCALE.<br /> *<br /> * FT_LOAD_RENDER ::<br /> * Call @FT_Render_Glyph after the glyph is loaded. By default, the<br /> * glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be<br /> * overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.<br /> *<br /> * This flag is unset by @FT_LOAD_NO_SCALE.<br /> *<br /> * FT_LOAD_NO_BITMAP ::<br /> * Ignore bitmap strikes when loading. Bitmap-only fonts ignore this<br /> * flag.<br /> *<br /> * @FT_LOAD_NO_SCALE always sets this flag.<br /> *<br /> * FT_LOAD_VERTICAL_LAYOUT ::<br /> * Load the glyph for vertical text layout. In particular, the<br /> * `advance’ value in the @FT_GlyphSlotRec structure is set to the<br /> * `vertAdvance’ value of the `metrics’ field.<br /> *<br /> * In case @FT_HAS_VERTICAL doesn’t return true, you shouldn’t use<br /> * this flag currently. Reason is that in this case vertical metrics<br /> * get synthesized, and those values are not always consistent across<br /> * various font formats.<br /> *<br /> * FT_LOAD_FORCE_AUTOHINT ::<br /> * Indicates that the auto-hinter is preferred over the font’s native<br /> * hinter. See also the note below.<br /> *<br /> * FT_LOAD_PEDANTIC ::<br /> * Indicates that the font driver should perform pedantic verifications<br /> * during glyph loading. This is mostly used to detect broken glyphs<br /> * in fonts. By default, FreeType tries to handle broken fonts also.<br /> *<br /> * In particular, errors from the TrueType bytecode engine are not<br /> * passed to the application if this flag is not set; this might<br /> * result in partially hinted or distorted glyphs in case a glyph’s<br /> * bytecode is buggy.<br /> *<br /> * FT_LOAD_NO_RECURSE ::<br /> * Indicate that the font driver should not load composite glyphs<br /> * recursively. Instead, it should set the `num_subglyph’ and<br /> * `subglyphs’ values of the glyph slot accordingly, and set<br /> * `glyph->format’ to @FT_GLYPH_FORMAT_COMPOSITE. The description of<br /> * subglyphs can then be accessed with @FT_Get_SubGlyph_Info.<br /> *<br /> * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.<br /> *<br /> * FT_LOAD_IGNORE_TRANSFORM ::<br /> * Indicates that the transform matrix set by @FT_Set_Transform should<br /> * be ignored.<br /> *<br /> * FT_LOAD_MONOCHROME ::<br /> * This flag is used with @FT_LOAD_RENDER to indicate that you want to<br /> * render an outline glyph to a 1-bit monochrome bitmap glyph, with<br /> * 8~pixels packed into each byte of the bitmap data.<br /> *<br /> * Note that this has no effect on the hinting algorithm used. You<br /> * should rather use @FT_LOAD_TARGET_MONO so that the<br /> * monochrome-optimized hinting algorithm is used.<br /> *<br /> * FT_LOAD_LINEAR_DESIGN ::<br /> * Indicates that the `linearHoriAdvance’ and `linearVertAdvance’<br /> * fields of @FT_GlyphSlotRec should be kept in font units. See<br /> * @FT_GlyphSlotRec for details.<br /> *<br /> * FT_LOAD_NO_AUTOHINT ::<br /> * Disable auto-hinter. See also the note below.<br /> *<br /> * FT_LOAD_COLOR ::<br /> * This flag is used to request loading of color embedded-bitmap<br /> * images. The resulting color bitmaps, if available, will have the<br /> * @FT_PIXEL_MODE_BGRA format. When the flag is not used and color<br /> * bitmaps are found, they will be converted to 256-level gray<br /> * bitmaps transparently. Those bitmaps will be in the<br /> * @FT_PIXEL_MODE_GRAY format.<br /> *<br /> * FT_LOAD_COMPUTE_METRICS ::<br /> * This flag sets computing glyph metrics without the use of bundled<br /> * metrics tables (for example, the `hdmx’ table in TrueType fonts).<br /> * Well-behaving fonts have optimized bundled metrics and these should<br /> * be used. This flag is mainly used by font validating or font<br /> * editing applications, which need to ignore, verify, or edit those<br /> * tables.<br /> *<br /> * Currently, this flag is only implemented for TrueType fonts.<br /> *<br /> * FT_LOAD_CROP_BITMAP ::<br /> * Ignored. Deprecated.<br /> *<br /> * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::<br /> * Ignored. Deprecated.<br /> *<br /> * @note:<br /> * By default, hinting is enabled and the font’s native hinter (see<br /> * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can<br /> * disable hinting by setting @FT_LOAD_NO_HINTING or change the<br /> * precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set<br /> * @FT_LOAD_NO_AUTOHINT in case you don’t want the auto-hinter to be<br /> * used at all.<br /> *<br /> * See the description of @FT_FACE_FLAG_TRICKY for a special exception<br /> * (affecting only a handful of Asian fonts).<br /> *<br /> * Besides deciding which hinter to use, you can also decide which<br /> * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details.<br /> *<br /> * Note that the auto-hinter needs a valid Unicode cmap (either a native<br /> * one or synthesized by FreeType) for producing correct results. If a<br /> * font provides an incorrect mapping (for example, assigning the<br /> * character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a<br /> * mathematical integral sign), the auto-hinter might produce useless<br /> * results.<br /> *<br /> */<br /> #define FT_LOAD_DEFAULT 0x0<br /> #define FT_LOAD_NO_SCALE ( 1L << 0 ) #define FT_LOAD_NO_HINTING ( 1L << 1 ) #define FT_LOAD_RENDER ( 1L << 2 ) #define FT_LOAD_NO_BITMAP ( 1L << 3 ) #define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 ) #define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 ) #define FT_LOAD_CROP_BITMAP ( 1L << 6 ) #define FT_LOAD_PEDANTIC ( 1L << 7 ) #define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 ) #define FT_LOAD_NO_RECURSE ( 1L << 10 ) #define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 ) #define FT_LOAD_MONOCHROME ( 1L << 12 ) #define FT_LOAD_LINEAR_DESIGN ( 1L << 13 ) #define FT_LOAD_NO_AUTOHINT ( 1L << 15 ) /* Bits 16..19 are used by `FT_LOAD_TARGET_' */ #define FT_LOAD_COLOR ( 1L << 20 ) #define FT_LOAD_COMPUTE_METRICS ( 1L << 21 ) /* */ /* used internally only by certain font drivers! */ #define FT_LOAD_ADVANCE_ONLY ( 1L << 8 ) #define FT_LOAD_SBITS_ONLY ( 1L << 14 ) /************************************************************************** * * @enum: * FT_LOAD_TARGET_XXX * * @description: * A list of values that are used to select a specific hinting algorithm * to use by the hinter. You should OR one of these values to your * `load_flags' when calling @FT_Load_Glyph. * * Note that font's native hinters may ignore the hinting algorithm you * have specified (e.g., the TrueType bytecode interpreter). You can set * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used. * * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it * always implies @FT_LOAD_FORCE_AUTOHINT. * * @values: * FT_LOAD_TARGET_NORMAL :: * This corresponds to the default hinting algorithm, optimized for * standard gray-level rendering. For monochrome output, use * @FT_LOAD_TARGET_MONO instead. * * FT_LOAD_TARGET_LIGHT :: * A lighter hinting algorithm for non-monochrome modes. Many * generated glyphs are more fuzzy but better resemble its original * shape. A bit like rendering on Mac OS~X. * * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT. * * FT_LOAD_TARGET_MONO :: * Strong hinting algorithm that should only be used for monochrome * output. The result is probably unpleasant if the glyph is rendered * in non-monochrome modes. * * FT_LOAD_TARGET_LCD :: * A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally * decimated LCD displays. * * FT_LOAD_TARGET_LCD_V :: * A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically * decimated LCD displays. * * @note: * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your * `load_flags'. They can't be ORed. * * If @FT_LOAD_RENDER is also set, the glyph is rendered in the * corresponding mode (i.e., the mode that matches the used algorithm * best). An exeption is FT_LOAD_TARGET_MONO since it implies * @FT_LOAD_MONOCHROME. * * You can use a hinting algorithm that doesn't correspond to the same * rendering mode. As an example, it is possible to use the `light' * hinting algorithm and have the results rendered in horizontal LCD * pixel mode, with code like * * { * FT_Load_Glyph( face, glyph_index, * load_flags | FT_LOAD_TARGET_LIGHT ); * * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );<br /> * }<br /> *<br /> */<br /> #define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 ) #define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) #define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) #define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ) #define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD ) #define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V ) /************************************************************************** * * @macro: * FT_LOAD_TARGET_MODE * * @description: * Return the @FT_Render_Mode corresponding to a given * @FT_LOAD_TARGET_XXX value. * */ #define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Set_Transform */<br /> /* */<br /> /* <Description> */<br /> /* A function used to set the transformation that is applied to glyph */<br /> /* images when they are loaded into a glyph slot through */<br /> /* @FT_Load_Glyph. */<br /> /* */<br /> /* <InOut> */<br /> /* face :: A handle to the source face object. */<br /> /* */<br /> /* <Input> */<br /> /* matrix :: A pointer to the transformation’s 2×2 matrix. Use~0 for */<br /> /* the identity matrix. */<br /> /* delta :: A pointer to the translation vector. Use~0 for the null */<br /> /* vector. */<br /> /* */<br /> /* <Note> */<br /> /* The transformation is only applied to scalable image formats after */<br /> /* the glyph has been loaded. It means that hinting is unaltered by */<br /> /* the transformation and is performed on the character size given in */<br /> /* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */<br /> /* */<br /> /* Note that this also transforms the `face.glyph.advance’ field, but */<br /> /* *not* the values in `face.glyph.metrics’. */<br /> /* */<br /> FT_EXPORT( void )<br /> FT_Set_Transform( FT_Face face,<br /> FT_Matrix* matrix,<br /> FT_Vector* delta );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Enum> */<br /> /* FT_Render_Mode */<br /> /* */<br /> /* <Description> */<br /> /* An enumeration type that lists the render modes supported by */<br /> /* FreeType~2. Each mode corresponds to a specific type of scanline */<br /> /* conversion performed on the outline. */<br /> /* */<br /> /* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode’ */<br /> /* field in the @FT_GlyphSlotRec structure gives the format of the */<br /> /* returned bitmap. */<br /> /* */<br /> /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */<br /> /* */<br /> /* <Values> */<br /> /* FT_RENDER_MODE_NORMAL :: */<br /> /* This is the default render mode; it corresponds to 8-bit */<br /> /* anti-aliased bitmaps. */<br /> /* */<br /> /* FT_RENDER_MODE_LIGHT :: */<br /> /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */<br /> /* defined as a separate value because render modes are also used */<br /> /* indirectly to define hinting algorithm selectors. See */<br /> /* @FT_LOAD_TARGET_XXX for details. */<br /> /* */<br /> /* FT_RENDER_MODE_MONO :: */<br /> /* This mode corresponds to 1-bit bitmaps (with 2~levels of */<br /> /* opacity). */<br /> /* */<br /> /* FT_RENDER_MODE_LCD :: */<br /> /* This mode corresponds to horizontal RGB and BGR sub-pixel */<br /> /* displays like LCD screens. It produces 8-bit bitmaps that are */<br /> /* 3~times the width of the original glyph outline in pixels, and */<br /> /* which use the @FT_PIXEL_MODE_LCD mode. */<br /> /* */<br /> /* FT_RENDER_MODE_LCD_V :: */<br /> /* This mode corresponds to vertical RGB and BGR sub-pixel displays */<br /> /* (like PDA screens, rotated LCD displays, etc.). It produces */<br /> /* 8-bit bitmaps that are 3~times the height of the original */<br /> /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */<br /> /* */<br /> /* <Note> */<br /> /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */<br /> /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */<br /> /* (not active in the default builds). It is up to the caller to */<br /> /* either call @FT_Library_SetLcdFilter (if available) or do the */<br /> /* filtering itself. */<br /> /* */<br /> /* The selected render mode only affects vector glyphs of a font. */<br /> /* Embedded bitmaps often have a different pixel mode like */<br /> /* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */<br /> /* them into 8-bit pixmaps. */<br /> /* */<br /> typedef enum FT_Render_Mode_<br /> {<br /> FT_RENDER_MODE_NORMAL = 0,<br /> FT_RENDER_MODE_LIGHT,<br /> FT_RENDER_MODE_MONO,<br /> FT_RENDER_MODE_LCD,<br /> FT_RENDER_MODE_LCD_V,</p> <p> FT_RENDER_MODE_MAX</p> <p> } FT_Render_Mode;</p> <p> /* these constants are deprecated; use the corresponding */<br /> /* `FT_Render_Mode’ values instead */<br /> #define ft_render_mode_normal FT_RENDER_MODE_NORMAL<br /> #define ft_render_mode_mono FT_RENDER_MODE_MONO</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Render_Glyph */<br /> /* */<br /> /* <Description> */<br /> /* Convert a given glyph image to a bitmap. It does so by inspecting */<br /> /* the glyph image format, finding the relevant renderer, and */<br /> /* invoking it. */<br /> /* */<br /> /* <InOut> */<br /> /* slot :: A handle to the glyph slot containing the image to */<br /> /* convert. */<br /> /* */<br /> /* <Input> */<br /> /* render_mode :: This is the render mode used to render the glyph */<br /> /* image into a bitmap. See @FT_Render_Mode for a */<br /> /* list of possible values. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* To get meaningful results, font scaling values must be set with */<br /> /* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Render_Glyph( FT_GlyphSlot slot,<br /> FT_Render_Mode render_mode );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Enum> */<br /> /* FT_Kerning_Mode */<br /> /* */<br /> /* <Description> */<br /> /* An enumeration used to specify which kerning values to return in */<br /> /* @FT_Get_Kerning. */<br /> /* */<br /> /* <Values> */<br /> /* FT_KERNING_DEFAULT :: Return grid-fitted kerning distances in */<br /> /* pixels (value is~0). Whether they are */<br /> /* scaled depends on @FT_LOAD_NO_SCALE. */<br /> /* */<br /> /* FT_KERNING_UNFITTED :: Return un-grid-fitted kerning distances in */<br /> /* 26.6 fractional pixels. Whether they are */<br /> /* scaled depends on @FT_LOAD_NO_SCALE. */<br /> /* */<br /> /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */<br /> /* units. */<br /> /* */<br /> /* <Note> */<br /> /* FT_KERNING_DEFAULT returns full pixel values; it also makes */<br /> /* FreeType heuristically scale down kerning distances at small ppem */<br /> /* values so that they don’t become too big. */<br /> /* */<br /> typedef enum FT_Kerning_Mode_<br /> {<br /> FT_KERNING_DEFAULT = 0,<br /> FT_KERNING_UNFITTED,<br /> FT_KERNING_UNSCALED</p> <p> } FT_Kerning_Mode;</p> <p> /* these constants are deprecated; use the corresponding */<br /> /* `FT_Kerning_Mode’ values instead */<br /> #define ft_kerning_default FT_KERNING_DEFAULT<br /> #define ft_kerning_unfitted FT_KERNING_UNFITTED<br /> #define ft_kerning_unscaled FT_KERNING_UNSCALED</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Get_Kerning */<br /> /* */<br /> /* <Description> */<br /> /* Return the kerning vector between two glyphs of a same face. */<br /> /* */<br /> /* <Input> */<br /> /* face :: A handle to a source face object. */<br /> /* */<br /> /* left_glyph :: The index of the left glyph in the kern pair. */<br /> /* */<br /> /* right_glyph :: The index of the right glyph in the kern pair. */<br /> /* */<br /> /* kern_mode :: See @FT_Kerning_Mode for more information. */<br /> /* Determines the scale and dimension of the returned */<br /> /* kerning vector. */<br /> /* */<br /> /* <Output> */<br /> /* akerning :: The kerning vector. This is either in font units, */<br /> /* fractional pixels (26.6 format), or pixels for */<br /> /* scalable formats, and in pixels for fixed-sizes */<br /> /* formats. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* Only horizontal layouts (left-to-right & right-to-left) are */<br /> /* supported by this method. Other layouts, or more sophisticated */<br /> /* kernings, are out of the scope of this API function — they can be */<br /> /* implemented through format-specific interfaces. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Get_Kerning( FT_Face face,<br /> FT_UInt left_glyph,<br /> FT_UInt right_glyph,<br /> FT_UInt kern_mode,<br /> FT_Vector *akerning );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Get_Track_Kerning */<br /> /* */<br /> /* <Description> */<br /> /* Return the track kerning for a given face object at a given size. */<br /> /* */<br /> /* <Input> */<br /> /* face :: A handle to a source face object. */<br /> /* */<br /> /* point_size :: The point size in 16.16 fractional points. */<br /> /* */<br /> /* degree :: The degree of tightness. Increasingly negative */<br /> /* values represent tighter track kerning, while */<br /> /* increasingly positive values represent looser track */<br /> /* kerning. Value zero means no track kerning. */<br /> /* */<br /> /* <Output> */<br /> /* akerning :: The kerning in 16.16 fractional points, to be */<br /> /* uniformly applied between all glyphs. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* Currently, only the Type~1 font driver supports track kerning, */<br /> /* using data from AFM files (if attached with @FT_Attach_File or */<br /> /* @FT_Attach_Stream). */<br /> /* */<br /> /* Only very few AFM files come with track kerning data; please refer */<br /> /* to the Adobe’s AFM specification for more details. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Get_Track_Kerning( FT_Face face,<br /> FT_Fixed point_size,<br /> FT_Int degree,<br /> FT_Fixed* akerning );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Get_Glyph_Name */<br /> /* */<br /> /* <Description> */<br /> /* Retrieve the ASCII name of a given glyph in a face. This only */<br /> /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */<br /> /* */<br /> /* <Input> */<br /> /* face :: A handle to a source face object. */<br /> /* */<br /> /* glyph_index :: The glyph index. */<br /> /* */<br /> /* buffer_max :: The maximum number of bytes available in the */<br /> /* buffer. */<br /> /* */<br /> /* <Output> */<br /> /* buffer :: A pointer to a target buffer where the name is */<br /> /* copied to. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* An error is returned if the face doesn’t provide glyph names or if */<br /> /* the glyph index is invalid. In all cases of failure, the first */<br /> /* byte of `buffer’ is set to~0 to indicate an empty name. */<br /> /* */<br /> /* The glyph name is truncated to fit within the buffer if it is too */<br /> /* long. The returned string is always zero-terminated. */<br /> /* */<br /> /* Be aware that FreeType reorders glyph indices internally so that */<br /> /* glyph index~0 always corresponds to the `missing glyph’ (called */<br /> /* `.notdef’). */<br /> /* */<br /> /* This function always returns an error if the config macro */<br /> /* `FT_CONFIG_OPTION_NO_GLYPH_NAMES’ is not defined in `ftoptions.h’. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Get_Glyph_Name( FT_Face face,<br /> FT_UInt glyph_index,<br /> FT_Pointer buffer,<br /> FT_UInt buffer_max );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Get_Postscript_Name */<br /> /* */<br /> /* <Description> */<br /> /* Retrieve the ASCII PostScript name of a given face, if available. */<br /> /* This only works with PostScript and TrueType fonts. */<br /> /* */<br /> /* <Input> */<br /> /* face :: A handle to the source face object. */<br /> /* */<br /> /* <Return> */<br /> /* A pointer to the face’s PostScript name. NULL if unavailable. */<br /> /* */<br /> /* <Note> */<br /> /* The returned pointer is owned by the face and is destroyed with */<br /> /* it. */<br /> /* */<br /> FT_EXPORT( const char* )<br /> FT_Get_Postscript_Name( FT_Face face );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Select_Charmap */<br /> /* */<br /> /* <Description> */<br /> /* Select a given charmap by its encoding tag (as listed in */<br /> /* `freetype.h’). */<br /> /* */<br /> /* <InOut> */<br /> /* face :: A handle to the source face object. */<br /> /* */<br /> /* <Input> */<br /> /* encoding :: A handle to the selected encoding. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* This function returns an error if no charmap in the face */<br /> /* corresponds to the encoding queried here. */<br /> /* */<br /> /* Because many fonts contain more than a single cmap for Unicode */<br /> /* encoding, this function has some special code to select the one */<br /> /* that covers Unicode best (`best’ in the sense that a UCS-4 cmap is */<br /> /* preferred to a UCS-2 cmap). It is thus preferable to */<br /> /* @FT_Set_Charmap in this case. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Select_Charmap( FT_Face face,<br /> FT_Encoding encoding );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Set_Charmap */<br /> /* */<br /> /* <Description> */<br /> /* Select a given charmap for character code to glyph index mapping. */<br /> /* */<br /> /* <InOut> */<br /> /* face :: A handle to the source face object. */<br /> /* */<br /> /* <Input> */<br /> /* charmap :: A handle to the selected charmap. */<br /> /* */<br /> /* <Return> */<br /> /* FreeType error code. 0~means success. */<br /> /* */<br /> /* <Note> */<br /> /* This function returns an error if the charmap is not part of */<br /> /* the face (i.e., if it is not listed in the `face->charmaps’ */<br /> /* table). */<br /> /* */<br /> /* It also fails if a type~14 charmap is selected. */<br /> /* */<br /> FT_EXPORT( FT_Error )<br /> FT_Set_Charmap( FT_Face face,<br /> FT_CharMap charmap );</p> <p> /*************************************************************************<br /> *<br /> * @function:<br /> * FT_Get_Charmap_Index<br /> *<br /> * @description:<br /> * Retrieve index of a given charmap.<br /> *<br /> * @input:<br /> * charmap ::<br /> * A handle to a charmap.<br /> *<br /> * @return:<br /> * The index into the array of character maps within the face to which<br /> * `charmap’ belongs. If an error occurs, -1 is returned.<br /> *<br /> */<br /> FT_EXPORT( FT_Int )<br /> FT_Get_Charmap_Index( FT_CharMap charmap );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Get_Char_Index */<br /> /* */<br /> /* <Description> */<br /> /* Return the glyph index of a given character code. This function */<br /> /* uses a charmap object to do the mapping. */<br /> /* */<br /> /* <Input> */<br /> /* face :: A handle to the source face object. */<br /> /* */<br /> /* charcode :: The character code. */<br /> /* */<br /> /* <Return> */<br /> /* The glyph index. 0~means `undefined character code’. */<br /> /* */<br /> /* <Note> */<br /> /* If you use FreeType to manipulate the contents of font files */<br /> /* directly, be aware that the glyph index returned by this function */<br /> /* doesn’t always correspond to the internal indices used within the */<br /> /* file. This is done to ensure that value~0 always corresponds to */<br /> /* the `missing glyph’. If the first glyph is not named `.notdef’, */<br /> /* then for Type~1 and Type~42 fonts, `.notdef’ will be moved into */<br /> /* the glyph ID~0 position, and whatever was there will be moved to */<br /> /* the position `.notdef’ had. For Type~1 fonts, if there is no */<br /> /* `.notdef’ glyph at all, then one will be created at index~0 and */<br /> /* whatever was there will be moved to the last index — Type~42 */<br /> /* fonts are considered invalid under this condition. */<br /> /* */<br /> FT_EXPORT( FT_UInt )<br /> FT_Get_Char_Index( FT_Face face,<br /> FT_ULong charcode );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Get_First_Char */<br /> /* */<br /> /* <Description> */<br /> /* This function is used to return the first character code in the */<br /> /* current charmap of a given face. It also returns the */<br /> /* corresponding glyph index. */<br /> /* */<br /> /* <Input> */<br /> /* face :: A handle to the source face object. */<br /> /* */<br /> /* <Output> */<br /> /* agindex :: Glyph index of first character code. 0~if charmap is */<br /> /* empty. */<br /> /* */<br /> /* <Return> */<br /> /* The charmap’s first character code. */<br /> /* */<br /> /* <Note> */<br /> /* You should use this function with @FT_Get_Next_Char to be able to */<br /> /* parse all character codes available in a given charmap. The code */<br /> /* should look like this: */<br /> /* */<br /> /* { */<br /> /* FT_ULong charcode; */<br /> /* FT_UInt gindex; */<br /> /* */<br /> /* */<br /> /* charcode = FT_Get_First_Char( face, &gindex ); */<br /> /* while ( gindex != 0 ) */<br /> /* { */<br /> /* … do something with (charcode,gindex) pair … */<br /> /* */<br /> /* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */<br /> /* } */<br /> /* } */<br /> /* */<br /> /* Be aware that character codes can have values up to 0xFFFFFFFF; */<br /> /* this might happen for non-Unicode or malformed cmaps. However, */<br /> /* even with regular Unicode encoding, so-called `last resort fonts’ */<br /> /* (using SFNT cmap format 13, see function @FT_Get_CMap_Format) */<br /> /* normally have entries for all Unicode characters up to 0x1FFFFF, */<br /> /* which can cause *a lot* of iterations. */<br /> /* */<br /> /* Note that `*agindex’ is set to~0 if the charmap is empty. The */<br /> /* result itself can be~0 in two cases: if the charmap is empty or */<br /> /* if the value~0 is the first valid character code. */<br /> /* */<br /> FT_EXPORT( FT_ULong )<br /> FT_Get_First_Char( FT_Face face,<br /> FT_UInt *agindex );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Get_Next_Char */<br /> /* */<br /> /* <Description> */<br /> /* This function is used to return the next character code in the */<br /> /* current charmap of a given face following the value `char_code’, */<br /> /* as well as the corresponding glyph index. */<br /> /* */<br /> /* <Input> */<br /> /* face :: A handle to the source face object. */<br /> /* char_code :: The starting character code. */<br /> /* */<br /> /* <Output> */<br /> /* agindex :: Glyph index of next character code. 0~if charmap */<br /> /* is empty. */<br /> /* */<br /> /* <Return> */<br /> /* The charmap’s next character code. */<br /> /* */<br /> /* <Note> */<br /> /* You should use this function with @FT_Get_First_Char to walk */<br /> /* over all character codes available in a given charmap. See the */<br /> /* note for this function for a simple code example. */<br /> /* */<br /> /* Note that `*agindex’ is set to~0 when there are no more codes in */<br /> /* the charmap. */<br /> /* */<br /> FT_EXPORT( FT_ULong )<br /> FT_Get_Next_Char( FT_Face face,<br /> FT_ULong char_code,<br /> FT_UInt *agindex );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Get_Name_Index */<br /> /* */<br /> /* <Description> */<br /> /* Return the glyph index of a given glyph name. This function uses */<br /> /* driver specific objects to do the translation. */<br /> /* */<br /> /* <Input> */<br /> /* face :: A handle to the source face object. */<br /> /* */<br /> /* glyph_name :: The glyph name. */<br /> /* */<br /> /* <Return> */<br /> /* The glyph index. 0~means `undefined character code’. */<br /> /* */<br /> FT_EXPORT( FT_UInt )<br /> FT_Get_Name_Index( FT_Face face,<br /> FT_String* glyph_name );</p> <p> /*************************************************************************<br /> *<br /> * @macro:<br /> * FT_SUBGLYPH_FLAG_XXX<br /> *<br /> * @description:<br /> * A list of constants used to describe subglyphs. Please refer to the<br /> * TrueType specification for the meaning of the various flags.<br /> *<br /> * @values:<br /> * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::<br /> * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::<br /> * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::<br /> * FT_SUBGLYPH_FLAG_SCALE ::<br /> * FT_SUBGLYPH_FLAG_XY_SCALE ::<br /> * FT_SUBGLYPH_FLAG_2X2 ::<br /> * FT_SUBGLYPH_FLAG_USE_MY_METRICS ::<br /> *<br /> */<br /> #define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1<br /> #define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2<br /> #define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4<br /> #define FT_SUBGLYPH_FLAG_SCALE 8<br /> #define FT_SUBGLYPH_FLAG_XY_SCALE 0x40<br /> #define FT_SUBGLYPH_FLAG_2X2 0x80<br /> #define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200</p> <p> /*************************************************************************<br /> *<br /> * @func:<br /> * FT_Get_SubGlyph_Info<br /> *<br /> * @description:<br /> * Retrieve a description of a given subglyph. Only use it if<br /> * `glyph->format’ is @FT_GLYPH_FORMAT_COMPOSITE; an error is<br /> * returned otherwise.<br /> *<br /> * @input:<br /> * glyph ::<br /> * The source glyph slot.<br /> *<br /> * sub_index ::<br /> * The index of the subglyph. Must be less than<br /> * `glyph->num_subglyphs’.<br /> *<br /> * @output:<br /> * p_index ::<br /> * The glyph index of the subglyph.<br /> *<br /> * p_flags ::<br /> * The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.<br /> *<br /> * p_arg1 ::<br /> * The subglyph’s first argument (if any).<br /> *<br /> * p_arg2 ::<br /> * The subglyph’s second argument (if any).<br /> *<br /> * p_transform ::<br /> * The subglyph transformation (if any).<br /> *<br /> * @return:<br /> * FreeType error code. 0~means success.<br /> *<br /> * @note:<br /> * The values of `*p_arg1′, `*p_arg2′, and `*p_transform’ must be<br /> * interpreted depending on the flags returned in `*p_flags’. See the<br /> * TrueType specification for details.<br /> *<br /> */<br /> FT_EXPORT( FT_Error )<br /> FT_Get_SubGlyph_Info( FT_GlyphSlot glyph,<br /> FT_UInt sub_index,<br /> FT_Int *p_index,<br /> FT_UInt *p_flags,<br /> FT_Int *p_arg1,<br /> FT_Int *p_arg2,<br /> FT_Matrix *p_transform );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Enum> */<br /> /* FT_FSTYPE_XXX */<br /> /* */<br /> /* <Description> */<br /> /* A list of bit flags used in the `fsType’ field of the OS/2 table */<br /> /* in a TrueType or OpenType font and the `FSType’ entry in a */<br /> /* PostScript font. These bit flags are returned by */<br /> /* @FT_Get_FSType_Flags; they inform client applications of embedding */<br /> /* and subsetting restrictions associated with a font. */<br /> /* */<br /> /* See */<br /> /* http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/FontPolicies.pdf */<br /> /* for more details. */<br /> /* */<br /> /* <Values> */<br /> /* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */<br /> /* Fonts with no fsType bit set may be embedded and permanently */<br /> /* installed on the remote system by an application. */<br /> /* */<br /> /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */<br /> /* Fonts that have only this bit set must not be modified, embedded */<br /> /* or exchanged in any manner without first obtaining permission of */<br /> /* the font software copyright owner. */<br /> /* */<br /> /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */<br /> /* If this bit is set, the font may be embedded and temporarily */<br /> /* loaded on the remote system. Documents containing Preview & */<br /> /* Print fonts must be opened `read-only’; no edits can be applied */<br /> /* to the document. */<br /> /* */<br /> /* FT_FSTYPE_EDITABLE_EMBEDDING :: */<br /> /* If this bit is set, the font may be embedded but must only be */<br /> /* installed temporarily on other systems. In contrast to Preview */<br /> /* & Print fonts, documents containing editable fonts may be opened */<br /> /* for reading, editing is permitted, and changes may be saved. */<br /> /* */<br /> /* FT_FSTYPE_NO_SUBSETTING :: */<br /> /* If this bit is set, the font may not be subsetted prior to */<br /> /* embedding. */<br /> /* */<br /> /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */<br /> /* If this bit is set, only bitmaps contained in the font may be */<br /> /* embedded; no outline data may be embedded. If there are no */<br /> /* bitmaps available in the font, then the font is unembeddable. */<br /> /* */<br /> /* <Note> */<br /> /* The flags are ORed together, thus more than a single value can be */<br /> /* returned. */<br /> /* */<br /> /* While the fsType flags can indicate that a font may be embedded, a */<br /> /* license with the font vendor may be separately required to use the */<br /> /* font in this way. */<br /> /* */<br /> #define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000<br /> #define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002<br /> #define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004<br /> #define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008<br /> #define FT_FSTYPE_NO_SUBSETTING 0x0100<br /> #define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Get_FSType_Flags */<br /> /* */<br /> /* <Description> */<br /> /* Return the fsType flags for a font. */<br /> /* */<br /> /* <Input> */<br /> /* face :: A handle to the source face object. */<br /> /* */<br /> /* <Return> */<br /> /* The fsType flags, @FT_FSTYPE_XXX. */<br /> /* */<br /> /* <Note> */<br /> /* Use this function rather than directly reading the `fs_type’ field */<br /> /* in the @PS_FontInfoRec structure, which is only guaranteed to */<br /> /* return the correct results for Type~1 fonts. */<br /> /* */<br /> /* <Since> */<br /> /* 2.3.8 */<br /> /* */<br /> FT_EXPORT( FT_UShort )<br /> FT_Get_FSType_Flags( FT_Face face );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Section> */<br /> /* glyph_variants */<br /> /* */<br /> /* <Title> */<br /> /* Glyph Variants */<br /> /* */<br /> /* <Abstract> */<br /> /* The FreeType~2 interface to Unicode Ideographic Variation */<br /> /* Sequences (IVS), using the SFNT cmap format~14. */<br /> /* */<br /> /* <Description> */<br /> /* Many CJK characters have variant forms. They are a sort of grey */<br /> /* area somewhere between being totally irrelevant and semantically */<br /> /* distinct; for this reason, the Unicode consortium decided to */<br /> /* introduce Ideographic Variation Sequences (IVS), consisting of a */<br /> /* Unicode base character and one of 240 variant selectors */<br /> /* (U+E0100-U+E01EF), instead of further extending the already huge */<br /> /* code range for CJK characters. */<br /> /* */<br /> /* An IVS is registered and unique; for further details please refer */<br /> /* to Unicode Technical Standard #37, the Ideographic Variation */<br /> /* Database: */<br /> /* */<br /> /* http://www.unicode.org/reports/tr37/ */<br /> /* */<br /> /* To date (November 2014), the character with the most variants is */<br /> /* U+9089, having 32 such IVS. */<br /> /* */<br /> /* Adobe and MS decided to support IVS with a new cmap subtable */<br /> /* (format~14). It is an odd subtable because it is not a mapping of */<br /> /* input code points to glyphs, but contains lists of all variants */<br /> /* supported by the font. */<br /> /* */<br /> /* A variant may be either `default’ or `non-default’. A default */<br /> /* variant is the one you will get for that code point if you look it */<br /> /* up in the standard Unicode cmap. A non-default variant is a */<br /> /* different glyph. */<br /> /* */<br /> /*************************************************************************/</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Face_GetCharVariantIndex */<br /> /* */<br /> /* <Description> */<br /> /* Return the glyph index of a given character code as modified by */<br /> /* the variation selector. */<br /> /* */<br /> /* <Input> */<br /> /* face :: */<br /> /* A handle to the source face object. */<br /> /* */<br /> /* charcode :: */<br /> /* The character code point in Unicode. */<br /> /* */<br /> /* variantSelector :: */<br /> /* The Unicode code point of the variation selector. */<br /> /* */<br /> /* <Return> */<br /> /* The glyph index. 0~means either `undefined character code’, or */<br /> /* `undefined selector code’, or `no variation selector cmap */<br /> /* subtable’, or `current CharMap is not Unicode’. */<br /> /* */<br /> /* <Note> */<br /> /* If you use FreeType to manipulate the contents of font files */<br /> /* directly, be aware that the glyph index returned by this function */<br /> /* doesn’t always correspond to the internal indices used within */<br /> /* the file. This is done to ensure that value~0 always corresponds */<br /> /* to the `missing glyph’. */<br /> /* */<br /> /* This function is only meaningful if */<br /> /* a) the font has a variation selector cmap sub table, */<br /> /* and */<br /> /* b) the current charmap has a Unicode encoding. */<br /> /* */<br /> /* <Since> */<br /> /* 2.3.6 */<br /> /* */<br /> FT_EXPORT( FT_UInt )<br /> FT_Face_GetCharVariantIndex( FT_Face face,<br /> FT_ULong charcode,<br /> FT_ULong variantSelector );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Face_GetCharVariantIsDefault */<br /> /* */<br /> /* <Description> */<br /> /* Check whether this variant of this Unicode character is the one to */<br /> /* be found in the `cmap’. */<br /> /* */<br /> /* <Input> */<br /> /* face :: */<br /> /* A handle to the source face object. */<br /> /* */<br /> /* charcode :: */<br /> /* The character codepoint in Unicode. */<br /> /* */<br /> /* variantSelector :: */<br /> /* The Unicode codepoint of the variation selector. */<br /> /* */<br /> /* <Return> */<br /> /* 1~if found in the standard (Unicode) cmap, 0~if found in the */<br /> /* variation selector cmap, or -1 if it is not a variant. */<br /> /* */<br /> /* <Note> */<br /> /* This function is only meaningful if the font has a variation */<br /> /* selector cmap subtable. */<br /> /* */<br /> /* <Since> */<br /> /* 2.3.6 */<br /> /* */<br /> FT_EXPORT( FT_Int )<br /> FT_Face_GetCharVariantIsDefault( FT_Face face,<br /> FT_ULong charcode,<br /> FT_ULong variantSelector );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Face_GetVariantSelectors */<br /> /* */<br /> /* <Description> */<br /> /* Return a zero-terminated list of Unicode variant selectors found */<br /> /* in the font. */<br /> /* */<br /> /* <Input> */<br /> /* face :: */<br /> /* A handle to the source face object. */<br /> /* */<br /> /* <Return> */<br /> /* A pointer to an array of selector code points, or NULL if there is */<br /> /* no valid variant selector cmap subtable. */<br /> /* */<br /> /* <Note> */<br /> /* The last item in the array is~0; the array is owned by the */<br /> /* @FT_Face object but can be overwritten or released on the next */<br /> /* call to a FreeType function. */<br /> /* */<br /> /* <Since> */<br /> /* 2.3.6 */<br /> /* */<br /> FT_EXPORT( FT_UInt32* )<br /> FT_Face_GetVariantSelectors( FT_Face face );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Face_GetVariantsOfChar */<br /> /* */<br /> /* <Description> */<br /> /* Return a zero-terminated list of Unicode variant selectors found */<br /> /* for the specified character code. */<br /> /* */<br /> /* <Input> */<br /> /* face :: */<br /> /* A handle to the source face object. */<br /> /* */<br /> /* charcode :: */<br /> /* The character codepoint in Unicode. */<br /> /* */<br /> /* <Return> */<br /> /* A pointer to an array of variant selector code points that are */<br /> /* active for the given character, or NULL if the corresponding list */<br /> /* is empty. */<br /> /* */<br /> /* <Note> */<br /> /* The last item in the array is~0; the array is owned by the */<br /> /* @FT_Face object but can be overwritten or released on the next */<br /> /* call to a FreeType function. */<br /> /* */<br /> /* <Since> */<br /> /* 2.3.6 */<br /> /* */<br /> FT_EXPORT( FT_UInt32* )<br /> FT_Face_GetVariantsOfChar( FT_Face face,<br /> FT_ULong charcode );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Face_GetCharsOfVariant */<br /> /* */<br /> /* <Description> */<br /> /* Return a zero-terminated list of Unicode character codes found for */<br /> /* the specified variant selector. */<br /> /* */<br /> /* <Input> */<br /> /* face :: */<br /> /* A handle to the source face object. */<br /> /* */<br /> /* variantSelector :: */<br /> /* The variant selector code point in Unicode. */<br /> /* */<br /> /* <Return> */<br /> /* A list of all the code points that are specified by this selector */<br /> /* (both default and non-default codes are returned) or NULL if there */<br /> /* is no valid cmap or the variant selector is invalid. */<br /> /* */<br /> /* <Note> */<br /> /* The last item in the array is~0; the array is owned by the */<br /> /* @FT_Face object but can be overwritten or released on the next */<br /> /* call to a FreeType function. */<br /> /* */<br /> /* <Since> */<br /> /* 2.3.6 */<br /> /* */<br /> FT_EXPORT( FT_UInt32* )<br /> FT_Face_GetCharsOfVariant( FT_Face face,<br /> FT_ULong variantSelector );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Section> */<br /> /* computations */<br /> /* */<br /> /* <Title> */<br /> /* Computations */<br /> /* */<br /> /* <Abstract> */<br /> /* Crunching fixed numbers and vectors. */<br /> /* */<br /> /* <Description> */<br /> /* This section contains various functions used to perform */<br /> /* computations on 16.16 fixed-float numbers or 2d vectors. */<br /> /* */<br /> /* <Order> */<br /> /* FT_MulDiv */<br /> /* FT_MulFix */<br /> /* FT_DivFix */<br /> /* FT_RoundFix */<br /> /* FT_CeilFix */<br /> /* FT_FloorFix */<br /> /* FT_Vector_Transform */<br /> /* FT_Matrix_Multiply */<br /> /* FT_Matrix_Invert */<br /> /* */<br /> /*************************************************************************/</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_MulDiv */<br /> /* */<br /> /* <Description> */<br /> /* A very simple function used to perform the computation `(a*b)/c’ */<br /> /* with maximum accuracy (it uses a 64-bit intermediate integer */<br /> /* whenever necessary). */<br /> /* */<br /> /* This function isn’t necessarily as fast as some processor specific */<br /> /* operations, but is at least completely portable. */<br /> /* */<br /> /* <Input> */<br /> /* a :: The first multiplier. */<br /> /* b :: The second multiplier. */<br /> /* c :: The divisor. */<br /> /* */<br /> /* <Return> */<br /> /* The result of `(a*b)/c’. This function never traps when trying to */<br /> /* divide by zero; it simply returns `MaxInt’ or `MinInt’ depending */<br /> /* on the signs of `a’ and `b’. */<br /> /* */<br /> FT_EXPORT( FT_Long )<br /> FT_MulDiv( FT_Long a,<br /> FT_Long b,<br /> FT_Long c );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_MulFix */<br /> /* */<br /> /* <Description> */<br /> /* A very simple function used to perform the computation */<br /> /* `(a*b)/0x10000′ with maximum accuracy. Most of the time this is */<br /> /* used to multiply a given value by a 16.16 fixed-point factor. */<br /> /* */<br /> /* <Input> */<br /> /* a :: The first multiplier. */<br /> /* b :: The second multiplier. Use a 16.16 factor here whenever */<br /> /* possible (see note below). */<br /> /* */<br /> /* <Return> */<br /> /* The result of `(a*b)/0x10000′. */<br /> /* */<br /> /* <Note> */<br /> /* This function has been optimized for the case where the absolute */<br /> /* value of `a’ is less than 2048, and `b’ is a 16.16 scaling factor. */<br /> /* As this happens mainly when scaling from notional units to */<br /> /* fractional pixels in FreeType, it resulted in noticeable speed */<br /> /* improvements between versions 2.x and 1.x. */<br /> /* */<br /> /* As a conclusion, always try to place a 16.16 factor as the */<br /> /* _second_ argument of this function; this can make a great */<br /> /* difference. */<br /> /* */<br /> FT_EXPORT( FT_Long )<br /> FT_MulFix( FT_Long a,<br /> FT_Long b );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_DivFix */<br /> /* */<br /> /* <Description> */<br /> /* A very simple function used to perform the computation */<br /> /* `(a*0x10000)/b’ with maximum accuracy. Most of the time, this is */<br /> /* used to divide a given value by a 16.16 fixed-point factor. */<br /> /* */<br /> /* <Input> */<br /> /* a :: The numerator. */<br /> /* b :: The denominator. Use a 16.16 factor here. */<br /> /* */<br /> /* <Return> */<br /> /* The result of `(a*0x10000)/b’. */<br /> /* */<br /> FT_EXPORT( FT_Long )<br /> FT_DivFix( FT_Long a,<br /> FT_Long b );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_RoundFix */<br /> /* */<br /> /* <Description> */<br /> /* A very simple function used to round a 16.16 fixed number. */<br /> /* */<br /> /* <Input> */<br /> /* a :: The number to be rounded. */<br /> /* */<br /> /* <Return> */<br /> /* `a’ rounded to nearest 16.16 fixed integer, halfway cases away */<br /> /* from zero. */<br /> /* */<br /> FT_EXPORT( FT_Fixed )<br /> FT_RoundFix( FT_Fixed a );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_CeilFix */<br /> /* */<br /> /* <Description> */<br /> /* A very simple function used to compute the ceiling function of a */<br /> /* 16.16 fixed number. */<br /> /* */<br /> /* <Input> */<br /> /* a :: The number for which the ceiling function is to be computed. */<br /> /* */<br /> /* <Return> */<br /> /* `a’ rounded towards plus infinity. */<br /> /* */<br /> FT_EXPORT( FT_Fixed )<br /> FT_CeilFix( FT_Fixed a );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_FloorFix */<br /> /* */<br /> /* <Description> */<br /> /* A very simple function used to compute the floor function of a */<br /> /* 16.16 fixed number. */<br /> /* */<br /> /* <Input> */<br /> /* a :: The number for which the floor function is to be computed. */<br /> /* */<br /> /* <Return> */<br /> /* `a’ rounded towards minus infinity. */<br /> /* */<br /> FT_EXPORT( FT_Fixed )<br /> FT_FloorFix( FT_Fixed a );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Vector_Transform */<br /> /* */<br /> /* <Description> */<br /> /* Transform a single vector through a 2×2 matrix. */<br /> /* */<br /> /* <InOut> */<br /> /* vector :: The target vector to transform. */<br /> /* */<br /> /* <Input> */<br /> /* matrix :: A pointer to the source 2×2 matrix. */<br /> /* */<br /> /* <Note> */<br /> /* The result is undefined if either `vector’ or `matrix’ is invalid. */<br /> /* */<br /> FT_EXPORT( void )<br /> FT_Vector_Transform( FT_Vector* vec,<br /> const FT_Matrix* matrix );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Section> */<br /> /* version */<br /> /* */<br /> /* <Title> */<br /> /* FreeType Version */<br /> /* */<br /> /* <Abstract> */<br /> /* Functions and macros related to FreeType versions. */<br /> /* */<br /> /* <Description> */<br /> /* Note that those functions and macros are of limited use because */<br /> /* even a new release of FreeType with only documentation changes */<br /> /* increases the version number. */<br /> /* */<br /> /* <Order> */<br /> /* FT_Library_Version */<br /> /* */<br /> /* FREETYPE_MAJOR */<br /> /* FREETYPE_MINOR */<br /> /* FREETYPE_PATCH */<br /> /* */<br /> /* FT_Face_CheckTrueTypePatents */<br /> /* FT_Face_SetUnpatentedHinting */<br /> /* */<br /> /* FREETYPE_XXX */<br /> /* */<br /> /*************************************************************************/</p> <p> /*************************************************************************<br /> *<br /> * @enum:<br /> * FREETYPE_XXX<br /> *<br /> * @description:<br /> * These three macros identify the FreeType source code version.<br /> * Use @FT_Library_Version to access them at runtime.<br /> *<br /> * @values:<br /> * FREETYPE_MAJOR :: The major version number.<br /> * FREETYPE_MINOR :: The minor version number.<br /> * FREETYPE_PATCH :: The patch level.<br /> *<br /> * @note:<br /> * The version number of FreeType if built as a dynamic link library<br /> * with the `libtool’ package is _not_ controlled by these three<br /> * macros.<br /> *<br /> */<br /> #define FREETYPE_MAJOR 2<br /> #define FREETYPE_MINOR 6<br /> #define FREETYPE_PATCH 1</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Library_Version */<br /> /* */<br /> /* <Description> */<br /> /* Return the version of the FreeType library being used. This is */<br /> /* useful when dynamically linking to the library, since one cannot */<br /> /* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */<br /> /* @FREETYPE_PATCH. */<br /> /* */<br /> /* <Input> */<br /> /* library :: A source library handle. */<br /> /* */<br /> /* <Output> */<br /> /* amajor :: The major version number. */<br /> /* */<br /> /* aminor :: The minor version number. */<br /> /* */<br /> /* apatch :: The patch version number. */<br /> /* */<br /> /* <Note> */<br /> /* The reason why this function takes a `library’ argument is because */<br /> /* certain programs implement library initialization in a custom way */<br /> /* that doesn’t use @FT_Init_FreeType. */<br /> /* */<br /> /* In such cases, the library version might not be available before */<br /> /* the library object has been created. */<br /> /* */<br /> FT_EXPORT( void )<br /> FT_Library_Version( FT_Library library,<br /> FT_Int *amajor,<br /> FT_Int *aminor,<br /> FT_Int *apatch );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Face_CheckTrueTypePatents */<br /> /* */<br /> /* <Description> */<br /> /* Parse all bytecode instructions of a TrueType font file to check */<br /> /* whether any of the patented opcodes are used. This is only useful */<br /> /* if you want to be able to use the unpatented hinter with */<br /> /* fonts that do *not* use these opcodes. */<br /> /* */<br /> /* Note that this function parses *all* glyph instructions in the */<br /> /* font file, which may be slow. */<br /> /* */<br /> /* <Input> */<br /> /* face :: A face handle. */<br /> /* */<br /> /* <Return> */<br /> /* 1~if this is a TrueType font that uses one of the patented */<br /> /* opcodes, 0~otherwise. */<br /> /* */<br /> /* <Note> */<br /> /* Since May 2010, TrueType hinting is no longer patented. */<br /> /* */<br /> /* <Since> */<br /> /* 2.3.5 */<br /> /* */<br /> FT_EXPORT( FT_Bool )<br /> FT_Face_CheckTrueTypePatents( FT_Face face );</p> <p> /*************************************************************************/<br /> /* */<br /> /* <Function> */<br /> /* FT_Face_SetUnpatentedHinting */<br /> /* */<br /> /* <Description> */<br /> /* Enable or disable the unpatented hinter for a given face. */<br /> /* Only enable it if you have determined that the face doesn’t */<br /> /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */<br /> /* */<br /> /* <Input> */<br /> /* face :: A face handle. */<br /> /* */<br /> /* value :: New boolean setting. */<br /> /* */<br /> /* <Return> */<br /> /* The old setting value. This will always be false if this is not */<br /> /* an SFNT font, or if the unpatented hinter is not compiled in this */<br /> /* instance of the library. */<br /> /* */<br /> /* <Note> */<br /> /* Since May 2010, TrueType hinting is no longer patented. */<br /> /* */<br /> /* <Since> */<br /> /* 2.3.5 */<br /> /* */<br /> FT_EXPORT( FT_Bool )<br /> FT_Face_SetUnpatentedHinting( FT_Face face,<br /> FT_Bool value );</p> <p> /* */</p> <p>FT_END_HEADER</p> <p>#endif /* __FREETYPE_H__ */</p> <p>/* END */</p> </div><!-- .entry-content .clear --> </div> </article><!-- #post-## --> <nav class="navigation post-navigation" aria-label="Post navigation"> <span class="screen-reader-text">Post navigation</span> <div class="nav-links"><div class="nav-previous"><a title="CS代考计算机代写 chain #include "tests/threads/tests.h"" href="https://powcoder.com/2021/02/13/cs%e4%bb%a3%e8%80%83%e8%ae%a1%e7%ae%97%e6%9c%ba%e4%bb%a3%e5%86%99-chain-include-tests-threads-tests-h/" rel="prev"><span class="ast-left-arrow">←</span> Previous Post</a></div><div class="nav-next"><a title="CS代考计算机代写 # -*- perl -*-" href="https://powcoder.com/2021/02/13/cs%e4%bb%a3%e8%80%83%e8%ae%a1%e7%ae%97%e6%9c%ba%e4%bb%a3%e5%86%99-perl-64/" rel="next">Next Post <span class="ast-right-arrow">→</span></a></div></div> </nav><div class="ast-single-related-posts-container ast-container--fallback"><div class="ast-related-posts-title-section"> <h2 class="ast-related-posts-title"> Related Posts </h2> </div><div class="ast-related-posts-wrapper"> <article class="ast-related-post post-38 post type-post status-publish format-standard hentry category-uncategorized tag-matlab tag-simulation"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/matlab-simulation/" target="_self" rel="bookmark noopener noreferrer">matlab simulation</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/matlab/" rel="tag">matlab代写代考</a>, <a href="https://powcoder.com/tag/simulation/" rel="tag">simulation</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> <article class="ast-related-post post-39 post type-post status-publish format-standard hentry category-uncategorized tag-c"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/ab202-assignment-1-arkapong/" target="_self" rel="bookmark noopener noreferrer">AB202 Assignment 1: Arkapong</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/c/" rel="tag">c++代做</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> <article class="ast-related-post post-40 post type-post status-publish format-standard hentry category-uncategorized tag-c"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/msc-c-programming/" target="_self" rel="bookmark noopener noreferrer">MSc C++ Programming</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/c/" rel="tag">c++代做</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> <article class="ast-related-post post-41 post type-post status-publish format-standard hentry category-uncategorized tag-prolog"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/msc-assessed-prolog-lab-exercise-2/" target="_self" rel="bookmark noopener noreferrer">MSc Assessed Prolog Lab Exercise 2</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/prolog/" rel="tag">Prolog代写代考</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> <article class="ast-related-post post-49 post type-post status-publish format-standard hentry category-uncategorized tag-c tag-uml"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/spring-session2015assignment-1/" target="_self" rel="bookmark noopener noreferrer">Spring Session:2015:Assignment 1</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/c/" rel="tag">c++代做</a>, <a href="https://powcoder.com/tag/uml/" rel="tag">UML</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> <article class="ast-related-post post-51 post type-post status-publish format-standard hentry category-uncategorized tag-uml"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/assignment-2-inception-and-elaboration/" target="_self" rel="bookmark noopener noreferrer">Assignment 2: "Inception and Elaboration"</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/uml/" rel="tag">UML</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> <article class="ast-related-post post-55 post type-post status-publish format-standard hentry category-uncategorized tag-android tag-java"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/android-app/" target="_self" rel="bookmark noopener noreferrer">android app</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/android/" rel="tag">android</a>, <a href="https://powcoder.com/tag/java/" rel="tag">Java代写代考</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> <article class="ast-related-post post-57 post type-post status-publish format-standard hentry category-uncategorized tag-java tag-junit"> <div class="ast-related-posts-inner-section"> <div class="ast-related-post-content"> <div class="ast-related-post-featured-section ast-no-thumb"></div> <header class="entry-header related-entry-header"> <h3 class="ast-related-post-title entry-title"> <a href="https://powcoder.com/2016/06/21/comp220-software-development-tools/" target="_self" rel="bookmark noopener noreferrer">COMP220: Software Development Tools</a> </h3> <div class="entry-meta ast-related-cat-style--none ast-related-tag-style--none"><span class="ast-taxonomy-container cat-links default"><a href="https://powcoder.com/category/uncategorized/" rel="category tag">程序代写 CS代考</a></span> / <span class="ast-taxonomy-container tags-links default"><a href="https://powcoder.com/tag/java/" rel="tag">Java代写代考</a>, <a href="https://powcoder.com/tag/junit/" rel="tag">junit</a></span></div> </header> <div class="entry-content clear"> </div> </div> </div> </article> </div> </div> </main><!-- #main --> </div><!-- #primary --> <div class="widget-area secondary" id="secondary" itemtype="https://schema.org/WPSideBar" itemscope="itemscope"> <div class="sidebar-main" > <aside id="custom_html-2" class="widget_text widget widget_custom_html"><h2 class="widget-title">Contact</h2><div class="textwidget custom-html-widget"><ul> <li><strong>QQ: 1823890830</strong></li> <li><strong>微信号(WeChat): powcoder</strong></li> <li><img data-recalc-dims="1" class="alignnone wp-image-366" src="https://i0.wp.com/powcoder.com/wp-content/uploads/2021/01/powcoder.jpg?resize=133%2C133&ssl=1" alt="myweixin" width="133" height="133"/></li> <li><strong>Email: <a href="mailto:powcoder@163.com">powcoder@163.com</a></strong></li> </ul> <ul> <li><strong>请加微信或QQ发要求</strong></li> <li><strong>Contact me through WeChat</strong></li> </ul> </div></aside><aside id="categories-2" class="widget widget_categories"><h2 class="widget-title">Categories</h2><nav aria-label="Categories"> <ul> <li class="cat-item cat-item-245"><a href="https://powcoder.com/category/machine-learning/">机器学习代写代考 machine learning</a> </li> <li class="cat-item cat-item-242"><a href="https://powcoder.com/category/database-db-sql/">数据库代写代考 DB Database SQL</a> </li> <li class="cat-item cat-item-244"><a href="https://powcoder.com/category/data-structure-algorithm/">数据结构算法代写代考 data structure algorithm</a> </li> <li class="cat-item cat-item-239"><a href="https://powcoder.com/category/%e4%ba%ba%e5%b7%a5%e6%99%ba%e8%83%bd-ai-artificial-intelligence/">人工智能 AI Artificial Intelligence</a> </li> <li class="cat-item cat-item-247"><a href="https://powcoder.com/category/compiler/">编译器原理 Compiler</a> </li> <li class="cat-item cat-item-254"><a href="https://powcoder.com/category/network-socket/">计算机网络 套接字编程 computer network socket programming</a> </li> <li class="cat-item cat-item-240"><a href="https://powcoder.com/category/hadoop-map-reduce-spark-hbase/">大数据 Hadoop Map Reduce Spark HBase</a> </li> <li class="cat-item cat-item-241"><a href="https://powcoder.com/category/%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9fosoperating-system/">操作系统OS代写代考 (Operating System)</a> </li> <li class="cat-item cat-item-250"><a href="https://powcoder.com/category/computer-architecture/">计算机体系结构代写代考 Computer Architecture</a> </li> <li class="cat-item cat-item-251"><a href="https://powcoder.com/category/computer-graphics-opengl-webgl/">计算机图形学 Computer Graphics opengl webgl</a> </li> <li class="cat-item cat-item-249"><a href="https://powcoder.com/category/nlp/">自然语言处理 NLP natural language processing</a> </li> <li class="cat-item cat-item-383"><a href="https://powcoder.com/category/%e5%b9%b6%e8%a1%8c%e8%ae%a1%e7%ae%97/">并行计算</a> </li> <li class="cat-item cat-item-253"><a href="https://powcoder.com/category/computation-theory/">计算理论 Theory of Computation</a> </li> <li class="cat-item cat-item-252"><a href="https://powcoder.com/category/computer-security/">计算机安全密码学computer security cryptography</a> </li> <li class="cat-item cat-item-246"><a href="https://powcoder.com/category/sys-programming/">系统编程 System programming</a> </li> <li class="cat-item cat-item-367"><a href="https://powcoder.com/category/%e6%95%b0%e5%80%bc%e7%a7%91%e5%ad%a6%e8%ae%a1%e7%ae%97/">数值科学计算</a> </li> <li class="cat-item cat-item-255"><a href="https://powcoder.com/category/%e8%ae%a1%e7%ae%97%e6%9c%ba%e8%a7%86%e8%a7%89compute-vision/">计算机视觉代写代考(Compute Vision)</a> </li> <li class="cat-item cat-item-248"><a href="https://powcoder.com/category/web/">网页应用 Web Application</a> </li> <li class="cat-item cat-item-401"><a href="https://powcoder.com/category/%e5%88%86%e5%b8%83%e5%bc%8f%e7%b3%bb%e7%bb%9f/">分布式系统</a> </li> <li class="cat-item cat-item-640"><a href="https://powcoder.com/category/%e7%ac%94%e8%af%95%e9%9d%a2%e8%af%95/">笔试面试</a> </li> <li class="cat-item cat-item-403"><a href="https://powcoder.com/category/%e5%87%bd%e6%95%b0%e5%bc%8f%e7%bc%96%e7%a8%8b/">函数式编程</a> </li> <li class="cat-item cat-item-243"><a href="https://powcoder.com/category/%e6%95%b0%e6%8d%ae%e6%8c%96%e6%8e%98-data-mining/">数据挖掘 Data Mining</a> </li> <li class="cat-item cat-item-364"><a href="https://powcoder.com/category/%e7%a6%bb%e6%95%a3%e6%95%b0%e5%ad%a6/">离散数学代写代考 (Discrete mathematics)</a> </li> <li class="cat-item cat-item-384"><a href="https://powcoder.com/category/%e8%bd%af%e4%bb%b6%e5%b7%a5%e7%a8%8b/">软件工程</a> </li> <li class="cat-item cat-item-551"><a href="https://powcoder.com/category/%e7%bc%96%e7%a8%8b%e8%af%ad%e8%a8%80-programming-language/">编程语言 Programming Language</a> </li> <li class="cat-item cat-item-594"><a href="https://powcoder.com/category/%e7%bb%9f%e8%ae%a1%e4%bb%a3%e5%86%99%e4%bb%a3%e8%80%83/">统计代写代考</a> </li> <li class="cat-item cat-item-574"><a href="https://powcoder.com/category/%e8%bf%90%e7%ad%b9%e5%ad%a6-operation-research/">运筹学 Operation Research</a> </li> </ul> </nav></aside><aside id="tag_cloud-3" class="widget widget_tag_cloud"><h2 class="widget-title">Tag</h2><nav aria-label="Tag"><div class="tagcloud"><a href="https://powcoder.com/tag/algorithm/" class="tag-cloud-link tag-link-469 tag-link-position-1" style="font-size: 18px;" aria-label="Algorithm算法代写代考 (15,143 items)">Algorithm算法代写代考</a><a href="https://powcoder.com/tag/java/" class="tag-cloud-link tag-link-298 tag-link-position-2" style="font-size: 16.91156462585px;" aria-label="Java代写代考 (7,271 items)">Java代写代考</a><a href="https://powcoder.com/tag/database/" class="tag-cloud-link tag-link-414 tag-link-position-3" style="font-size: 16.503401360544px;" aria-label="database (5,442 items)">database</a><a href="https://powcoder.com/tag/data-structure/" class="tag-cloud-link tag-link-501 tag-link-position-4" style="font-size: 16.401360544218px;" aria-label="data structure (5,185 items)">data structure</a><a href="https://powcoder.com/tag/python/" class="tag-cloud-link tag-link-331 tag-link-position-5" style="font-size: 16.299319727891px;" aria-label="Python代写代考 (4,810 items)">Python代写代考</a><a href="https://powcoder.com/tag/compiler/" class="tag-cloud-link tag-link-472 tag-link-position-6" style="font-size: 16.027210884354px;" aria-label="compiler (4,000 items)">compiler</a><a href="https://powcoder.com/tag/scheme/" class="tag-cloud-link tag-link-338 tag-link-position-7" style="font-size: 15.823129251701px;" aria-label="Scheme代写代考 (3,502 items)">Scheme代写代考</a><a href="https://powcoder.com/tag/c-4/" class="tag-cloud-link tag-link-499 tag-link-position-8" style="font-size: 15.823129251701px;" aria-label="C语言代写 (3,489 items)">C语言代写</a><a href="https://powcoder.com/tag/ai/" class="tag-cloud-link tag-link-369 tag-link-position-9" style="font-size: 15.176870748299px;" aria-label="AI代写 (2,216 items)">AI代写</a><a href="https://powcoder.com/tag/c-3/" class="tag-cloud-link tag-link-491 tag-link-position-10" style="font-size: 14.700680272109px;" aria-label="c++代写 (1,633 items)">c++代写</a><a href="https://powcoder.com/tag/sql/" class="tag-cloud-link tag-link-395 tag-link-position-11" style="font-size: 14.530612244898px;" aria-label="SQL代写代考 (1,457 items)">SQL代写代考</a><a href="https://powcoder.com/tag/haskell/" class="tag-cloud-link tag-link-291 tag-link-position-12" style="font-size: 14.530612244898px;" aria-label="Haskell代写代考 (1,453 items)">Haskell代写代考</a><a href="https://powcoder.com/tag/javascript/" class="tag-cloud-link tag-link-299 tag-link-position-13" style="font-size: 14.462585034014px;" aria-label="javascript (1,395 items)">javascript</a><a href="https://powcoder.com/tag/concurrency/" class="tag-cloud-link tag-link-503 tag-link-position-14" style="font-size: 14.428571428571px;" aria-label="concurrency (1,355 items)">concurrency</a><a href="https://powcoder.com/tag/matlab/" class="tag-cloud-link tag-link-309 tag-link-position-15" style="font-size: 14.360544217687px;" aria-label="matlab代写代考 (1,281 items)">matlab代写代考</a><a href="https://powcoder.com/tag/finance/" class="tag-cloud-link tag-link-282 tag-link-position-16" style="font-size: 14.292517006803px;" aria-label="finance (1,221 items)">finance</a><a href="https://powcoder.com/tag/interpreter/" class="tag-cloud-link tag-link-297 tag-link-position-17" style="font-size: 14.190476190476px;" aria-label="interpreter (1,144 items)">interpreter</a><a href="https://powcoder.com/tag/mips/" class="tag-cloud-link tag-link-313 tag-link-position-18" style="font-size: 14.156462585034px;" aria-label="MIPS汇编代写代考 (1,134 items)">MIPS汇编代写代考</a><a href="https://powcoder.com/tag/data-mining/" class="tag-cloud-link tag-link-271 tag-link-position-19" style="font-size: 13.986394557823px;" aria-label="data mining (991 items)">data mining</a><a href="https://powcoder.com/tag/decision-tree/" class="tag-cloud-link tag-link-273 tag-link-position-20" style="font-size: 13.952380952381px;" aria-label="decision tree (982 items)">decision tree</a><a href="https://powcoder.com/tag/deep-learning/" class="tag-cloud-link tag-link-274 tag-link-position-21" style="font-size: 13.952380952381px;" aria-label="deep learning深度学习代写代考 (980 items)">deep learning深度学习代写代考</a><a href="https://powcoder.com/tag/prolog/" class="tag-cloud-link tag-link-329 tag-link-position-22" style="font-size: 13.918367346939px;" aria-label="Prolog代写代考 (957 items)">Prolog代写代考</a><a href="https://powcoder.com/tag/file-system/" class="tag-cloud-link tag-link-281 tag-link-position-23" style="font-size: 13.850340136054px;" aria-label="file system (902 items)">file system</a><a href="https://powcoder.com/tag/c/" class="tag-cloud-link tag-link-265 tag-link-position-24" style="font-size: 13.578231292517px;" aria-label="c++代做 (764 items)">c++代做</a><a href="https://powcoder.com/tag/computer-architecture/" class="tag-cloud-link tag-link-507 tag-link-position-25" style="font-size: 13.47619047619px;" aria-label="computer architecture (712 items)">computer architecture</a><a href="https://powcoder.com/tag/er/" class="tag-cloud-link tag-link-433 tag-link-position-26" style="font-size: 13.47619047619px;" aria-label="ER (711 items)">ER</a><a href="https://powcoder.com/tag/gui/" class="tag-cloud-link tag-link-290 tag-link-position-27" style="font-size: 13.47619047619px;" aria-label="gui (711 items)">gui</a><a href="https://powcoder.com/tag/gpu/" class="tag-cloud-link tag-link-396 tag-link-position-28" style="font-size: 13.272108843537px;" aria-label="GPU (620 items)">GPU</a><a href="https://powcoder.com/tag/data-science/" class="tag-cloud-link tag-link-272 tag-link-position-29" style="font-size: 13.272108843537px;" aria-label="data science (615 items)">data science</a><a href="https://powcoder.com/tag/x86%e6%b1%87%e7%bc%96/" class="tag-cloud-link tag-link-514 tag-link-position-30" style="font-size: 13.238095238095px;" aria-label="x86汇编代写代考 (606 items)">x86汇编代写代考</a><a href="https://powcoder.com/tag/case-study/" class="tag-cloud-link tag-link-468 tag-link-position-31" style="font-size: 13.204081632653px;" aria-label="case study (586 items)">case study</a><a href="https://powcoder.com/tag/distributed-system/" class="tag-cloud-link tag-link-277 tag-link-position-32" style="font-size: 13.170068027211px;" aria-label="distributed system (576 items)">distributed system</a><a href="https://powcoder.com/tag/android/" class="tag-cloud-link tag-link-256 tag-link-position-33" style="font-size: 13.034013605442px;" aria-label="android (527 items)">android</a><a href="https://powcoder.com/tag/kernel/" class="tag-cloud-link tag-link-470 tag-link-position-34" style="font-size: 13.034013605442px;" aria-label="kernel (520 items)">kernel</a><a href="https://powcoder.com/tag/arm/" class="tag-cloud-link tag-link-483 tag-link-position-35" style="font-size: 13px;" aria-label="ARM汇编代写代考 (514 items)">ARM汇编代写代考</a></div> </nav></aside><aside id="block-4" class="widget widget_block"> <div class="wp-block-group is-layout-flow wp-block-group-is-layout-flow"><div class="wp-block-group__inner-container"><ul class="wp-block-latest-posts__list wp-block-latest-posts"><li><a class="wp-block-latest-posts__post-title" href="https://powcoder.com/2024/11/17/%e7%95%99%e5%ad%a6%e7%94%9f%e4%bd%9c%e4%b8%9a%e4%bb%a3%e5%86%99-comp9313-project-3/">留学生作业代写 COMP9313 Project 3</a></li> <li><a class="wp-block-latest-posts__post-title" href="https://powcoder.com/2024/10/12/%e7%a8%8b%e5%ba%8f%e4%bb%a3%e5%86%99-comp2521-24t3-assignment-1-2/">程序代写 COMP2521 24T3 – Assignment 1</a></li> <li><a class="wp-block-latest-posts__post-title" href="https://powcoder.com/2024/10/12/%e4%bb%a3%e5%86%99%e4%bb%a3%e8%80%83-compsys-705-formal-methods-for-safety-critical-software-test-17-october-20/">代写代考 COMPSYS 705 Formal Methods for Safety Critical Software Test, 17 October 20</a></li> <li><a class="wp-block-latest-posts__post-title" href="https://powcoder.com/2024/10/07/%e7%a8%8b%e5%ba%8f%e4%bb%a3%e5%86%99-comp2521-24t3-assignment-1/">程序代写 COMP2521 24T3 – Assignment 1</a></li> <li><a class="wp-block-latest-posts__post-title" href="https://powcoder.com/2024/09/30/%e7%a8%8b%e5%ba%8f%e4%bb%a3%e5%86%99-comp4500-7500-2/">程序代写 COMP4500/7500</a></li> </ul></div></div> </aside> </div><!-- .sidebar-main --> </div><!-- #secondary --> </div> <!-- ast-container --> </div><!-- #content --> <footer class="site-footer" id="colophon" itemtype="https://schema.org/WPFooter" itemscope="itemscope" itemid="#colophon"> <div class="site-below-footer-wrap ast-builder-grid-row-container site-footer-focus-item ast-builder-grid-row-full ast-builder-grid-row-tablet-full ast-builder-grid-row-mobile-full ast-footer-row-stack ast-footer-row-tablet-stack ast-footer-row-mobile-stack" data-section="section-below-footer-builder"> <div class="ast-builder-grid-row-container-inner"> <div class="ast-builder-footer-grid-columns site-below-footer-inner-wrap ast-builder-grid-row"> <div class="site-footer-below-section-1 site-footer-section site-footer-section-1"> <div class="ast-builder-layout-element ast-flex site-footer-focus-item ast-footer-copyright" data-section="section-footer-builder"> <div class="ast-footer-copyright"><p>Copyright © 2024 PowCoder代写 | Powered by <a href="https://wpastra.com/" rel="nofollow noopener" target="_blank">Astra WordPress Theme</a></p> </div> </div> </div> </div> </div> </div> </footer><!-- #colophon --> </div><!-- #page --> <link rel="stylesheet" href="https://powcoder.com/wp-content/cache/minify/12163.css" media="all" /> <script id="astra-theme-js-js-extra"> var astra = {"break_point":"921","isRtl":"","is_scroll_to_id":"","is_scroll_to_top":"","is_header_footer_builder_active":"1","responsive_cart_click":"flyout"}; </script> <script src="https://powcoder.com/wp-content/cache/minify/75800.js"></script> <script src="https://stats.wp.com/e-202448.js" id="jetpack-stats-js" data-wp-strategy="defer"></script> <script id="jetpack-stats-js-after"> _stq = window._stq || []; _stq.push([ "view", JSON.parse("{\"v\":\"ext\",\"blog\":\"132118579\",\"post\":\"41022\",\"tz\":\"8\",\"srv\":\"powcoder.com\",\"j\":\"1:14.0\"}") ]); _stq.push([ "clickTrackerInit", "132118579", "41022" ]); </script> <script> /(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())},!1); </script> </body> </html> <!-- Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/ Object Caching 277/344 objects using Disk Page Caching using Disk: Enhanced Content Delivery Network via N/A Minified using Disk Served from: powcoder.com @ 2024-11-25 22:57:39 by W3 Total Cache -->