LIBRSVG: C library for rendering SVG

LIBRSVG 2.62.3 C library for rendering SVG

Loading...
Searching...
No Matches
Functions
Loading
librsvg

Create an #RsvgHandle from a file, memory, or a GIO stream. More...

## Functions
void | rsvg_handle_set_dpi (RsvgHandle *handle, double dpi)
| rsvg_handle_set_dpi: @handle: an #RsvgHandle @dpi: dots per inch (both axes)
void | rsvg_handle_set_dpi_x_y (RsvgHandle *handle, double dpi_x, double dpi_y)
| rsvg_handle_set_dpi_x_y: @handle: an #RsvgHandle
RsvgHandle * | rsvg_handle_new (void)
| rsvg_handle_new:
gboolean | rsvg_handle_write (RsvgHandle *handle, const guchar *buf, gsize count, GError **error)
| rsvg_handle_write:
gboolean | rsvg_handle_close (RsvgHandle *handle, GError **error)
| rsvg_handle_close:
const char * | rsvg_handle_get_base_uri (RsvgHandle *handle)
| rsvg_handle_get_base_uri:
void | rsvg_handle_set_base_uri (RsvgHandle *handle, const char *base_uri)
| rsvg_handle_set_base_uri: @handle: an #RsvgHandle @base_uri: base URI for resolving relative references
RsvgHandle * | rsvg_handle_new_with_flags (RsvgHandleFlags flags)
| rsvg_handle_new_with_flags: @flags: RsvgHandleFlags
void | rsvg_handle_set_base_gfile (RsvgHandle *handle, GFile *base_file)
| rsvg_handle_set_base_gfile: @handle: an #RsvgHandle @base_file: a #GFile used as the base for relative URIs
gboolean | rsvg_handle_read_stream_sync (RsvgHandle *handle, GInputStream *stream, GCancellable *cancellable, GError **error)
| rsvg_handle_read_stream_sync: @handle: an #RsvgHandle @stream: SVG data @cancellable: (nullable): a #GCancellable @error: return location for a #GError
RsvgHandle * | rsvg_handle_new_from_gfile_sync (GFile *file, RsvgHandleFlags flags, GCancellable *cancellable, GError **error)
| rsvg_handle_new_from_gfile_sync: @gfile: a #GFile @flags: RsvgHandleFlags @cancellable: (nullable): a #GCancellable @error: return location for a #GError
RsvgHandle * | rsvg_handle_new_from_stream_sync (GInputStream *input_stream, GFile *base_file, RsvgHandleFlags flags, GCancellable *cancellable, GError **error)
| rsvg_handle_new_from_stream_sync:
RsvgHandle * | rsvg_handle_new_from_data (const guint8 *data, gsize data_len, GError **error)
| rsvg_handle_new_from_data: @data: SVG bytes @data_len: length of @data @error: return location for a #GError
RsvgHandle * | rsvg_handle_new_from_file (const gchar *filename, GError **error)
| rsvg_handle_new_from_file: @filename: a file name @error: return location for a #GError

## Detailed Description

Create an #RsvgHandle from a file, memory, or a GIO stream.

Prefer rsvg_handle_new_from_file(), rsvg_handle_new_from_data(), or the GIO constructors. rsvg_handle_write() / rsvg_handle_close() remain public but are deprecated.

## Function Documentation

## ◆ rsvg_handle_close()

gboolean rsvg_handle_close | ( | RsvgHandle * | handle,
|  | GError ** | error
| ) |  |

`#include <rsvg.h>`

rsvg_handle_close:

Deprecated:
  Use rsvg_handle_read_stream_sync().

Since
  2.0

## ◆ rsvg_handle_get_base_uri()

const char * rsvg_handle_get_base_uri | ( | RsvgHandle * | handle | ) |

`#include <rsvg.h>`

rsvg_handle_get_base_uri:

Since
  2.9

## ◆ rsvg_handle_new()

RsvgHandle * rsvg_handle_new | ( | void |  | ) |

`#include <rsvg.h>`

rsvg_handle_new:

Empty handle. Load data with rsvg_handle_read_stream_sync() or the deprecated rsvg_handle_write() / rsvg_handle_close().

Since
  2.0

## ◆ rsvg_handle_new_from_data()

RsvgHandle * rsvg_handle_new_from_data | ( | const guint8 * | data,
|  | gsize | data_len,
|  | GError ** | error
| ) |  |

