unsigned get_glyph_outline(handle device,
                           unsigned code_point,
                           unsigned format,
                           glyph_metric* metrics,
                           unsigned length,
                           void* buffer,
                           const imatrix* transform)

This function obtains the bitmap or outline of a character from the currently selected true type font.


handle device

The handle of the device context.

unsigned code_point

The code point (character) for which glyph information is required.

unsigned format

A flag from either of the enumerations glyph_type or glyph_format.

glyph_metric* metrics

A pointer to a structure describing the placement of the glyph within the character cell.

unsigned length

The size of the supplied buffer. If zero is specified, the required buffer size is returned.

void* buffer

A pointer to a buffer to hold the glyph information (bitmap or outline).

const imatrix* transform

A pointer to a matrix to be applied to the glyph.



If the function succeeds and any of the formats glyph_format::bitmap, glyph_format::gray2, glyph_format::gray4, glyph_format::gray8 or or glyph_type::outline were requested, the value returned is greater than zero. When the function fails for such requests, error_return::graphics is returned. If one of these requests is made and the buffer size or address is zero, the required buffer size (in bytes) is returned.

If glyph_type::metrics is specified and the function fails, the return value is error_return::graphics.


The glyph outline that is returned is grid-fitted. A grid-fitted glyph has been modified so that its bitmapped image matches the original design of the glyph as closely as possible. Unmodified glyph outlines may be obtained by requesting the glyph outline for a character in a font whose size is equal to the font's em unit. A font's em unit is stored in the member em_square of the class outline_text_metrics.