| 1 | import cairo |
| 2 | |
| 3 | |
| 4 | def draw(cr, width, height): |
| 5 | cr.scale(width, height) |
| 6 | cr.set_line_width(0.04) |
| 7 | |
| 8 | cr.select_font_face("Sans", cairo.FONT_SLANT_NORMAL, |
| 9 | cairo.FONT_WEIGHT_NORMAL) |
| 10 | # draw 0.08 glyphs in 0.10 squares, at(0.01, 0.02) from left corner |
| 11 | cr.set_font_size(0.08) |
| 12 | |
| 13 | glyphs = [] |
| 14 | index = 0 |
| 15 | for y in range(10): |
| 16 | for x in range(10): |
| 17 | glyphs.append((index, x / 10.0 + 0.01, y / 10.0 + 0.08)) |
| 18 | index += 1 |
| 19 | |
| 20 | cr.show_glyphs(glyphs) |