[cairo] null stream pdf surface

Behdad Esfahbod behdad at behdad.org
Tue Aug 24 10:00:33 PDT 2010


On 08/23/10 20:20, Kozhevnikov Mikhail wrote:
> Hi,
> 
> I'm trying to draw a graph with textual labels so as to fit exactly the size of the image requested by the user -- that is, the content should touch the border in at least one dimension. I thought of rendering the stuff into a metasurface, and then, knowing the size of the result, transform it and embed into the target image, which is a png, usually. However, when doing so I notice the text looks a bit worse (see example attached). Is it supposed to go like this?
> I can just re-render the content into he target surface directly, but that would require some more changes to the code in order to be efficient.

I suggest that you always create a temp surface of the same type as your final
target.  Font settings defaults differ from surface type to surface type...
You can create a 0x0 temp surface.  Works just as well.

Cheers,
behdad


> Cheers, 
> Mikhail.


More information about the cairo mailing list