26#include <SDL3_ttf/SDL_ttf.h>
28#include <Objectively/Enum.h>
29#include <Objectively/Array.h>
30#include <Objectively/Data.h>
34#define DEFAULT_FONT_FAMILY "Coda"
35#define DEFAULT_FONT_SIZE 16
36#define DEFAULT_FONT_STYLE FontStyleRegular
57typedef struct FontInterface FontInterface;
116struct FontInterface {
121 ObjectInterface objectInterface;
133 Font *(*cachedFont)(
const char *family,
int size,
int style);
150 void (*clearCache)(void);
158 Font *(*defaultFont)(void);
171 Font *(*initWithData)(
Font *self, Data *data,
const char *family,
int size,
int style);
183 SDL_Surface *(*renderCharacters)(
const Font *self,
const char *chars, SDL_Color color,
int wrapWidth);
192 void (*renderDeviceDidReset)(
Font *self);
204 void (*sizeCharacters)(
const Font *self,
const char *chars,
int *w,
int *h);
static void cacheFont(Data *data, const char *family)
OBJECTIVELYMVC_EXPORT const EnumName FontStyleNames[]
OBJECTIVELYMVC_EXPORT Class * _Font(void)
static SDL_Size size(const Image *self)
ObjectivelyMVC base types.
#define OBJECTIVELYMVC_EXPORT
FontInterface * interface
The interface.
float scale
The display pixel density scale (e.g. 2.0 on Retina). Updated by callers via the scale field before i...
int renderSize
The render size, adjusted for display density.
char * family
The family name.
TTF_Font * font
The backing font.
Data * data
The raw font data.
Object object
The superclass.