Next: , Previous: , Up: API Reference   [Contents][Index]


3.11 Fonts

(use-modules (sdl2 ttf))
Procedure: ttf-init

Initialize the TTF system.

Procedure: ttf-quit

Shut down and clean up the TTF system.

Procedure: load-font file point-size

Load TTF font from file and return a new font object whose glyph size is point-size.

Procedure: delete-font! font

Delete the memory allocated for font.

Procedure: font-height font

Return the maximum height of font.

Procedure: font-ascent font

Return the maximum pixel ascent of all glyphs in font. This can also be interpreted as the distance from the top of the font to the baseline.

Procedure: font-descent font

Return the maximum pixel descent of all glyphs in font. This can also be interpreted as the distance from the baseline to the bottom of the font.

Procedure: font-line-skip font

Return the recommended pixel height of a line of text using font.

Procedure: font-size-text font text

Return 2 values for the resulting surface size of the string text using font.

Procedure: font-glyph-index font char

Return the index of the glyph for char in font, or #f if char is not present.

Procedure: font-glyph-metrics font char

Return values for the metrics of char in font: min x, max x, min y, max y, and advance.

font-style: font

Return the rendering style of font as a list that may contain any of the following symbols:

The empty list is returned if none of the above styles are applied.

font-set-style!: font style

Set the rendering style of font to style, a list that may contain any of the following symbols:

The empty list means that none of the above stylings will be used.

Procedure: render-font-solid font text color

Render text, a UTF-8 encoded string, using font and color, the foreground color, and return a surface containing the results.

Procedure: render-font-blended font text color

Render text, a UTF-8 encoded string, using font and color, the foreground color, and return a high-quality alpha-blended surface containing the results.


Next: , Previous: , Up: API Reference   [Contents][Index]