[cairo] SVG & PS/EPS surfaces

Bryce Harrington bryce at osg.samsung.com
Sun Aug 2 09:27:28 PDT 2015


On Sun, Aug 02, 2015 at 12:27:58PM +0200, Tomas By wrote:
> Hi all,
> 
> I am making simple drawings (lines/arcs) on SVG surfaces and then
> painting those on PS surfaces which I inlcude in a Latex document.
> 
> Contrary to my expectations, the resulting images are pixellated,
> not vector-based.
> 
> When I open the .ps files I just see a bunch of encoded stuff, not
> lines and arcs.
> 
> Am I doing something wrong? Is there no way to end up with
> vector-based PS/EPS files from Cairo?
> 
> (I am using guile-cairo but I suppose that is just a
> straight-forward mapping to the C API.)
> 
> Grateful for any help.
> 
> /Tomas

Cairo is designed with the expectation that the user wants as perfect
*visual* representation in conversion as possible.  So, when there are
features it knows it can't adequately represent as vectors in the target
output format, it will fallback to rendering out to pixmaps and write
that.  So, most cases of output being non-vector is due to deficiencies
in the feature support of the output format.

With Postscript, people often run into problems when using SVG
transparency (alpha channel), alpha blending, some kinds of gradients,
certain text features, and newer SVG features.  So I'd suggest looking
at simplifying your SVG (in terms of advanced feature use).

Bryce


More information about the cairo mailing list