Next: , Previous: Loading and processing images, Up: Working with external data


2.2.2 Rendering and displaying text

In order to be able to use the procedures documented here, one shall (use-modules (slayer font)).

— Procedure: load-font path pt-size

Load TrueType font from a file indicated by path. The size of the font will be pt-size. Returns the object representing font, which can later be used for rendering text using render-text procedure.

— Procedure: render-text text font [color] [bgcolor]

Returns a new image containing text rendered using font with color (which defaults to white). If bgcolor is given and not #f, it will become the background color of the image; otherwise, the background is transparent. The obtained image can be displayed on the screen using draw-image!.

— Procedure: font-line-skip font

Returns the line skip (integer) defined by the font.