[cairo] Postscript fonts

David Goldenberg goldenberg at biology.utah.edu
Wed May 2 00:25:42 UTC 2018

   I am just starting to use Cairo, via pycairo, for a relatively simple project to draw diagrams to be output as postscript files.  I think that I haver worked out most of the basics, but the next step is add some labels, preferably using PostScript fonts.  On https://www.cairographics.org/documentation/using_the_postscript_surface/, I found the following statement:

> The PostScript surface natively supports Type 1 and TrueType fonts. All other fonts types (including OpenType/PS) are converted to Type 1.
> Fonts are always subsetted and embedded.

But, I have not been able to find any clues on the web about how to use PostScript fonts on the PSSurface. Is there a relatively simple way to do this?  From what I have gathered, the options for using fonts are to either use the “toy API” or delve more deeply into font specifications than I really want to.  Does using PostScript fonts require the latter approach?

For my application, I could get by with the toy API fonts, but even learning about these seems difficult.  Is there a place where the font names are listed and the fonts illustrated?

Any suggestions or comments would be greatly appreciated.


Department of Biology
University of Utah
257 South 1400 East
Salt Lake City, UT  84112-0840

Telephone: (801) 581-3885
Fax:  (801) 581-2174

E-mail: goldenberg at biology.utah.edu
Web page: http://goldenberg.biology.utah.edu

More information about the cairo mailing list