`#include <rsvg.h>`

rsvg_handle_new_from_data: @data: SVG bytes @data_len: length of @data @error: return location for a #GError

Load SVG from memory.

Since
  2.14

## ◆ rsvg_handle_new_from_file()

RsvgHandle * rsvg_handle_new_from_file | ( | const gchar * | filename,
|  | GError ** | error
| ) |  |

`#include <rsvg.h>`

rsvg_handle_new_from_file: @filename: a file name @error: return location for a #GError

Load SVG from @filename.

Since
  2.14

## ◆ rsvg_handle_new_from_gfile_sync()

RsvgHandle * rsvg_handle_new_from_gfile_sync | ( | GFile * | file,
|  | RsvgHandleFlags | flags,
|  | GCancellable * | cancellable,
|  | GError ** | error
| ) |  |

`#include <rsvg.h>`

rsvg_handle_new_from_gfile_sync: @gfile: a #GFile @flags: RsvgHandleFlags @cancellable: (nullable): a #GCancellable @error: return location for a #GError

Load SVG from @gfile.

Since
  2.32

## ◆ rsvg_handle_new_from_stream_sync()

RsvgHandle * rsvg_handle_new_from_stream_sync | ( | GInputStream * | input_stream,
|  | GFile * | base_file,
|  | RsvgHandleFlags | flags,
|  | GCancellable * | cancellable,
|  | GError ** | error
| ) |  |

`#include <rsvg.h>`

rsvg_handle_new_from_stream_sync:

Load SVG from a #GInputStream.

Since
  2.32

## ◆ rsvg_handle_new_with_flags()

RsvgHandle * rsvg_handle_new_with_flags | ( | RsvgHandleFlags | flags | ) |

`#include <rsvg.h>`

rsvg_handle_new_with_flags: @flags: RsvgHandleFlags

Since
  2.36

## ◆ rsvg_handle_read_stream_sync()

gboolean rsvg_handle_read_stream_sync | ( | RsvgHandle * | handle,
|  | GInputStream * | stream,
|  | GCancellable * | cancellable,
|  | GError ** | error
| ) |  |

`#include <rsvg.h>`

rsvg_handle_read_stream_sync: @handle: an #RsvgHandle @stream: SVG data @cancellable: (nullable): a #GCancellable @error: return location for a #GError

Load SVG data from @stream. Prefer this over rsvg_handle_write().

Since
  2.32

## ◆ rsvg_handle_set_base_gfile()

void rsvg_handle_set_base_gfile | ( | RsvgHandle * | handle,
|  | GFile * | base_file
| ) |  |

`#include <rsvg.h>`

rsvg_handle_set_base_gfile: @handle: an #RsvgHandle @base_file: a #GFile used as the base for relative URIs

Since
  2.32

## ◆ rsvg_handle_set_base_uri()

void rsvg_handle_set_base_uri | ( | RsvgHandle * | handle,
|  | const char * | base_uri
| ) |  |

`#include <rsvg.h>`

rsvg_handle_set_base_uri: @handle: an #RsvgHandle @base_uri: base URI for resolving relative references

Must be called before loading data.

Since
  2.8

## ◆ rsvg_handle_set_dpi()

void rsvg_handle_set_dpi | ( | RsvgHandle * | handle,
|  | double | dpi
| ) |  |

`#include <rsvg.h>`

rsvg_handle_set_dpi: @handle: an #RsvgHandle @dpi: dots per inch (both axes)

Set the DPI used to resolve physical units.

Since
  2.8

## ◆ rsvg_handle_set_dpi_x_y()

void rsvg_handle_set_dpi_x_y | ( | RsvgHandle * | handle,
|  | double | dpi_x,
|  | double | dpi_y
| ) |  |

`#include <rsvg.h>`

rsvg_handle_set_dpi_x_y: @handle: an #RsvgHandle

Set the DPI independently on each axis.

Since
  2.8

## ◆ rsvg_handle_write()

gboolean rsvg_handle_write | ( | RsvgHandle * | handle,
|  | const guchar * | buf,
|  | gsize | count,
|  | GError ** | error
| ) |  |

`#include <rsvg.h>`

rsvg_handle_write:

Deprecated:
  Use rsvg_handle_read_stream_sync().

Since
  2.0