lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: require librsvg to implement SVG image support


From: Han-Wen Nienhuys
Subject: Re: RFC: require librsvg to implement SVG image support
Date: Tue, 10 Jan 2023 23:25:16 +0100

On Mon, Jan 9, 2023 at 7:45 PM Jonas Hahnfeld <hahnjo@hahnjo.de> wrote:
>
> On Sun, 2023-01-08 at 23:18 +0100, Jean Abou Samra wrote:
> > In order to keep support for vector graphics, even if not
> > with EPS, we can add support for embedding SVG images.
>
> Are we sure that this is actually what the users need? If everybody
> just cares about including PDF (for logos), I'm not sure if we need to
> implement support for SVG.

PDF has much more features than SVG, so it's not obvious that that
will be easier, and if we want to ingest the PDF graphic for output to
SVG/PNG/PS, we'll have to interpret the PDF data, basically doing what
Poppler does.

I posted a question on stackoverflow,
https://stackoverflow.com/questions/75076381/embedding-pdf-graphics-in-pdf-output-file-programmatically,
maybe that will bring us some light.

I looked at LuaTeX and it comes with a library for reading PDF
(pplib), which looks small and self-contained. However, it may be that
they can avoid looking too deeply into the PDF contents, because their
output is always PDF too. However, we'd need a Cairo feature to dump
PDF data directly into the output stream.

> Another question would be about support in the default PS backend: Is
> this feasible for SVGs? Would we again export the rendering from Cairo
> and then paste into the output PS?

Yes, that should not be too hard. cairo_ps_surface_create_for_stream()
will write to a in-memory stream.

> > This requires the ability to render an SVG to a Cairo
> > surface. Cairo doesn't do this itself. It is the job of
> > the librsvg library, which is part of the GNOME stack
> > (like GLib and Pango which we already require).
> >
> > There is also PDF, which could be made to work via Poppler.
> > However, it is built with CMake, for which the release
> > infrastructure does not have support so far. Jonas said
> > cross-compilation was difficult with CMake, and I believe
> > him.
>
> Cross-compilation is always difficult, and what I was trying to say is
> that the scripts in release/binaries/ currently don't support CMake.
> Cross-compilation with CMake is sometimes a pain because IIRC it
> doesn't really support the notion if different targets for host and
> build, so something like a tools build for execution during the build
> is not really possible. I don't know about Poppler, maybe it doesn't
> have any such problems.

we'd have to look. I was surprised at
https://www.linuxfromscratch.org/blfs/view/svn/general/poppler.html ;
the required dependencies are modest.

-- 
Han-Wen Nienhuys - hanwenn@gmail.com - http://www.xs4all.nl/~hanwen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]