Chadrick Blog

python cairo selecting font

Here is how to select the font in cairo in python.

import cairocffi as cairo

# define context somewhere..

ft="Times New Roman"
context.select\_font\_face(ft, cairo.FONT\_SLANT\_NORMAL, cairo.FONT\_WEIGHT\_NORMAL)