+ return diagram;
+}
+
+/*
+ * @brief Create a cairo context from a libsvgtiny diagram.
+ *
+ * @param diagram
+ * A pointer to a valid libsvgtiny diagram.
+ *
+ * @return If successful, a pointer to a @c cairo_t context structure
+ * is returned; if not, @c NULL is returned. You are expected to @c
+ * cairo_destroy the result if it is valid.
+ */
+cairo_t* cairo_context_from_diagram(diagram_t* diagram) {
+ cairo_t* cr;
+ cairo_surface_t* surface;
+ cairo_status_t crs;
+ unsigned int i;
+
+ surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24,
+ diagram->width,
+ diagram->height);