src/fontcache.h
changeset 10056 48659f7d4fa5
parent 9111 48ce04029fe4
child 10367 0098392a5560
equal deleted inserted replaced
10055:b3bf982d7879 10056:48659f7d4fa5
    44 /** Get the Sprite for a glyph */
    44 /** Get the Sprite for a glyph */
    45 static inline const Sprite *GetGlyph(FontSize size, uint32 key)
    45 static inline const Sprite *GetGlyph(FontSize size, uint32 key)
    46 {
    46 {
    47 	SpriteID sprite = GetUnicodeGlyph(size, key);
    47 	SpriteID sprite = GetUnicodeGlyph(size, key);
    48 	if (sprite == 0) sprite = GetUnicodeGlyph(size, '?');
    48 	if (sprite == 0) sprite = GetUnicodeGlyph(size, '?');
    49 	return GetSprite(sprite);
    49 	return GetSprite(sprite, ST_FONT);
    50 }
    50 }
    51 
    51 
    52 
    52 
    53 /** Get the width of a glyph */
    53 /** Get the width of a glyph */
    54 static inline uint GetGlyphWidth(FontSize size, uint32 key)
    54 static inline uint GetGlyphWidth(FontSize size, uint32 key)
    55 {
    55 {
    56 	SpriteID sprite = GetUnicodeGlyph(size, key);
    56 	SpriteID sprite = GetUnicodeGlyph(size, key);
    57 	if (sprite == 0) sprite = GetUnicodeGlyph(size, '?');
    57 	if (sprite == 0) sprite = GetUnicodeGlyph(size, '?');
    58 	return SpriteExists(sprite) ? GetSprite(sprite)->width + (size != FS_NORMAL) : 0;
    58 	return SpriteExists(sprite) ? GetSprite(sprite, ST_FONT)->width + (size != FS_NORMAL) : 0;
    59 }
    59 }
    60 
    60 
    61 #endif /* WITH_FREETYPE */
    61 #endif /* WITH_FREETYPE */
    62 
    62 
    63 #endif /* FONTCACHE_H */
    63 #endif /* FONTCACHE_H */