Data Structures | |
struct | Glyph |
struct | pgeFont |
Enumerations | |
enum | pgeFontSizeType { PGE_FONT_SIZE_PIXELS = 0, PGE_FONT_SIZE_POINTS } |
Functions | |
int | pgeFontInit (void) |
void | pgeFontShutdown (void) |
pgeFont * | pgeFontLoad (const char *filename, unsigned int fontsize, enum pgeFontSizeType fontsizetype, enum pgeMemoryLocation location) |
pgeFont * | pgeFontLoadMemory (unsigned char *data, int datasize, unsigned int fontsize, enum pgeFontSizeType fontsizetype, enum pgeMemoryLocation location) |
void | pgeFontDestroy (pgeFont *font) |
void | pgeFontActivate (pgeFont *font) |
int | pgeFontPrintf (pgeFont *font, short x, short y, unsigned int color, const char *text,...) |
int | pgeFontPrintfCenter (pgeFont *font, short y, unsigned int color, const char *text,...) |
int | pgeFontMeasureText (pgeFont *font, const char *text) |
int | pgeFontMeasureFormattedText (pgeFont *font, const char *text,...) |
int | pgeFontGetHeight (pgeFont *font) |
enum pgeFontSizeType |
void pgeFontActivate | ( | pgeFont * | font | ) |
int pgeFontGetHeight | ( | pgeFont * | font | ) |
Get the maximum height of any glyph
font | - A valid pgeFont |
int pgeFontInit | ( | void | ) |
Initialise the Font library
pgeFont* pgeFontLoad | ( | const char * | filename, | |
unsigned int | fontsize, | |||
enum pgeFontSizeType | fontsizetype, | |||
enum pgeMemoryLocation | location | |||
) |
Load a TrueType font.
filename | - Path to the font | |
fontsize | - Size to set the font to | |
fontsizetype | - One of pgeFontSizeType | |
location | - One of pgeTextureLocation |
pgeFont* pgeFontLoadMemory | ( | unsigned char * | data, | |
int | datasize, | |||
unsigned int | fontsize, | |||
enum pgeFontSizeType | fontsizetype, | |||
enum pgeMemoryLocation | location | |||
) |
Load a TrueType font from memory.
data | - Pointer to the start of the memory buffer. | |
datasize | - Size of the buffer | |
fontsize | - Size to set the font to | |
fontsizetype | - One of pgeFontSizeType | |
location | - One of pgeTextureLocation |
int pgeFontMeasureFormattedText | ( | pgeFont * | font, | |
const char * | text, | |||
... | ||||
) |
Measure a length of formatted text if it were to be drawn
font | - A valid pgeFont | |
text | - Text to measure |
int pgeFontMeasureText | ( | pgeFont * | font, | |
const char * | text | |||
) |
Measure a length of text if it were to be drawn
font | - A valid pgeFont | |
text | - Text to measure |
int pgeFontPrintf | ( | pgeFont * | font, | |
short | x, | |||
short | y, | |||
unsigned int | color, | |||
const char * | text, | |||
... | ||||
) |
Draw text along the baseline starting at x, y (with formatting).
font | - A valid pgeFont | |
x | - X position on screen | |
y | - Y position on screen | |
color | - Text color | |
text | - Text to draw |
int pgeFontPrintfCenter | ( | pgeFont * | font, | |
short | y, | |||
unsigned int | color, | |||
const char * | text, | |||
... | ||||
) |
Draw centred text along the baseline (with formatting).
font | - A valid pgeFont | |
x | - X position on screen | |
y | - Y position on screen | |
color | - Text color | |
text | - Text to draw |
void pgeFontShutdown | ( | void | ) |
Shutdown the Font library