How to use the svglib.svglib.Svg2RlgShapeConverter function in svglib

To help you get started, we’ve selected a few svglib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deeplook / svglib / tests / test_basic.py View on Github external
def test_elliptical_arc(self):
        converter = svglib.Svg2RlgShapeConverter(None)
        node = svglib.NodeTracker(etree.XML(
            '
github deeplook / svglib / tests / test_basic.py View on Github external
def test_relative_move_after_closepath(self):
        """
        A relative subpath is relative to the point *after* the previous
        closePath op (which is not recorded in path.points).
        """
        converter = svglib.Svg2RlgShapeConverter(None)
        node = svglib.NodeTracker(etree.XML(
            '
github deeplook / svglib / tests / test_basic.py View on Github external
def test_cubic_bezier_shorthand(self):
        # If there is no previous command or if the previous command was not
        # an C, c, S or s, assume the first control point is coincident with
        # the current point.
        converter = svglib.Svg2RlgShapeConverter(None)
        node = svglib.NodeTracker(etree.XML(
            '
github deeplook / svglib / tests / test_basic.py View on Github external
def test_fillrule(self):
        converter = svglib.Svg2RlgShapeConverter(None)
        node = etree.XML('
github deeplook / svglib / tests / test_basic.py View on Github external
def test_unclosed_paths(self):
        converter = svglib.Svg2RlgShapeConverter(None)
        node = svglib.NodeTracker(etree.XML('
github deeplook / svglib / tests / test_basic.py View on Github external
def test_stroke(self):
        converter = svglib.Svg2RlgShapeConverter(None)
        node = etree.XML('
github deeplook / svglib / tests / test_basic.py View on Github external
def test_filling(self):
        converter = svglib.Svg2RlgShapeConverter(None)
        node = svglib.NodeTracker(etree.XML(
            '
github deeplook / svglib / tests / test_basic.py View on Github external
def test_translate_only_x(self):
        """
        When the second translate value is missing, 0 is assumed.
        """
        group = Group()
        converter = svglib.Svg2RlgShapeConverter(None)
        transform = "translate(10)"
        converter.applyTransformOnGroup(transform, group)
        assert group.transform == (1, 0, 0, 1, 10, 0)
github deeplook / svglib / tests / test_basic.py View on Github external
def test_empty_path(self):
        converter = svglib.Svg2RlgShapeConverter(None)
        node = svglib.NodeTracker(etree.XML('
github deeplook / svglib / svglib / svglib.py View on Github external
def __init__(self, path, color_converter=None, parent_svgs=None):
        self.source_path = path
        self._parent_chain = parent_svgs or []  # To detect circular refs.
        self.attrConverter = Svg2RlgAttributeConverter(color_converter=color_converter)
        self.shape_converter = Svg2RlgShapeConverter(path, self.attrConverter)
        self.handled_shapes = self.shape_converter.get_handled_shapes()
        self.definitions = {}
        self.waiting_use_nodes = defaultdict(list)
        self._external_svgs = {}