[cairo] Text output in SVG target

Hans-Jürgen Koch hjk at linutronix.de
Mon Jan 7 23:48:18 PST 2008


Am Mon, 07 Jan 2008 18:18:06 -0500
schrieb Behdad Esfahbod <behdad at behdad.org>:

> On Mon, 2008-01-07 at 17:46 -0500, Vladimir Vukicevic wrote:
> > 
> > That said, does SVG support specifying explicit glyph IDs?  I'd
> > guess  
> > not, though I think that once we have a good API for pdf text  
> > embedding, it should be possible to specify a flag on a pdf surface
> > to  
> > never embed font paths and assume that the fonts exist on the  
> > destination -- then show_glyphs could use the text info and just  
> > create a <text> node.  It may not be exactly correct, but it may
> > well  
> > be exactly what a lot of people want, especially if they can
> > control which fonts are present.
> 
> Sure, we can have such switches on a per backend basis (same way that
> we will control font embedding settings).  But in the end, this is
> really against cairo's design, which is exactly the same output on all
> backends.  We go well out of our way to support all the funky
> operations in PS backend that doesn't support them natively (same for
> other backends of course), so, embedding text without font doesn't
> sound that appealing to me.

OK, "same output on all backends" is certainly an important goal. But 
in cases where this comes with a large drawback, there should be a
choice. There could be CAIRO_EMBED_FONT and CAIRO_PLAIN_TEXT options
for cairo_font_options_t that have an effect for PS, PDF, and SVG
backends and are ignored otherwise.

With these it'd be the choice of the programmer if he wants smaller
files at the expense of less rendering quality. As a matter of fact, it
very much depends on the application. There's a difference between
rendering a small diagram and rendering a page of pure text.

Thanks,
Hans


More information about the cairo mailing list