CairoSVG API reference
54 public APIs from CairoSVG (Kozea/CairoSVG) — 9 classes, 40 functions, 5 methods. Signatures extracted by static analysis of the actual source.
Repository: Kozea/CairoSVG
| Kind | Count |
|---|---|
| Classes | 9 |
| Functions | 40 |
| Methods | 5 |
API list
func
cairosvg.__main__.main(argv=None, stdout=None, stdin=None)Entry-point of the executable.
func
cairosvg.bounding_box.calculate_bounding_box(surface, node)Calculate ``node``'s bounding box.
func
cairosvg.css.find_stylesheets(tree)Find the stylesheets included in ``tree``.
func
cairosvg.css.find_stylesheets_rules(tree, stylesheet_rules, url)Find the rules in a stylesheet.
func
cairosvg.css.get_declarations(rule)Get the declarations in ``rule``.
func
cairosvg.defs.clip_path(surface, node)Store a clip path definition.
func
cairosvg.defs.draw_gradient(surface, node, name, opacity)Gradients colors.
func
cairosvg.defs.draw_pattern(surface, node, name, opacity)Draw a pattern image.
func
cairosvg.defs.filter_(surface, node)Store a filter definition.
func
cairosvg.defs.gradient_or_pattern(surface, node, name, opacity)Gradient or pattern color.
func
cairosvg.defs.linear_gradient(surface, node)Store a linear gradient definition.
func
cairosvg.defs.marker(surface, node)Store a marker definition.
func
cairosvg.defs.mask(surface, node)Store a mask definition.
func
cairosvg.defs.paint_mask(surface, node, name, opacity)Paint the mask of the current surface.
func
cairosvg.defs.parse_def(surface, node)Parse the SVG definitions.
func
cairosvg.defs.pattern(surface, node)Store a pattern definition.
func
cairosvg.defs.prepare_filter(surface, node, name)Apply a filter transforming the context.
func
cairosvg.defs.radial_gradient(surface, node)Store a radial gradient definition.
func
cairosvg.defs.use(surface, node)Draw the content of another SVG node.
class
cairosvg.helpers.PointErrorException raised when parsing a point fails.
func
cairosvg.helpers.clip_rect(string)Parse the rect value of a clip.
func
cairosvg.helpers.distance(x1, y1, x2, y2)Get the distance between two points.
func
cairosvg.helpers.flatten(node)Flatten the text of a node and its children.
func
cairosvg.helpers.paint(value)Extract from value an uri and a color.
func
cairosvg.helpers.preserve_ratio(surface, node, width=None, height=None)Manage the ratio preservation.
func
cairosvg.helpers.size(surface, string, reference='xy')Replace a ``string`` with units by a float value.
func
cairosvg.image.image(surface, node)Draw an image ``node``.
func
cairosvg.image.invert_image(img)Invert the colors of an image.
class
cairosvg.parser.NodeSVG node with dict-like properties and children.
method
cairosvg.parser.Node.text_children(element, trailing_space, text_root=False)Create children and return them.
class
cairosvg.parser.TreeSVG tree.
func
cairosvg.parser.handle_white_spaces(string, preserve)Handle white spaces in text nodes.
func
cairosvg.path.path(surface, node)Draw a path ``node``.
func
cairosvg.shapes.circle(surface, node)Draw a circle ``node`` on ``surface``.
func
cairosvg.shapes.ellipse(surface, node)Draw an ellipse ``node`` on ``surface``.
func
cairosvg.shapes.line(surface, node)Draw a line ``node``.
func
cairosvg.shapes.polygon(surface, node)Draw a polygon ``node`` on ``surface``.
func
cairosvg.shapes.polyline(surface, node)Draw a polyline ``node``.
func
cairosvg.shapes.rect(surface, node)Draw a rect ``node`` on ``surface``.
class
cairosvg.surface.EPSSurfaceA surface that writes in Encapsulated PostScript format.
class
cairosvg.surface.PDFSurfaceA surface that writes in PDF format.
class
cairosvg.surface.PNGSurfaceA surface that writes in PNG format.
method
cairosvg.surface.PNGSurface.finish()Read the PNG surface content.
class
cairosvg.surface.PSSurfaceA surface that writes in PostScript format.
class
cairosvg.surface.SVGSurfaceA surface that writes in SVG format.
class
cairosvg.surface.SurfaceAbstract base class for CairoSVG surfaces.
method
cairosvg.surface.Surface.draw(node)Draw ``node`` and its children.
method
cairosvg.surface.Surface.finish()Read the surface content.
method
cairosvg.surface.Surface.points_per_pixel()Surface resolution.
func
cairosvg.svg.svg(surface, node)Draw a svg ``node``.
func
cairosvg.text.path_length(path)Get the length of ``path``.
func
cairosvg.text.text(surface, node, draw_as_text=False)Draw a text ``node``.
func
cairosvg.url.fetch(url, resource_type)Fetch the content of ``url``.
func
cairosvg.url.parse_url(url, base=None)Parse an URL.
About this data
These signatures were extracted from the public source of Kozea/CairoSVG
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.