diff options
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/docs/reference/ft2-glyph_management.html')
-rw-r--r-- | Build/source/libs/freetype2/freetype-src/docs/reference/ft2-glyph_management.html | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/docs/reference/ft2-glyph_management.html b/Build/source/libs/freetype2/freetype-src/docs/reference/ft2-glyph_management.html index cf0fb0b8a16..30f789f60a4 100644 --- a/Build/source/libs/freetype2/freetype-src/docs/reference/ft2-glyph_management.html +++ b/Build/source/libs/freetype2/freetype-src/docs/reference/ft2-glyph_management.html @@ -3,7 +3,7 @@ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> -<title>FreeType-2.6.3 API Reference</title> +<title>FreeType-2.6.4 API Reference</title> <style type="text/css"> a:link { color: #0000EF; } a:visited { color: #51188E; } @@ -100,7 +100,7 @@ <body> <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table> -<h1>FreeType-2.6.3 API Reference</h1> +<h1>FreeType-2.6.4 API Reference</h1> <h1 id="glyph_management">Glyph Management</h1> <h2>Synopsis</h2> @@ -444,15 +444,15 @@ <p>If the font is tricky and the glyph has been loaded with <a href="ft2-base_interface.html#FT_LOAD_XXX">FT_LOAD_NO_SCALE</a>, the resulting CBox is meaningless. To get reasonable values for the CBox it is necessary to load the glyph at a large ppem value (so that the hinting instructions can properly shift and scale the subglyphs), then extracting the CBox, which can be eventually converted back to font units.</p> <p>Note that the maximum coordinates are exclusive, which means that one can compute the width and height of the glyph image (be it in integer or 26.6 pixels) as:</p> <pre class="colored"> - width = bbox.xMax - bbox.xMin; - height = bbox.yMax - bbox.yMin; + width = bbox.xMax - bbox.xMin; + height = bbox.yMax - bbox.yMin; </pre> <p>Note also that for 26.6 coordinates, if ‘bbox_mode’ is set to <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_GRIDFIT</a>, the coordinates will also be grid-fitted, which corresponds to:</p> <pre class="colored"> - bbox.xMin = FLOOR(bbox.xMin); - bbox.yMin = FLOOR(bbox.yMin); - bbox.xMax = CEILING(bbox.xMax); - bbox.yMax = CEILING(bbox.yMax); + bbox.xMin = FLOOR(bbox.xMin); + bbox.yMin = FLOOR(bbox.yMin); + bbox.xMax = CEILING(bbox.xMax); + bbox.yMax = CEILING(bbox.yMax); </pre> <p>To get the bbox in pixel coordinates, set ‘bbox_mode’ to <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_TRUNCATE</a>.</p> <p>To get the bbox in grid-fitted pixel coordinates, set ‘bbox_mode’ to <a href="ft2-glyph_management.html#FT_Glyph_BBox_Mode">FT_GLYPH_BBOX_PIXELS</a>.</p> @@ -502,69 +502,69 @@ <p>The first parameter is a pointer to an <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> handle, that will be <i>replaced</i> by this function (with newly allocated data). Typically, you would use (omitting error handling):</p> <p></p> <pre class="colored"> - FT_Glyph glyph; - FT_BitmapGlyph glyph_bitmap; - - - // load glyph - error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); - - // extract glyph image - error = FT_Get_Glyph( face->glyph, &glyph ); - - // convert to a bitmap (default render mode + destroying old) - if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) - { - error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, - 0, 1 ); - if ( error ) // `glyph' unchanged - ... - } - - // access bitmap content by typecasting - glyph_bitmap = (FT_BitmapGlyph)glyph; - - // do funny stuff with it, like blitting/drawing - ... - - // discard glyph image (bitmap or not) - FT_Done_Glyph( glyph ); + FT_Glyph glyph; + FT_BitmapGlyph glyph_bitmap; + + + // load glyph + error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); + + // extract glyph image + error = FT_Get_Glyph( face->glyph, &glyph ); + + // convert to a bitmap (default render mode + destroying old) + if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) + { + error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, + 0, 1 ); + if ( error ) // `glyph' unchanged + ... + } + + // access bitmap content by typecasting + glyph_bitmap = (FT_BitmapGlyph)glyph; + + // do funny stuff with it, like blitting/drawing + ... + + // discard glyph image (bitmap or not) + FT_Done_Glyph( glyph ); </pre> <p></p> <p>Here another example, again without error handling:</p> <p></p> <pre class="colored"> - FT_Glyph glyphs[MAX_GLYPHS] - - - ... - - for ( idx = 0; i < MAX_GLYPHS; i++ ) - error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || - FT_Get_Glyph ( face->glyph, &glyph[idx] ); - - ... - - for ( idx = 0; i < MAX_GLYPHS; i++ ) - { - FT_Glyph bitmap = glyphs[idx]; - - - ... - - // after this call, `bitmap' no longer points into - // the `glyphs' array (and the old value isn't destroyed) - FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); - - ... - - FT_Done_Glyph( bitmap ); - } - - ... - - for ( idx = 0; i < MAX_GLYPHS; i++ ) - FT_Done_Glyph( glyphs[idx] ); + FT_Glyph glyphs[MAX_GLYPHS] + + + ... + + for ( idx = 0; i < MAX_GLYPHS; i++ ) + error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || + FT_Get_Glyph ( face->glyph, &glyph[idx] ); + + ... + + for ( idx = 0; i < MAX_GLYPHS; i++ ) + { + FT_Glyph bitmap = glyphs[idx]; + + + ... + + // after this call, `bitmap' no longer points into + // the `glyphs' array (and the old value isn't destroyed) + FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); + + ... + + FT_Done_Glyph( bitmap ); + } + + ... + + for ( idx = 0; i < MAX_GLYPHS; i++ ) + FT_Done_Glyph( glyphs[idx] ); </pre> <hr> |