nuclear@0: /***************************************************************************/ nuclear@0: /* */ nuclear@0: /* ftglyph.h */ nuclear@0: /* */ nuclear@0: /* FreeType convenience functions to handle glyphs (specification). */ nuclear@0: /* */ nuclear@0: /* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009 by */ nuclear@0: /* David Turner, Robert Wilhelm, and Werner Lemberg. */ nuclear@0: /* */ nuclear@0: /* This file is part of the FreeType project, and may only be used, */ nuclear@0: /* modified, and distributed under the terms of the FreeType project */ nuclear@0: /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ nuclear@0: /* this file you indicate that you have read the license and */ nuclear@0: /* understand and accept it fully. */ nuclear@0: /* */ nuclear@0: /***************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* This file contains the definition of several convenience functions */ nuclear@0: /* that can be used by client applications to easily retrieve glyph */ nuclear@0: /* bitmaps and outlines from a given face. */ nuclear@0: /* */ nuclear@0: /* These functions should be optional if you are writing a font server */ nuclear@0: /* or text layout engine on top of FreeType. However, they are pretty */ nuclear@0: /* handy for many other simple uses of the library. */ nuclear@0: /* */ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: #ifndef __FTGLYPH_H__ nuclear@0: #define __FTGLYPH_H__ nuclear@0: nuclear@0: nuclear@0: #include nuclear@0: #include FT_FREETYPE_H nuclear@0: nuclear@0: #ifdef FREETYPE_H nuclear@0: #error "freetype.h of FreeType 1 has been loaded!" nuclear@0: #error "Please fix the directory search order for header files" nuclear@0: #error "so that freetype.h of FreeType 2 is found first." nuclear@0: #endif nuclear@0: nuclear@0: nuclear@0: FT_BEGIN_HEADER nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /*
*/ nuclear@0: /* glyph_management */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* Glyph Management */ nuclear@0: /* */ nuclear@0: /* <Abstract> */ nuclear@0: /* Generic interface to manage individual glyph data. */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* This section contains definitions used to manage glyph data */ nuclear@0: /* through generic FT_Glyph objects. Each of them can contain a */ nuclear@0: /* bitmap, a vector outline, or even images in other formats. */ nuclear@0: /* */ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /* forward declaration to a private type */ nuclear@0: typedef struct FT_Glyph_Class_ FT_Glyph_Class; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_Glyph */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Handle to an object used to model generic glyph images. It is a */ nuclear@0: /* pointer to the @FT_GlyphRec structure and can contain a glyph */ nuclear@0: /* bitmap or pointer. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* Glyph objects are not owned by the library. You must thus release */ nuclear@0: /* them manually (through @FT_Done_Glyph) _before_ calling */ nuclear@0: /* @FT_Done_FreeType. */ nuclear@0: /* */ nuclear@0: typedef struct FT_GlyphRec_* FT_Glyph; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Struct> */ nuclear@0: /* FT_GlyphRec */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* The root glyph structure contains a given glyph image plus its */ nuclear@0: /* advance width in 16.16 fixed float format. */ nuclear@0: /* */ nuclear@0: /* <Fields> */ nuclear@0: /* library :: A handle to the FreeType library object. */ nuclear@0: /* */ nuclear@0: /* clazz :: A pointer to the glyph's class. Private. */ nuclear@0: /* */ nuclear@0: /* format :: The format of the glyph's image. */ nuclear@0: /* */ nuclear@0: /* advance :: A 16.16 vector that gives the glyph's advance width. */ nuclear@0: /* */ nuclear@0: typedef struct FT_GlyphRec_ nuclear@0: { nuclear@0: FT_Library library; nuclear@0: const FT_Glyph_Class* clazz; nuclear@0: FT_Glyph_Format format; nuclear@0: FT_Vector advance; nuclear@0: nuclear@0: } FT_GlyphRec; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_BitmapGlyph */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A handle to an object used to model a bitmap glyph image. This is */ nuclear@0: /* a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec. */ nuclear@0: /* */ nuclear@0: typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Struct> */ nuclear@0: /* FT_BitmapGlyphRec */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A structure used for bitmap glyph images. This really is a */ nuclear@0: /* `sub-class' of @FT_GlyphRec. */ nuclear@0: /* */ nuclear@0: /* <Fields> */ nuclear@0: /* root :: The root @FT_Glyph fields. */ nuclear@0: /* */ nuclear@0: /* left :: The left-side bearing, i.e., the horizontal distance */ nuclear@0: /* from the current pen position to the left border of the */ nuclear@0: /* glyph bitmap. */ nuclear@0: /* */ nuclear@0: /* top :: The top-side bearing, i.e., the vertical distance from */ nuclear@0: /* the current pen position to the top border of the glyph */ nuclear@0: /* bitmap. This distance is positive for upwards~y! */ nuclear@0: /* */ nuclear@0: /* bitmap :: A descriptor for the bitmap. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have */ nuclear@0: /* `glyph->format == FT_GLYPH_FORMAT_BITMAP'. This lets you access */ nuclear@0: /* the bitmap's contents easily. */ nuclear@0: /* */ nuclear@0: /* The corresponding pixel buffer is always owned by @FT_BitmapGlyph */ nuclear@0: /* and is thus created and destroyed with it. */ nuclear@0: /* */ nuclear@0: typedef struct FT_BitmapGlyphRec_ nuclear@0: { nuclear@0: FT_GlyphRec root; nuclear@0: FT_Int left; nuclear@0: FT_Int top; nuclear@0: FT_Bitmap bitmap; nuclear@0: nuclear@0: } FT_BitmapGlyphRec; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Type> */ nuclear@0: /* FT_OutlineGlyph */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A handle to an object used to model an outline glyph image. This */ nuclear@0: /* is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */ nuclear@0: /* */ nuclear@0: typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Struct> */ nuclear@0: /* FT_OutlineGlyphRec */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A structure used for outline (vectorial) glyph images. This */ nuclear@0: /* really is a `sub-class' of @FT_GlyphRec. */ nuclear@0: /* */ nuclear@0: /* <Fields> */ nuclear@0: /* root :: The root @FT_Glyph fields. */ nuclear@0: /* */ nuclear@0: /* outline :: A descriptor for the outline. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have */ nuclear@0: /* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */ nuclear@0: /* the outline's content easily. */ nuclear@0: /* */ nuclear@0: /* As the outline is extracted from a glyph slot, its coordinates are */ nuclear@0: /* expressed normally in 26.6 pixels, unless the flag */ nuclear@0: /* @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */ nuclear@0: /* */ nuclear@0: /* The outline's tables are always owned by the object and are */ nuclear@0: /* destroyed with it. */ nuclear@0: /* */ nuclear@0: typedef struct FT_OutlineGlyphRec_ nuclear@0: { nuclear@0: FT_GlyphRec root; nuclear@0: FT_Outline outline; nuclear@0: nuclear@0: } FT_OutlineGlyphRec; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Get_Glyph */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A function used to extract a glyph image from a slot. Note that */ nuclear@0: /* the created @FT_Glyph object must be released with @FT_Done_Glyph. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* slot :: A handle to the source glyph slot. */ nuclear@0: /* */ nuclear@0: /* <Output> */ nuclear@0: /* aglyph :: A handle to the glyph object. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code. 0~means success. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_Get_Glyph( FT_GlyphSlot slot, nuclear@0: FT_Glyph *aglyph ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Glyph_Copy */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A function used to copy a glyph image. Note that the created */ nuclear@0: /* @FT_Glyph object must be released with @FT_Done_Glyph. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* source :: A handle to the source glyph object. */ nuclear@0: /* */ nuclear@0: /* <Output> */ nuclear@0: /* target :: A handle to the target glyph object. 0~in case of */ nuclear@0: /* error. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code. 0~means success. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_Glyph_Copy( FT_Glyph source, nuclear@0: FT_Glyph *target ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Glyph_Transform */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Transform a glyph image if its format is scalable. */ nuclear@0: /* */ nuclear@0: /* <InOut> */ nuclear@0: /* glyph :: A handle to the target glyph object. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* matrix :: A pointer to a 2x2 matrix to apply. */ nuclear@0: /* */ nuclear@0: /* delta :: A pointer to a 2d vector to apply. Coordinates are */ nuclear@0: /* expressed in 1/64th of a pixel. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code (if not 0, the glyph format is not scalable). */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* The 2x2 transformation matrix is also applied to the glyph's */ nuclear@0: /* advance vector. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_Glyph_Transform( FT_Glyph glyph, nuclear@0: FT_Matrix* matrix, nuclear@0: FT_Vector* delta ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Enum> */ nuclear@0: /* FT_Glyph_BBox_Mode */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* The mode how the values of @FT_Glyph_Get_CBox are returned. */ nuclear@0: /* */ nuclear@0: /* <Values> */ nuclear@0: /* FT_GLYPH_BBOX_UNSCALED :: */ nuclear@0: /* Return unscaled font units. */ nuclear@0: /* */ nuclear@0: /* FT_GLYPH_BBOX_SUBPIXELS :: */ nuclear@0: /* Return unfitted 26.6 coordinates. */ nuclear@0: /* */ nuclear@0: /* FT_GLYPH_BBOX_GRIDFIT :: */ nuclear@0: /* Return grid-fitted 26.6 coordinates. */ nuclear@0: /* */ nuclear@0: /* FT_GLYPH_BBOX_TRUNCATE :: */ nuclear@0: /* Return coordinates in integer pixels. */ nuclear@0: /* */ nuclear@0: /* FT_GLYPH_BBOX_PIXELS :: */ nuclear@0: /* Return grid-fitted pixel coordinates. */ nuclear@0: /* */ nuclear@0: typedef enum FT_Glyph_BBox_Mode_ nuclear@0: { nuclear@0: FT_GLYPH_BBOX_UNSCALED = 0, nuclear@0: FT_GLYPH_BBOX_SUBPIXELS = 0, nuclear@0: FT_GLYPH_BBOX_GRIDFIT = 1, nuclear@0: FT_GLYPH_BBOX_TRUNCATE = 2, nuclear@0: FT_GLYPH_BBOX_PIXELS = 3 nuclear@0: nuclear@0: } FT_Glyph_BBox_Mode; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Enum> */ nuclear@0: /* ft_glyph_bbox_xxx */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* These constants are deprecated. Use the corresponding */ nuclear@0: /* @FT_Glyph_BBox_Mode values instead. */ nuclear@0: /* */ nuclear@0: /* <Values> */ nuclear@0: /* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */ nuclear@0: /* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */ nuclear@0: /* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */ nuclear@0: /* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */ nuclear@0: /* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */ nuclear@0: /* */ nuclear@0: #define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED nuclear@0: #define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS nuclear@0: #define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT nuclear@0: #define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE nuclear@0: #define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Glyph_Get_CBox */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Return a glyph's `control box'. The control box encloses all the */ nuclear@0: /* outline's points, including Bézier control points. Though it */ nuclear@0: /* coincides with the exact bounding box for most glyphs, it can be */ nuclear@0: /* slightly larger in some situations (like when rotating an outline */ nuclear@0: /* which contains Bézier outside arcs). */ nuclear@0: /* */ nuclear@0: /* Computing the control box is very fast, while getting the bounding */ nuclear@0: /* box can take much more time as it needs to walk over all segments */ nuclear@0: /* and arcs in the outline. To get the latter, you can use the */ nuclear@0: /* `ftbbox' component which is dedicated to this single task. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* glyph :: A handle to the source glyph object. */ nuclear@0: /* */ nuclear@0: /* mode :: The mode which indicates how to interpret the returned */ nuclear@0: /* bounding box values. */ nuclear@0: /* */ nuclear@0: /* <Output> */ nuclear@0: /* acbox :: The glyph coordinate bounding box. Coordinates are */ nuclear@0: /* expressed in 1/64th of pixels if it is grid-fitted. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* Coordinates are relative to the glyph origin, using the y~upwards */ nuclear@0: /* convention. */ nuclear@0: /* */ nuclear@0: /* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */ nuclear@0: /* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */ nuclear@0: /* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */ nuclear@0: /* is another name for this constant. */ nuclear@0: /* */ nuclear@0: /* Note that the maximum coordinates are exclusive, which means that */ nuclear@0: /* one can compute the width and height of the glyph image (be it in */ nuclear@0: /* integer or 26.6 pixels) as: */ nuclear@0: /* */ nuclear@0: /* { */ nuclear@0: /* width = bbox.xMax - bbox.xMin; */ nuclear@0: /* height = bbox.yMax - bbox.yMin; */ nuclear@0: /* } */ nuclear@0: /* */ nuclear@0: /* Note also that for 26.6 coordinates, if `bbox_mode' is set to */ nuclear@0: /* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted, */ nuclear@0: /* which corresponds to: */ nuclear@0: /* */ nuclear@0: /* { */ nuclear@0: /* bbox.xMin = FLOOR(bbox.xMin); */ nuclear@0: /* bbox.yMin = FLOOR(bbox.yMin); */ nuclear@0: /* bbox.xMax = CEILING(bbox.xMax); */ nuclear@0: /* bbox.yMax = CEILING(bbox.yMax); */ nuclear@0: /* } */ nuclear@0: /* */ nuclear@0: /* To get the bbox in pixel coordinates, set `bbox_mode' to */ nuclear@0: /* @FT_GLYPH_BBOX_TRUNCATE. */ nuclear@0: /* */ nuclear@0: /* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */ nuclear@0: /* to @FT_GLYPH_BBOX_PIXELS. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( void ) nuclear@0: FT_Glyph_Get_CBox( FT_Glyph glyph, nuclear@0: FT_UInt bbox_mode, nuclear@0: FT_BBox *acbox ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Glyph_To_Bitmap */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Convert a given glyph object to a bitmap glyph object. */ nuclear@0: /* */ nuclear@0: /* <InOut> */ nuclear@0: /* the_glyph :: A pointer to a handle to the target glyph. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* render_mode :: An enumeration that describes how the data is */ nuclear@0: /* rendered. */ nuclear@0: /* */ nuclear@0: /* origin :: A pointer to a vector used to translate the glyph */ nuclear@0: /* image before rendering. Can be~0 (if no */ nuclear@0: /* translation). The origin is expressed in */ nuclear@0: /* 26.6 pixels. */ nuclear@0: /* */ nuclear@0: /* destroy :: A boolean that indicates that the original glyph */ nuclear@0: /* image should be destroyed by this function. It is */ nuclear@0: /* never destroyed in case of error. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code. 0~means success. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* This function does nothing if the glyph format isn't scalable. */ nuclear@0: /* */ nuclear@0: /* The glyph image is translated with the `origin' vector before */ nuclear@0: /* rendering. */ nuclear@0: /* */ nuclear@0: /* The first parameter is a pointer to an @FT_Glyph handle, that will */ nuclear@0: /* be _replaced_ by this function (with newly allocated data). */ nuclear@0: /* Typically, you would use (omitting error handling): */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* { */ nuclear@0: /* FT_Glyph glyph; */ nuclear@0: /* FT_BitmapGlyph glyph_bitmap; */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* // load glyph */ nuclear@0: /* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */ nuclear@0: /* */ nuclear@0: /* // extract glyph image */ nuclear@0: /* error = FT_Get_Glyph( face->glyph, &glyph ); */ nuclear@0: /* */ nuclear@0: /* // convert to a bitmap (default render mode + destroying old) */ nuclear@0: /* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */ nuclear@0: /* { */ nuclear@0: /* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, */ nuclear@0: /* 0, 1 ); */ nuclear@0: /* if ( error ) // `glyph' unchanged */ nuclear@0: /* ... */ nuclear@0: /* } */ nuclear@0: /* */ nuclear@0: /* // access bitmap content by typecasting */ nuclear@0: /* glyph_bitmap = (FT_BitmapGlyph)glyph; */ nuclear@0: /* */ nuclear@0: /* // do funny stuff with it, like blitting/drawing */ nuclear@0: /* ... */ nuclear@0: /* */ nuclear@0: /* // discard glyph image (bitmap or not) */ nuclear@0: /* FT_Done_Glyph( glyph ); */ nuclear@0: /* } */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* Here another example, again without error handling: */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* { */ nuclear@0: /* FT_Glyph glyphs[MAX_GLYPHS] */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* ... */ nuclear@0: /* */ nuclear@0: /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ nuclear@0: /* error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || */ nuclear@0: /* FT_Get_Glyph ( face->glyph, &glyph[idx] ); */ nuclear@0: /* */ nuclear@0: /* ... */ nuclear@0: /* */ nuclear@0: /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ nuclear@0: /* { */ nuclear@0: /* FT_Glyph bitmap = glyphs[idx]; */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* ... */ nuclear@0: /* */ nuclear@0: /* // after this call, `bitmap' no longer points into */ nuclear@0: /* // the `glyphs' array (and the old value isn't destroyed) */ nuclear@0: /* FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); */ nuclear@0: /* */ nuclear@0: /* ... */ nuclear@0: /* */ nuclear@0: /* FT_Done_Glyph( bitmap ); */ nuclear@0: /* } */ nuclear@0: /* */ nuclear@0: /* ... */ nuclear@0: /* */ nuclear@0: /* for ( idx = 0; i < MAX_GLYPHS; i++ ) */ nuclear@0: /* FT_Done_Glyph( glyphs[idx] ); */ nuclear@0: /* } */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_Glyph_To_Bitmap( FT_Glyph* the_glyph, nuclear@0: FT_Render_Mode render_mode, nuclear@0: FT_Vector* origin, nuclear@0: FT_Bool destroy ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Done_Glyph */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Destroy a given glyph. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* glyph :: A handle to the target glyph object. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( void ) nuclear@0: FT_Done_Glyph( FT_Glyph glyph ); nuclear@0: nuclear@0: /* */ nuclear@0: nuclear@0: nuclear@0: /* other helpful functions */ nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Section> */ nuclear@0: /* computations */ nuclear@0: /* */ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Matrix_Multiply */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Perform the matrix operation `b = a*b'. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* a :: A pointer to matrix `a'. */ nuclear@0: /* */ nuclear@0: /* <InOut> */ nuclear@0: /* b :: A pointer to matrix `b'. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* The result is undefined if either `a' or `b' is zero. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( void ) nuclear@0: FT_Matrix_Multiply( const FT_Matrix* a, nuclear@0: FT_Matrix* b ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Matrix_Invert */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Invert a 2x2 matrix. Return an error if it can't be inverted. */ nuclear@0: /* */ nuclear@0: /* <InOut> */ nuclear@0: /* matrix :: A pointer to the target matrix. Remains untouched in */ nuclear@0: /* case of error. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code. 0~means success. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_Matrix_Invert( FT_Matrix* matrix ); nuclear@0: nuclear@0: nuclear@0: /* */ nuclear@0: nuclear@0: nuclear@0: FT_END_HEADER nuclear@0: nuclear@0: #endif /* __FTGLYPH_H__ */ nuclear@0: nuclear@0: nuclear@0: /* END */ nuclear@0: nuclear@0: nuclear@0: /* Local Variables: */ nuclear@0: /* coding: utf-8 */ nuclear@0: /* End: */