ObjectivelyMVC 0.1.0
Object oriented MVC framework for OpenGL, SDL2 and GNU C
|
TrueType fonts. More...
#include <Font.h>
Public Member Functions | |
Class * | _Font (void) |
The Font archetype. More... | |
Font * | cachedFont (const char *family, int size, int style) |
Resolves the cached Font with the given attributes. More... | |
void | cacheFont (Data *data, const char *family) |
void | clearCache (void) |
Clears the Font cache. More... | |
Font * | defaultFont (void) |
Font * | initWithData (Font *self, Data *data, const char *family, int size, int style) |
Initializes this Font with the given TTF Data and attributes. More... | |
Font * | initWithData (Font *self, Data *data, int size, int index) |
void | renderCharacters (const Font *self, const char *chars, SDL_Color color, int wrapWidth) |
Renders the given characters in this Font. More... | |
void | renderDeviceDidReset (Font *self) |
This method should be invoked when the render context is invalidated. More... | |
void | sizeCharacters (const Font *self, const char *chars, int *w, int *h) |
Data Fields | |
Data * | data |
The raw font data. More... | |
char * | family |
The family name. More... | |
ident | font |
The backing font. More... | |
Object | object |
The superclass. More... | |
int | renderSize |
The render size, adjusted for display density. More... | |
int | size |
The point size. More... | |
int | style |
The style. More... | |
Static Public Attributes | |
void(* | cacheFont )(Data *data, const char *family) |
Caches the specified font Data. More... | |
Protected Attributes | |
FontInterface * | interface |
The interface. More... | |
Class * _Font | ( | void | ) |
The Font archetype.
Definition at line 353 of file Font.c.
Font * cachedFont | ( | const char * | family, |
int | size, | ||
int | style | ||
) |
Resolves the cached Font with the given attributes.
family | The family. |
size | The size. |
style | The style. |
Definition at line 124 of file Font.c.
void cacheFont | ( | Data * | data, |
const char * | family | ||
) |
void clearCache | ( | void | ) |
Font * defaultFont | ( | void | ) |
omg *
Definition at line 178 of file Font.c.
Initializes this Font with the given TTF Data and attributes.
self | The Font. |
data | The Data. |
family | The family. |
size | The size. |
style | The style. |
NULL
on error. Definition at line 197 of file Font.c.
void renderCharacters | ( | const Font * | self, |
const char * | chars, | ||
SDL_Color | color, | ||
int | wrapWidth | ||
) |
Renders the given characters in this Font.
self | The Font. |
chars | The null-terminated UTF-8 encoded C string to render. |
color | The color. |
wrapWidth | The maximum line width, in pixels, where wrapping should occur. |
NULL
on error. Definition at line 223 of file Font.c.
void renderDeviceDidReset | ( | Font * | self | ) |
void sizeCharacters | ( | const Font * | self, |
const char * | chars, | ||
int * | w, | ||
int * | h | ||
) |
self | The Font. |
chars | The null-terminated UTF-8 encoded C string to size. |
w | The width to return. |
h | The height to return. |
Definition at line 272 of file Font.c.
int Font::renderSize |