openTRI 0.1
|
Data Structures | |
struct | Glyph |
A Glyph struct. More... | |
struct | triFont |
A Font struct. More... | |
Typedefs | |
typedef struct Glyph | Glyph |
A Glyph struct. | |
Functions | |
triBool | triFontInit (void) |
Initialise the Font library. | |
triVoid | triFontShutdown (void) |
Shutdown the Font library. | |
triVoid | triFontUnload (triFont *font) |
Free the specified font. | |
triFont * | triFontLoadTRF (const triChar *filename) |
Load a TRF (triFont) font. | |
triVoid | triFontSaveTRF (triFont *font, triChar *filename) |
Save the specified font to a triFont file. | |
triVoid | triFontSetMono (triFont *font, triS32 width) |
Set a font mono spaced or not (default). | |
triVoid | triFontSetSpacing (triFont *font, triS32 letter, triS32 word) |
Set a spacing values. | |
triVoid | triFontSetLineheight (triFont *font, triS32 height) |
Set line height. | |
triVoid | triFontActivate (triFont *font) |
Activate the specified font. | |
triSInt | triFontPrint (triFloat x, triFloat y, triUInt color, const triChar *text) |
Draw text along the baseline starting at x, y. | |
triSInt | triFontPrintf (triFloat x, triFloat y, triUInt color, const triChar *text,...) |
Draw text along the baseline starting at x, y (with formatting). | |
triSInt | triFontPrintAlign (triFloat x, triFloat y, triSInt width, triSInt height, triUInt color, enum triFontAlignMode align, const triChar *text) |
Draw text along the baseline aligned within the box starting at x, y. | |
triSInt | triFontPrintAlignf (triFloat x, triFloat y, triSInt width, triSInt height, triUInt color, enum triFontAlignMode align, const triChar *text,...) |
Draw text along the baseline aligned within the box starting at x, y (with formatting). | |
triSInt | triFontMeasureTextHeight (const triChar *text) |
Measure height of a text if it were to be drawn. | |
triSInt | triFontMeasureText (const triChar *text) |
Measure a length of text if it were to be drawn. | |
triSInt | triFontMeasureLine (const triChar *text) |
Measure a length of the current line of text if it were to be drawn. | |
typedef struct Glyph Glyph |
triBool triFontInit | ( | void | ) |
Initialise the Font library.
triFont * triFontLoadTRF | ( | const triChar * | filename | ) |
triVoid triFontSaveTRF | ( | triFont * | font, |
triChar * | filename ) |
triVoid triFontSetMono | ( | triFont * | font, |
triS32 | width ) |
Set a font mono spaced or not (default).
font | - A valid triFont or 0 for inbuilt debug font |
width | - Width to make all glyphs, 0 to make proportional width or < 0 to offset autowidth by that amount+1 |
triVoid triFontSetSpacing | ( | triFont * | font, |
triS32 | letter, | ||
triS32 | word ) |
Set a spacing values.
font | - A valid triFont or 0 for inbuilt debug font |
letter | - Spacing to apply to all glyphs: < 0 for tighter spacing, > 0 for wider spacing, 0 for normal spacing (default) |
word | - Spacing to apply to all whitespace glyphs in addition to letterspacing: < 0 for tighter spacing, > 0 for wider spacing, 0 for normal spacing (default) |
triVoid triFontSetLineheight | ( | triFont * | font, |
triS32 | height ) |
Set line height.
font | - A valid triFont or 0 for inbuilt debug font |
height | - Height of each line in pixels. 0 for default height. |
triVoid triFontActivate | ( | triFont * | font | ) |
Activate the specified font.
font | - A valid triFont or 0 to activate inbuilt debug font |
triSInt triFontPrint | ( | triFloat | x, |
triFloat | y, | ||
triUInt | color, | ||
const triChar * | text ) |
Draw text along the baseline starting at x, y.
x | - X position on screen |
y | - Y position on screen |
color | - Text color |
text | - Text to draw |
triSInt triFontPrintf | ( | triFloat | x, |
triFloat | y, | ||
triUInt | color, | ||
const triChar * | text, | ||
... ) |
Draw text along the baseline starting at x, y (with formatting).
x | - X position on screen |
y | - Y position on screen |
color | - Text color |
text | - Text to draw |
triSInt triFontPrintAlign | ( | triFloat | x, |
triFloat | y, | ||
triSInt | width, | ||
triSInt | height, | ||
triUInt | color, | ||
enum triFontAlignMode | align, | ||
const triChar * | text ) |
Draw text along the baseline aligned within the box starting at x, y.
x | - X position on screen |
y | - Y position on screen |
width | - The width of the box to align within |
height | - The height of the box to align within |
color | - Text color |
align | - The align method to apply (see triFontAlignMode) |
text | - Text to draw |
triSInt triFontPrintAlignf | ( | triFloat | x, |
triFloat | y, | ||
triSInt | width, | ||
triSInt | height, | ||
triUInt | color, | ||
enum triFontAlignMode | align, | ||
const triChar * | text, | ||
... ) |
Draw text along the baseline aligned within the box starting at x, y (with formatting).
x | - X position on screen |
y | - Y position on screen |
width | - The width of the box to align within |
height | - The height of the box to align within |
color | - Text color |
align | - The align method to apply (see triFontAlignMode) |
text | - Text to draw |
triSInt triFontMeasureTextHeight | ( | const triChar * | text | ) |
Measure height of a text if it were to be drawn.
text | - Text to measure |
triSInt triFontMeasureText | ( | const triChar * | text | ) |
Measure a length of text if it were to be drawn.
text | - Text to measure |
triSInt triFontMeasureLine | ( | const triChar * | text | ) |
Measure a length of the current line of text if it were to be drawn.
text | - Text to measure |