Next: , Previous: , Up: The (sdl *) Modules   [Contents][Index]


8 TrueType

Procedure: ttf-init

Initialize the SDL_ttf subsystem.

Procedure: load-font file ptsize

Load a font from file with point size ptsize. Return a handle.

Procedure: font:style font

Return the style of font (see font-style flags). This font style is implemented by modifying the font glyphs, and doesn’t reflect any inherent properties of the truetype font file.

Procedure: font:set-style! font style

Set font style to style (see font-style flags). This font style is implemented by modifying the font glyphs, and doesn’t reflect any inherent properties of the truetype font file.

Procedure: font:height font

Return the total height of font, usually equal to point size.

Procedure: font:ascent font

Return the offset from the baseline to the top of font. This is a positive number.

Procedure: font:descent font

Return the offset from the baseline to the bottom of font. This is a negative number.

Procedure: font:line-skip font

Return the recommended spacing between lines of text for font.

Procedure: font:glyph-xXyYa font ch

Return the metrics (dimensions) of a glyph as five values. The glyph is a font-specific rendering of char ch. Values are: minx, maxx, miny, maxy and advance (all integers).

Procedure: text-wh font text

Return two values: width and height (both integers) representing the dimensions of the font-specific rendering of the string text.

Procedure: utf8-wh font text

Return two values: width and height (both integers) representing the dimensions of the font-specific rendering of the UTF-8 string text.

Procedure: render-text font text fg [bg]

Return a new surface containing the font-specific rendering of the text string. Third argument is the foreground color; optional fourth argument is the background color, or #t if the text is to be blended.

Procedure: render-utf8 font text fg [bg]

Return a new surface containing a font-specific rendering of the utf8 string text. Third argument is the foreground color; optional fourth argument is the background color, or #t if the text is to be blended.

Procedure: render-glyph font ch fg [bg]

Return a new surface containing a font-specific rendering of the character ch. Third argument is the foreground color; optional fourth argument is the background color, or #t if the text is to be blended.

Procedure: ttf-quit

Quit the SDL_ttf subsystem.


Next: Audio, Previous: OpenGL, Up: The (sdl *) Modules   [Contents][Index]