freetypy.Glyph.render

Glyph.render()

Convert a given glyph image to a Bitmap. It does so by inspecting the glyph image format, finding the relevant renderer, and invoking it.

Parameters:
  • render_mode (int, optional) –

    This is the render mode used to render the glyph image into a bitmap.

    See RENDER_MODE for the available options.

  • origin (2-sequence of floats) – The (x, y) origin to translate the glyph image before rendering.
Returns:

bitmap – The generated bitmap.

Return type:

Bitmap

Notes

The selected render mode only affects vector glyphs of a font. Embedded bitmaps often have a different pixel mode like PIXEL_MODE.MONO. You can use Bitmap.convert to transform them into 8-bit pixmaps.