def draw_svg(self, svg_str):
        """Draws svg string to cell"""

        try:
            import rsvg
        except ImportError:
            self.draw_text(svg_str)
            return

        svg = rsvg.Handle(data=svg_str)

        svg_width, svg_height = svg.get_dimension_data()[:2]

        transx, transy = self._get_translation(svg_width, svg_height)

        scale_x, scale_y = self._get_scalexy(svg_width, svg_height)
        scale = min(scale_x, scale_y)

        angle = float(self.code_array.cell_attributes[self.key]["angle"])

        self.context.save()
        self.context.rotate(-angle / 360 * 2 * math.pi)
        self.context.translate(transx, transy)
        self.context.scale(scale, scale)
        svg.render_cairo(self.context)
        self.context.restore()
Draws svg string to cell