#!/usr/bin/python # This example creates a one-page document containing all # fonts supported by Python PS. import ps # Create a new document my_doc = ps.document( title='Test Document', papertype='a4' ) # Generate a page with all available fonts page = ps.page() # Get a list with all fonts fontlist = my_doc.get_font_list() # Create a container with one row for each font c = ps.container_grid( 1, len(fontlist) ) # Add texts with the different fonts ycount = 0 for font in fontlist: c.add_item( 0, ycount, ps.text( 'Räven raskar över isen. 01234567890 !"#¤%&/()=', font='%s' % font, size=14 )) ycount = ycount + 1 # Add item to page and page to document page.add_item(c) my_doc.add_page( page ) print my_doc.generate_ps()