LIBRSVG 2.62.3
C library for rendering SVG
Loading...
Searching...
No Matches
Stylesheet

Inject a CSS stylesheet into a document. More...

Functions

gboolean rsvg_handle_set_stylesheet (RsvgHandle *handle, const guint8 *css, gsize css_len, GError **error)
 Set a CSS stylesheet for the SVG document.
 

Detailed Description

Inject a CSS stylesheet into a document.

Function Documentation

◆ rsvg_handle_set_stylesheet()

gboolean rsvg_handle_set_stylesheet ( RsvgHandle *  handle,
const guint8 *  css,
gsize  css_len,
GError **  error 
)

#include <rsvg.h>

Set a CSS stylesheet for the SVG document.

@handle: a #RsvgHandle @css: (array length=css_len) (nullable): CSS data; must be valid UTF-8 @css_len: length of @css in bytes @error: return location for a #GError

@css_len is mandatory; this function will not compute the length of @css. A stylesheet read from a file can contain nul bytes.

During the CSS cascade the stylesheet is applied after the document's own rules (presentation attributes and <style>), so callers can override fills used by symbolic icons. Either order is accepted: the stylesheet may be set before or after the document is loaded.

@import rules are ignored except for data: URLs.

Returns: TRUE on success, FALSE on error.

Since
2.48