Add one more example to the documentation of FT_Glyph_To_Bitmap.

This commit is contained in:
Werner Lemberg 2008-08-06 09:09:41 +00:00
parent 293a877a99
commit da32d7054d
3 changed files with 39 additions and 4 deletions

View File

@ -2597,7 +2597,7 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Copyright 2000, 2001, 2002, 2007, 2008 by Copyright 2000, 2001, 2002, 2007 by
David Turner, Robert Wilhelm, and Werner Lemberg. David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified, This file is part of the FreeType project, and may only be used, modified,

View File

@ -444,6 +444,8 @@ FT_BEGIN_HEADER
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* This function does nothing if the glyph format isn't scalable. */
/* */
/* The glyph image is translated with the `origin' vector before */ /* The glyph image is translated with the `origin' vector before */
/* rendering. */ /* rendering. */
/* */ /* */
@ -483,7 +485,42 @@ FT_BEGIN_HEADER
/* } */ /* } */
/* */ /* */
/* */ /* */
/* This function does nothing if the glyph format isn't scalable. */ /* Here another example, again without error handling: */
/* */
/* */
/* { */
/* 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_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Glyph_To_Bitmap( FT_Glyph* the_glyph, FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,

View File

@ -426,9 +426,7 @@
} }
#ifdef FT_DEBUG_LEVEL_TRACE #ifdef FT_DEBUG_LEVEL_TRACE
else else
{
FT_TRACE4(( "glyph index %d:\n", glyph_index )); FT_TRACE4(( "glyph index %d:\n", glyph_index ));
}
#endif #endif
decoder->num_locals = sub->num_local_subrs; decoder->num_locals = sub->num_local_subrs;