Exemple #1
0
    def __init__(self, fobj, width, height, format='pdf', pixels=False):
        """
        width (horizontal) and height (vertical) in mm
        """
        GraphicsInterface.__init__(self,
                                   (width / DPMM_IMG if pixels else width),
                                   (height / DPMM_IMG if pixels else height))

        self.fobj = fobj
        self.format = format
        self.surface = None
        self.context = None
        self.sfc_width = None
        self.sfc_height = None
        self.set_origin(self.gi_width / 2.0, self.gi_height / 2.0)
Exemple #2
0
 def set_font(self, font='Arial', fontsize=12 * POINT):
     GraphicsInterface.set_font(self, font, fontsize)
     self.context.set_font_size(self.gi_fontsize)
     self.context.select_font_face(self.gi_font, cairo.FONT_SLANT_NORMAL,
                                   cairo.FONT_WEIGHT_NORMAL)
Exemple #3
0
 def restore(self):
     GraphicsInterface.restore(self)
     self.context.restore()
Exemple #4
0
 def save(self):
     GraphicsInterface.save(self)
     self.context.save()
Exemple #5
0
 def set_dashed_line(self, on, off, start=0.0):
     GraphicsInterface.set_dashed_line(self, on, off, start)
Exemple #6
0
 def set_solid_line(self):
     GraphicsInterface.set_solid_line(self)
Exemple #7
0
 def set_linewidth(self, linewidth):
     GraphicsInterface.set_linewidth(self, linewidth)
     self.context.set_line_width(linewidth)