Drawing text

Home / Features / Drawing text

Text can be drawn on a surface, by using another surface with font graphics. Fonts can be drawn in fixed width (each character has the same width) or in variable width. A font surface contains 96 characters (32-128) by default but can be expanded by any size.

EDGELIB also offers functionality for horizontal and vertical padding, newlines and font alignment.

The following images show a portion of a fixed width font and a font with a variable width. Notice the white pixels on the first row to indicate the width per character.

As of EDGELIB 2.95, it's also possible to write fonts with automatic text wrapping based on a given width in pixels. Text wrapping can be pre-calculated for fast text drawing.

Fixed width font
Fixed width font
Variable width font
Variable width font

Back to Features

Latest forum posts