asc-canvas: AppStream Compose Library Reference Manual

## asc-canvas asc-canvas — Draw text and render SVG graphics. |

## Functions

GQuark | asc_canvas_error_quark ()
AscCanvas * | asc_canvas_new ()
guint | asc_canvas_get_width ()
guint | asc_canvas_get_height ()
gboolean | asc_canvas_render_svg ()
gboolean | asc_canvas_save_png ()

## Types and Values

#define | ASC_TYPE_CANVAS
enum | AscCanvasError
#define | ASC_CANVAS_ERROR
| AscCanvas

## Includes

    #include <appstream-compose.h>

## Description

## Functions

### asc_canvas_error_quark ()

    GQuark
    asc_canvas_error_quark (void);

#### Returns

An error quark.

### asc_canvas_new ()

    AscCanvas *
    asc_canvas_new (gint width,
                    gint height);

Creates a new AscFont.

#### Returns

an AscCanvas.

[transfer full]

### asc_canvas_get_width ()

    guint
    asc_canvas_get_width (AscCanvas *canvas);

Gets the canvas width.

#### Parameters

canvas | an AscCanvas instance. |

### asc_canvas_get_height ()

    guint
    asc_canvas_get_height (AscCanvas *canvas);

Gets the canvas height.

#### Parameters

canvas | an AscCanvas instance. |

### asc_canvas_render_svg ()

    gboolean
    asc_canvas_render_svg (AscCanvas *canvas,
                           GInputStream *stream,
                           GError **error);

Render an SVG graphic from the SVG data provided.

#### Parameters

canvas | an AscCanvas instance. |
stream | SVG data input stream. |
error | A GError or `NULL` |

### asc_canvas_save_png ()

    gboolean
    asc_canvas_save_png (AscCanvas *canvas,
                         const gchar *fname,
                         GError **error);

Save canvas to PNG file.

#### Parameters

canvas | an AscCanvas instance. |
fname | Filename to save to. |
error | A GError or `NULL` |

## Types and Values

### ASC_TYPE_CANVAS

    #define ASC_TYPE_CANVAS (asc_canvas_get_type ())

### enum AscCanvasError

A drawing error.

#### Members

ASC_CANVAS_ERROR_FAILED | Generic failure. |
ASC_CANVAS_ERROR_DRAWING | Drawing operation failed. |
ASC_CANVAS_ERROR_FONT | Issue with font or font selection. |
ASC_CANVAS_ERROR_UNSUPPORTED | The requested action was not supported. |

### ASC_CANVAS_ERROR

    #define ASC_CANVAS_ERROR asc_canvas_error_quark ()

### AscCanvas

    typedef struct _AscCanvas AscCanvas;