Namespace

Rsvg – 2.0

Librsvg - load and render SVG documents

Version2.58.0
AuthorsLibrsvg developers
LicenseLGPL-2.1-or-later
Websitehttps://wiki.gnome.org/Projects/LibRsvg
Sourcehttps://gitlab.gnome.org/GNOME/librsvg/

Build

C headerslibrsvg/rsvg.h
pkg-config fileslibrsvg-2.0

Dependencies

Classes

Handle

RsvgHandle loads an SVG document into memory.

since: 2.0

Structs

DimensionData

Dimensions of an SVG image from rsvg_handle_get_dimensions(), or an individual element from rsvg_handle_get_dimensions_sub(). Please see the deprecation documentation for those functions.

deprecated: 2.46. since: 2.0

Length

RsvgLength values are used in rsvg_handle_get_intrinsic_dimensions(), for example, to return the CSS length values of the width and height attributes of an <svg> element.

since: 2.0

PositionData

Position of an SVG fragment from rsvg_handle_get_position_sub(). Please the deprecation documentation for that function.

deprecated: 2.46. since: 2.0

Rectangle

A data structure for holding a rectangle.

since: 2.46

Enumerations

Unit

Units for the RsvgLength struct. These have the same meaning as CSS length units.

since: 2.0

Bitfields

HandleFlags

Configuration flags for an RsvgHandle. Note that not all of RsvgHandles constructors let you specify flags. For this reason, rsvg_handle_new_from_gfile_sync() and rsvg_handle_new_from_stream_sync() are the preferred ways to create a handle.

since: 2.40.3

Error Domains

Error

An enumeration representing possible errors.

since: 2.0

Callbacks

SizeFunc

Function to let a user of the library specify the SVG’s dimensions.

deprecated: 2.14. since: 2.0

Functions

cleanup

This function does nothing.

deprecated: 2.46 since: 2.36

init

This function does nothing.

deprecated: 2.36 since: 2.9

pixbuf_from_file

Loads a new GdkPixbuf from filename and returns it. The caller must assume the reference to the reurned pixbuf. If an error occurred, error is set and NULL is returned.

deprecated: Unknown since: 2.0

pixbuf_from_file_at_max_size

Loads a new GdkPixbuf from filename and returns it. This pixbuf is uniformly scaled so that the it fits into a rectangle of size max_width * max_height. The caller must assume the reference to the returned pixbuf. If an error occurred, error is set and NULL is returned.

deprecated: Unknown since: 2.0

pixbuf_from_file_at_size

Loads a new GdkPixbuf from filename and returns it. This pixbuf is scaled from the size indicated to the new size indicated by width and height. If both of these are -1, then the default size of the image being loaded is used. The caller must assume the reference to the returned pixbuf. If an error occurred, error is set and NULL is returned.

deprecated: Unknown since: 2.0

pixbuf_from_file_at_zoom

Loads a new GdkPixbuf from filename and returns it. This pixbuf is scaled from the size indicated by the file by a factor of x_zoom and y_zoom. The caller must assume the reference to the returned pixbuf. If an error occurred, error is set and NULL is returned.

deprecated: Unknown since: 2.0

pixbuf_from_file_at_zoom_with_max

Loads a new GdkPixbuf from filename and returns it. This pixbuf is scaled from the size indicated by the file by a factor of x_zoom and y_zoom. If the resulting pixbuf would be larger than max_width/max_heigh it is uniformly scaled down to fit in that rectangle. The caller must assume the reference to the returned pixbuf. If an error occurred, error is set and NULL is returned.

deprecated: Unknown since: 2.0

set_default_dpi

Do not use this function. Create an RsvgHandle and call rsvg_handle_set_dpi() on it instead.

deprecated: 2.42.3 since: 2.8

set_default_dpi_x_y

Do not use this function. Create an RsvgHandle and call rsvg_handle_set_dpi_x_y() on it instead.

deprecated: 2.42.3 since: 2.8

term

This function does nothing.

deprecated: 2.36 since: 2.9

Function Macros

CHECK_VERSION

This C macro returns TRUE if the the version of librsvg being compiled against is the same or newer than the specified version.

since: 2.0

DEPRECATED_FOR

since: 2.0

Constants

MAJOR_VERSION

This is a C macro that expands to a number with the major version of librsvg against which your program is compiled.

since: 2.0

MICRO_VERSION

This is a C macro that expands to a number with the micro version of librsvg against which your program is compiled.

since: 2.0

MINOR_VERSION

This is a C macro that expands to a number with the minor version of librsvg against which your program is compiled.

since: 2.0

VERSION

This is a C macro that expands to a string with the version of librsvg against which your program is compiled.

since: 2.0