| 224 | self.lastfont = None |
| 225 | |
| 226 | def render_glyph(self, ox, oy, info): |
| 227 | oy = self.height - oy + info.offset |
| 228 | postscript_name = info.postscript_name |
| 229 | fontsize = info.fontsize |
| 230 | symbol_name = info.symbol_name |
| 231 | |
| 232 | if (postscript_name, fontsize) != self.lastfont: |
| 233 | ps = """/%(postscript_name)s findfont |
| 234 | %(fontsize)s scalefont |
| 235 | setfont |
| 236 | """ % locals() |
| 237 | self.lastfont = postscript_name, fontsize |
| 238 | self.pswriter.write(ps) |
| 239 | |
| 240 | ps = """%(ox)f %(oy)f moveto |
| 241 | /%(symbol_name)s glyphshow\n |
| 242 | """ % locals() |
| 243 | self.pswriter.write(ps) |
| 244 | |
| 245 | def render_rect_filled(self, x1, y1, x2, y2): |
| 246 | ps = "%f %f %f %f rectfill\n" % (x1, self.height - y2, x2 - x1, y2 - y1) |