(self)
| 1751 | return name |
| 1752 | |
| 1753 | def writeMarkers(self): |
| 1754 | for ((pathops, fill, stroke, joinstyle, capstyle), |
| 1755 | (name, ob, bbox, lw)) in self.markers.items(): |
| 1756 | # bbox wraps the exact limits of the control points, so half a line |
| 1757 | # will appear outside it. If the join style is miter and the line |
| 1758 | # is not parallel to the edge, then the line will extend even |
| 1759 | # further. From the PDF specification, Section 8.4.3.5, the miter |
| 1760 | # limit is miterLength / lineWidth and from Table 52, the default |
| 1761 | # is 10. With half the miter length outside, that works out to the |
| 1762 | # following padding: |
| 1763 | bbox = bbox.padded(lw * 5) |
| 1764 | self.beginStream( |
| 1765 | ob.id, None, |
| 1766 | {'Type': Name('XObject'), 'Subtype': Name('Form'), |
| 1767 | 'BBox': list(bbox.extents)}) |
| 1768 | self.output(GraphicsContextPdf.joinstyles[joinstyle], |
| 1769 | Op.setlinejoin) |
| 1770 | self.output(GraphicsContextPdf.capstyles[capstyle], Op.setlinecap) |
| 1771 | self.output(*pathops) |
| 1772 | self.output(Op.paint_path(fill, stroke)) |
| 1773 | self.endStream() |
| 1774 | |
| 1775 | def pathCollectionObject(self, gc, path, trans, padding, filled, stroked): |
| 1776 | name = Name('P%d' % len(self.paths)) |
no test coverage detected