Skip to content

Use librsvg directly to load SVG icons

Federico Mena Quintero requested to merge federico/gtk:rsvg-loading into main

This is a first cut at loading icons with librsvg directly. Some notes:

  • All icons should be well-behaved SVGs with width and height in the <svg> element; no "figure out the size by rendering the whole thing first" shenanigans. This gets caught if it happens, and the code produces a GError with which hopefully the callers will do something useful.
  • I haven't de-tangled the wrapper to inject a stylesheet; that's next.
  • The code uses rsvg_handle_set_stylesheet() instead of wrapping the original SVG and adding a <style>.
  • The SVG is parsed only once, instead of one time for each plane plus figuring out the dimensions.

Note: this requires regenerating the container image for the code to compile 😄

I think I managed to push updated fedora:latest and fedora:v38 images with run-docker.sh... which scares me, since I shouldn't have permission to do that?

I don't know how to make the msvc job install librsvg-devel for its build 😞

Edited by Federico Mena Quintero

Merge request reports