26#include <SDL3_ttf/SDL_ttf.h>
28#include <Objectively/Enum.h>
29#include <Objectively/Array.h>
30#include <Objectively/Data.h>
31#include <Objectively/String.h>
36#define DEFAULT_FONT_FAMILY "Coda"
37#define DEFAULT_FONT_SIZE 16
38#define DEFAULT_FONT_STYLE FontStyleRegular
40#define DEFAULT_MONOSPACE_FONT_FAMILY "Share Tech Mono"
82typedef struct FontInterface FontInterface;
129 char *iconPlaceholder;
155struct FontInterface {
160 ObjectInterface objectInterface;
177 void (*clearCache)(void);
187 Font *(*defaultFont)(void);
197 Font *(*defaultMonospaceFont)(void);
211 Font *(*fontWithName)(
const char *name,
float pixelDensity);
253 String *(*name)(
const Font *self);
276 void (*renderBitmapCharacters)(
Font *self,
const Renderer *renderer,
const char *chars, SDL_Color color,
int wrapWidth,
const SDL_Point *origin,
const ImageAtlas *
icons);
288 SDL_Surface *(*renderCharacters)(
const Font *self,
const char *chars, SDL_Color color,
int wrapWidth);
297 void (*renderDeviceWillReset)(
Font *self);
310 void (*sizeBitmapCharacters)(
const Font *self,
const char *chars,
int wrapWidth,
const ImageAtlas *
icons,
int *w,
int *h);
322 void (*sizeCharacters)(
const Font *self,
const char *chars,
int *w,
int *h);
Fixed-width Fonts baked into a glyph sheet, drawn as one quad per glyph.
static void cacheFont(Data *data, const char *family)
OBJECTIVELYMVC_EXPORT const EnumName FontStyleNames[]
OBJECTIVELYMVC_EXPORT Class * _Font(void)
static ImageAtlas * icons(Theme *self)
ObjectivelyMVC base types.
#define OBJECTIVELYMVC_EXPORT
The family, size and style attributes that identify a Font, independent of the pixel density at which...
const char * family
The family, or NULL for the default.
int style
The FontStyle, or -1 for the default.
int size
The point size, or 0 for the default.
A fixed-width Font's glyphs, baked into one sheet, drawn as one quad per glyph.
float pixelDensity
The display pixel density scale, greater than 1.0 on high-density displays.
FontInterface * interface[0]
The interface type.
int renderSize
The render size, adjusted for pixel density.
char * family
The family name.
FontBitmap bitmap
The glyphs of a fixed-width Font, baked into one sheet; bitmap.surface is NULL for a proportional Fon...
TTF_Font * font
The backing font.
Data * data
The raw font data.
Object object
The superclass.
Packs many Images into one sheet, backed by one Texture.
Renderer extends Object with ObjectivelyMVC's UI rendering layer.