##### pygame documentation

Pygame Home || Help Contents || Reference Index

Most useful stuff: Color | display | draw | event | font | image | key | locals | mixer | mouse | Rect | Surface | time | music | pygame

Advanced stuff: cursors | joystick | mask | sprite | transform | BufferProxy | freetype | gfxdraw | midi | Overlay | PixelArray | pixelcopy | sndarray | surfarray | math

Other: camera | cdrom | examples | scrap | tests | touch | version

## src_c/_freetype.c

This extension module defines Python type `pygame.freetype.Font` Create a new Font instance from a supported font file..

Header file: src_c/freetype.h

`pgFontObject`

  The `pygame.freetype.Font` instance C struct.

`pgFont_Type`

  The `pygame.freetype.Font` Python type.

PyObject* `pgFont_New`(const char *filename, long font_index)

  Open the font file with path filename and return a new new `pygame.freetype.Font` instance for that font. Set font_index to `0` unless the file contains multiple, indexed, fonts. On error raise a Python exception and return `NULL`.

int `pgFont_Check`(PyObject *x)

  Return true if x is a `pygame.freetype.Font` instance. Will return false for a subclass of `Font`. This is a macro. No check is made that x is not `NULL`.

int `pgFont_IS_ALIVE`(PyObject *o)

  Return true if `pygame.freetype.Font` object `o` is an open font file. This is a macro. No check is made that o is not `NULL` or not a `Font` instance.

Edit on GitHub