📄 freetype.h
字号:
(((TT_ULong)_x1 << 24) | \ ((TT_ULong)_x2 << 16) | \ ((TT_ULong)_x3 << 8) | \ (TT_ULong)_x4) /* ----------------------- instance management -------------------- */ /* Open a new font instance and returns an instance handle */ /* for it in `*instance'. */ EXPORT_DEF TT_Error TT_New_Instance( TT_Face face, TT_Instance* instance ); /* Set device resolution for a given instance. The values are */ /* given in dpi (Dots Per Inch). Default is 96 in both directions. */ EXPORT_DEF TT_Error TT_Set_Instance_Resolutions( TT_Instance instance, TT_UShort xResolution, TT_UShort yResolution ); /* Set the pointsize for a given instance. Default is 10pt. */ EXPORT_DEF TT_Error TT_Set_Instance_CharSize( TT_Instance instance, TT_F26Dot6 charSize ); EXPORT_DEF TT_Error TT_Set_Instance_CharSizes( TT_Instance instance, TT_F26Dot6 charWidth, TT_F26Dot6 charHeight );#define TT_Set_Instance_PointSize( ins, ptsize ) \ TT_Set_Instance_CharSize( ins, ptsize*64L ) EXPORT_DEF TT_Error TT_Set_Instance_PixelSizes( TT_Instance instance, TT_UShort pixelWidth, TT_UShort pixelHeight, TT_F26Dot6 pointSize ); /* This function has been deprecated! Do not use it, as it */ /* doesn't work reliably. You can perfectly control hinting */ /* yourself when loading glyphs, then apply transforms as usual. */ EXPORT_DEF TT_Error TT_Set_Instance_Transform_Flags( TT_Instance instance, TT_Bool rotated, TT_Bool stretched ); /* Return instance metrics in `metrics'. */ EXPORT_DEF TT_Error TT_Get_Instance_Metrics( TT_Instance instance, TT_Instance_Metrics* metrics ); /* Set an instance's generic pointer. */ EXPORT_DEF TT_Error TT_Set_Instance_Pointer( TT_Instance instance, void* data ); /* Get an instance's generic pointer. */ EXPORT_DEF void* TT_Get_Instance_Pointer( TT_Instance instance ); /* Close a given instance object, destroying all associated data. */ EXPORT_DEF TT_Error TT_Done_Instance( TT_Instance instance ); /* ----------------------- glyph management ----------------------- */ /* Create a new glyph object related to the given `face'. */ EXPORT_DEF TT_Error TT_New_Glyph( TT_Face face, TT_Glyph* glyph ); /* Discard (and destroy) a given glyph object. */ EXPORT_DEF TT_Error TT_Done_Glyph( TT_Glyph glyph );#define TTLOAD_SCALE_GLYPH 1#define TTLOAD_HINT_GLYPH 2#define TTLOAD_PEDANTIC 128#define TTLOAD_IGNORE_GLOBAL_ADVANCE_WIDTH 256#define TTLOAD_DEFAULT (TTLOAD_SCALE_GLYPH | TTLOAD_HINT_GLYPH) /* Load and process (scale/transform and hint) a glyph from the */ /* given `instance'. The glyph and instance handles must be */ /* related to the same face object. The glyph index can be */ /* computed with a call to TT_Char_Index(). */ /* */ /* The 'load_flags' argument is a combination of the macros */ /* TTLOAD_SCALE_GLYPH and TTLOAD_HINT_GLYPH. Hinting will be */ /* applied only if the scaling is selected. */ /* */ /* If scaling is off (i.e., load_flags = 0), the returned */ /* outlines are in EM square coordinates (also called FUnits), */ /* extracted directly from the font with no hinting. Other */ /* glyph metrics are also in FUnits. */ /* */ /* If scaling is on, the returned outlines are in fractional */ /* pixel units (i.e. TT_F26Dot6 = 26.6 fixed floats). */ /* */ /* NOTE: The glyph index must be in the range 0..num_glyphs-1, */ /* where `num_glyphs' is the total number of glyphs in */ /* the font file (given in the face properties). */ EXPORT_DEF TT_Error TT_Load_Glyph( TT_Instance instance, TT_Glyph glyph, TT_UShort glyphIndex, TT_UShort loadFlags ); /* Return glyph outline pointers in `outline'. Note that the returned */ /* pointers are owned by the glyph object, and will be destroyed with */ /* it. The client application should _not_ change the pointers. */ EXPORT_DEF TT_Error TT_Get_Glyph_Outline( TT_Glyph glyph, TT_Outline* outline ); /* Copy the glyph metrics into `metrics'. */ EXPORT_DEF TT_Error TT_Get_Glyph_Metrics( TT_Glyph glyph, TT_Glyph_Metrics* metrics ); /* Copy the glyph's big metrics into `metrics'. */ /* Necessary to obtain vertical metrics. */ EXPORT_DEF TT_Error TT_Get_Glyph_Big_Metrics( TT_Glyph glyph, TT_Big_Glyph_Metrics* metrics ); /* Render the glyph into a bitmap, with given position offsets. */ /* */ /* Note: Only use integer pixel offsets to preserve the fine */ /* hinting of the glyph and the `correct' anti-aliasing */ /* (where vertical and horizontal stems aren't grayed). This */ /* means that `xOffset' and `yOffset' must be multiples */ /* of 64! */ EXPORT_DEF TT_Error TT_Get_Glyph_Bitmap( TT_Glyph glyph, TT_Raster_Map* map, TT_F26Dot6 xOffset, TT_F26Dot6 yOffset ); /* Render the glyph into a pixmap, with given position offsets. */ /* */ /* Note: Only use integer pixel offsets to preserve the fine */ /* hinting of the glyph and the `correct' anti-aliasing */ /* (where vertical and horizontal stems aren't grayed). This */ /* means that `xOffset' and `yOffset' must be multiples */ /* of 64! */ EXPORT_DEF TT_Error TT_Get_Glyph_Pixmap( TT_Glyph glyph, TT_Raster_Map* map, TT_F26Dot6 xOffset, TT_F26Dot6 yOffset ); /* ----------------------- outline support ------------------------ */ /* Allocate a new outline. Reserve space for `numPoints' and */ /* `numContours'. */ EXPORT_DEF TT_Error TT_New_Outline( TT_UShort numPoints, TT_Short numContours, TT_Outline* outline ); /* Release an outline. */ EXPORT_DEF TT_Error TT_Done_Outline( TT_Outline* outline ); /* Copy an outline into another one. */ EXPORT_DEF TT_Error TT_Copy_Outline( TT_Outline* source, TT_Outline* target ); /* Render an outline into a bitmap. */ EXPORT_DEF TT_Error TT_Get_Outline_Bitmap( TT_Engine engine, TT_Outline* outline, TT_Raster_Map* map ); /* Render an outline into a pixmap. */ EXPORT_DEF TT_Error TT_Get_Outline_Pixmap( TT_Engine engine, TT_Outline* outline, TT_Raster_Map* map ); /* Return an outline's bounding box -- this function is slow as it */ /* performs a complete scan-line process, without drawing, to get */ /* the most accurate values. */ EXPORT_DEF TT_Error TT_Get_Outline_BBox( TT_Outline* outline, TT_BBox* bbox ); /* Apply a transformation to a glyph outline. */ EXPORT_DEF void TT_Transform_Outline( TT_Outline* outline, TT_Matrix* matrix ); /* Apply a translation to a glyph outline. */ EXPORT_DEF void TT_Translate_Outline( TT_Outline* outline, TT_F26Dot6 xOffset, TT_F26Dot6 yOffset ); /* Apply a transformation to a vector. */ EXPORT_DEF void TT_Transform_Vector( TT_F26Dot6* x, TT_F26Dot6* y, TT_Matrix* matrix ); /* Compute A*B/C with 64 bits intermediate precision. */ EXPORT_DEF TT_Long TT_MulDiv( TT_Long A, TT_Long B, TT_Long C ); /* Compute A*B/0x10000 with 64 bits intermediate precision. */ /* Useful to multiply by a 16.16 fixed float value. */ EXPORT_DEF TT_Long TT_MulFix( TT_Long A, TT_Long B ); /* ----------------- character mapping support --------------- */ /* Return the number of character mappings found in this file. */ /* Returns -1 in case of failure (invalid face handle). */ /* */ /* DON'T USE THIS FUNCTION! IT HAS BEEN DEPRECATED! */ /* */ /* It is retained for backwards compatibility only and will */ /* fail on 16bit systems. */ /* */ /* You can now get the charmap count in the `num_CharMaps' */ /* field of a face's properties. */ /* */ EXPORT_DEF int TT_Get_CharMap_Count( TT_Face face ); /* Return the ID of charmap number `charmapIndex' of a given face */ /* used to enumerate the charmaps present in a TrueType file. */ EXPORT_DEF TT_Error TT_Get_CharMap_ID( TT_Face face, TT_UShort charmapIndex, TT_UShort* platformID, TT_UShort* encodingID ); /* Look up the character maps found in `face' and return a handle */ /* for the one matching `platformID' and `platformEncodingID' */ /* (see the TrueType specs relating to the `cmap' table for */ /* information on these ID numbers). Returns an error code. */ /* In case of failure, the handle is set to NULL and is invalid. */ EXPORT_DEF TT_Error TT_Get_CharMap( TT_Face face, TT_UShort charmapIndex, TT_CharMap* charMap ); /* Translate a character code through a given character map */ /* and return the corresponding glyph index to be used in */ /* a TT_Load_Glyph() call. This function returns 0 in case */ /* of failure. */ EXPORT_DEF TT_UShort TT_Char_Index( TT_CharMap charMap, TT_UShort charCode ); /* --------------------- names table support ------------------- */ /* Return the number of name strings found in the name table. */ /* Returns -1 in case of failure (invalid face handle). */ /* */ /* DON'T USE THIS FUNCTION! IT HAS BEEN DEPRECATED! */ /* */ /* It is retained for backwards compatibility only and will */ /* fail on 16bit systems. */ /* */ /* You can now get the number of name strings in a face with */ /* the `num_Names' field of its properties. */ EXPORT_DEF int TT_Get_Name_Count( TT_Face face ); /* Return the ID of the name number `nameIndex' of a given face */ /* used to enumerate the charmaps present in a TrueType file. */ EXPORT_DEF TT_Error TT_Get_Name_ID( TT_Face face, TT_UShort nameIndex, TT_UShort* platformID, TT_UShort* encodingID, TT_UShort* languageID, TT_UShort* nameID ); /* Return the address and length of the name number `nameIndex' */ /* of a given face in the variables `stringPtr' resp. `length'. */ /* The string is part of the face object and shouldn't be */ /* written to or released. */ /* */ /* Note that for an invalid platform ID a null pointer will be */ /* returned. */ EXPORT_DEF TT_Error TT_Get_Name_String( TT_Face face, TT_UShort nameIndex, TT_String** stringPtr, TT_UShort* length );#ifdef __cplusplus }#endif#endif /* FREETYPE_H *//* END */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -