409 {
410
411 ((ObjectInterface *) clazz->interface)->dealloc =
dealloc;
412 ((ObjectInterface *) clazz->interface)->hash =
hash;
413 ((ObjectInterface *) clazz->interface)->isEqual =
isEqual;
414
415 ((FontInterface *) clazz->interface)->cacheFont =
cacheFont;
416 ((FontInterface *) clazz->interface)->clearCache =
clearCache;
417 ((FontInterface *) clazz->interface)->defaultFont =
defaultFont;
422 ((FontInterface *) clazz->interface)->
name =
name;
428 ((FontInterface *) clazz->interface)->sizeCharacters =
sizeCharacters;
429
430 const bool init = TTF_Init();
433
434 _cache = $$(Dictionary, dictionary);
436
437 Data *coda = $(alloc(Data), initWithConstMemory, coda_ttf, coda_ttf_len - 1);
438 assert(coda);
440 release(coda);
441
442 Data *shareTechMono = $(alloc(Data), initWithConstMemory, shareTechMono_ttf, shareTechMono_ttf_len - 1);
443 assert(shareTechMono);
445 release(shareTechMono);
446}
static View * init(View *self)
void renderCharactersBitmap(Font *self, const Renderer *renderer, const char *chars, SDL_Color color, int wrapWidth, const SDL_Point *origin, const ImageAtlas *icons)
Implements Font::renderBitmapCharacters.
void renderDeviceWillResetBitmap(Font *self)
Implements Font::renderDeviceWillReset.
void sizeCharactersBitmap(const Font *self, const char *chars, int wrapWidth, const ImageAtlas *icons, int *w, int *h)
Implements Font::sizeBitmapCharacters.
static void sizeCharacters(const Font *self, const char *chars, int *w, int *h)
static SDL_Surface * renderCharacters(const Font *self, const char *chars, SDL_Color color, int wrapWidth)
static void clearCache(void)
static String * nameWithAttributes(const FontAttributes *attributes)
static Font * fontWithName(const char *name, float pixelDensity)
static Font * defaultMonospaceFont(void)
static bool isEqual(const Object *self, const Object *other)
static void cacheFont(Data *data, const char *family)
Font * defaultMonospaceFont(void)
Font * initWithData(Font *self, Data *data, const FontAttributes *attributes, float pixelDensity)
Initializes this Font with the given TTF Data and attributes.
Font * fontWithName(const char *name, float pixelDensity)
Resolves a Font from a name in the format produced by Font::name.
Font * fontWithAttributes(const FontAttributes *attributes, float pixelDensity)
Resolves a new Font with the given attributes from the cached font Data.
String * name(const Font *self)