[cairo] null stream pdf surface

Behdad Esfahbod behdad at behdad.org
Tue Aug 24 12:13:38 PDT 2010


I wasn't suggesting any scaling.  Maybe you can explain again what exactly you
are trying to achieve.  What I can guess is that you have a fixed surface
size, and you want to scale the text to exactly fit in?

If that's the problem, I have all the answers since I've done this many times.

behdad

On 08/24/10 14:43, Kozhevnikov Mikhail wrote:
> Hi Behdad,
> 
> Thank for your suggestion! I think that should work great for vector surfaces, but scaling down a png would not look nice (I've tried it out -- see the results attached). The scale factor of 5 I use in the example is not quite realistic, of course, but the conclusion is that apparently we cannot avoid the loss of quality in general case. I think I'll settle with re-rendering until the real meta-surface arrives.
> 
> Cheers, 
> Mikhail.
> 
> 24.08.2010, 21:00, "Behdad Esfahbod" <behdad at behdad.org>:
>> 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