Exemplo n.º 1
0
 def test_should_use_viewbox_if_available(self):
     bounding_box = BoundingBox(11, 12, 101, 102)
     page = E.svg({
         SVG_VIEWBOX_ATTRIB: format_bounding_box(bounding_box)
     })
     doc = SvgStructuredDocument(page)
     assert doc.get_bounding_box(page) == bounding_box
Exemplo n.º 2
0
 def test_should_be_able_to_set_bounding_box(self):
     bounding_box = BoundingBox(11, 12, 101, 102)
     text = SVG_TEXT('a', {'x': '10', 'y': '11', 'font-size': '100'})
     doc = SvgStructuredDocument(E.svg(SVG_TEXT_LINE(text)))
     doc.set_bounding_box(text, bounding_box)
     assert text.attrib[SVGE_BOUNDING_BOX] == format_bounding_box(
         bounding_box)
Exemplo n.º 3
0
 def test_should_use_bounding_box_if_available(self):
     bounding_box = BoundingBox(11, 12, 101, 102)
     text = SVG_TEXT('a', {
         'x': '10',
         'y': '11',
         'font-size': '100',
         SVGE_BOUNDING_BOX: format_bounding_box(bounding_box)
     })
     doc = SvgStructuredDocument(E.svg(SVG_TEXT_LINE(text)))
     assert doc.get_bounding_box(text) == bounding_box