iOS/buildlibs/armv7/allegro-4.4.2/addons/allegrogl/src/fontconv.c
/* agl_char_length_fractional:
 * Returns the width, in fractional pixels of the given character.
 */
Returns the width, in fractional pixels of the given character.
Returns the width in fractional pixels of the given character .
static float agl_char_length_fractional(const FONT *f, int ch) {
	FONT_AGL_DATA *fad = f->data;
	if (fad->type == AGL_FONT_TYPE_TEXTURED) {
		while (fad) {
			if (ch >= fad->start && ch < fad->end) {
				AGL_GLYPH *coords = &(fad->glyph_coords[ch - fad->start]);
				return (coords->offset_x + coords->w + coords->offset_w)
				       / fabs(fad->scale);
			}
			fad = fad->next;
		}
	}
	else if (fad->type == AGL_FONT_TYPE_BITMAP) {
		while (fad) {
			if (ch >= fad->start && ch < fad->end) {
				FONT_GLYPH **gl = fad->data;
				return gl[ch - fad->start]->w;
			}
			fad = fad->next;
		}
	}
	if (ch != allegro_404_char)
		return agl_char_length_fractional(f, allegro_404_char);
	return 0;
}
static float agl_char_length_fractional ( const FONT * f , int ch ) { FONT_AGL_DATA * fad = f -> data ; if ( fad -> type == AGL_FONT_TYPE_TEXTURED ) { while ( fad ) { if ( ch >= fad -> start && ch < fad -> end ) { AGL_GLYPH * coords = & ( fad -> glyph_coords [ ch - fad -> start ] ) ; return ( coords -> offset_x + coords -> w + coords -> offset_w ) / fabs ( fad -> scale ) ; } fad = fad -> next ; } } else if ( fad -> type == AGL_FONT_TYPE_BITMAP ) { while ( fad ) { if ( ch >= fad -> start && ch < fad -> end ) { FONT_GLYPH * * gl = fad -> data ; return gl [ ch - fad -> start ] -> w ; } fad = fad -> next ; } } if ( ch != allegro_404_char ) return agl_char_length_fractional ( f , allegro_404_char ) ; return 0 ; }
agl_char_length_fractional:
 Returns the width, in fractional pixels of the given character.
agl_char_length_fractional : Returns the width in fractional pixels of the given character .
/* if we don't find the character, then search for the missing
	 * glyph, but don't get stuck in a loop. */