- if( fontId > 0 &&
- fontId-1 < mFontCache.size() )
- {
- FT_Face ftFace = mFontCache[fontId-1].mFreeTypeFace;
-
- FT_Error error = FT_Load_Glyph( ftFace, glyphIndex, FT_LOAD_DEFAULT );
- if( FT_Err_Ok == error )
- {
- FT_Glyph glyph;
- error = FT_Get_Glyph( ftFace->glyph, &glyph );
-
- // Convert to bitmap if necessary
- if ( FT_Err_Ok == error )
- {
- if( glyph->format != FT_GLYPH_FORMAT_BITMAP )
- {
- error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, 0, 1 );
- }
- else
- {
- DALI_LOG_ERROR( "FT_Glyph_To_Bitmap Failed with error: %d\n", error );
- }
- }
- else
- {
- DALI_LOG_ERROR( "FT_Get_Glyph Failed with error: %d\n", error );
- }
-
- if( FT_Err_Ok == error )
- {
- // Access the underlying bitmap data
- FT_BitmapGlyph bitmapGlyph = (FT_BitmapGlyph)glyph;
- ConvertBitmap( bitmap, bitmapGlyph->bitmap );
- }
-
- // Created FT_Glyph object must be released with FT_Done_Glyph
- FT_Done_Glyph( glyph );
- }
- else
- {
- DALI_LOG_ERROR( "FT_Load_Glyph Failed with error: %d\n", error );
- }
- }