[cairo] Text output in SVG target

Dominic Lachowicz domlachowicz at gmail.com
Mon Jan 7 13:14:48 PST 2008

Hi Hans,

On Jan 7, 2008 1:17 PM, Hans-Jürgen Koch <hjk at linutronix.de> wrote:
> Question: Is there really no way to embed simple text in an SVG file,
> or did I miss something? Just to be clear, I think of something like
> this:

No, there isn't. Cairo passes the glyph information to the backend,
not the text.

> <text x="100" y="150" font-family="Verdana" font-size="35">
> Hello world!
> </text>
> If Cairo cannot produce such output at the moment, would it be possible
> to add, or is it completely against some Cairo concepts?

It should eventually be possible.

SVG fonts aren't widely-supported by the more popular renderers. Nor
are embedded CSS fonts.

The best solution for getting reasonably accurate, portable output
that looks the same across viewers and regardless of what fonts are
installed is to embed the glyph as a series of paths. Of course, this
comes at the expense of the file's size and human-readability.


More information about the cairo mailing list