[cairo] Text output in SVG target
Alan W. Irwin
irwin at beluga.phys.uvic.ca
Mon Jan 7 16:08:49 PST 2008
On 2008-01-07 16:14-0500 Dominic Lachowicz wrote:
> 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.
If there is a lot of text in an SVG file (the case that started this thread),
you are bound to have particular glyphs used more than once in the file.
(For example, the "e" glyph within this post.)
Just out of curiosity do you use the obvious space-saving technique of
storing the glyph paths in a table in the SVG file and using a table look-up
when you need the series of paths to represent the glyph or do you store
duplicate versions of glyph paths when the same glyph is used more than once
in an SVG file?
Note, I am not familiar with the SVG format so I don't know whether tables
and table lookups are even possible, but I am reasoning by analogy with the
PostScript case where you can store the PostScript commands required to
render a glyph in the preamble of the document. This is the approach that
libLASi uses to make use of TrueType fonts from within PostScript. The
resulting PostScript files are bulkier than their Type 1 font counterparts,
but not outrageously so because the only glyphs stored are the ones you
actually use in the file with no duplicates.
So I am wondering if a similar space-saving technique (for the case of
duplicate glyphs) is being used for the SVG backend of cairo?
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
More information about the cairo