static void Flush_Cache(TTF_Font *font) { int i; for ( i=0; i<(sizeof font->cache)/(sizeof font->cache[0]); ++i ) { if ( font->cache[i].cached ) { Flush_Glyph(&font->cache[i]); } } if ( font->scratch.cached ) { Flush_Glyph(&font->scratch); } }
static void Flush_Cache( TTF_Font* font ) { int i; int size = sizeof( font->cache ) / sizeof( font->cache[0] ); for( i = 0; i < size; ++i ) { if( font->cache[i].cached ) { Flush_Glyph( &font->cache[i] ); } } }
static TT_Error Find_Glyph(TTF_Font *font, Uint16 ch) { int retval; retval = 0; if ( ch < 256 ) { font->current = &font->cache[ch]; } else { if ( font->scratch.cached != ch ) { Flush_Glyph(&font->scratch); } font->current = &font->scratch; } if ( ! font->current->cached ) { retval = Load_Glyph(font, ch, font->current); } return retval; }