GnomeCanvasText transformations on GDK canvas



Hi,

Currently the text canvas item is lacking in affine support. The most
visible problem is that affine transformations are simply ignored in GDK
mode. The other problem is that in AA mode, text is guaranteed to look
ugly as the result since it is first rendered and then scaled/transformed.

I think the good solution would be to render the text at
fontsize*maxratio, and then do the transformation on this, because
scaling the font renderer's output is a very lossy operation (the font
is (hopefully) in vector format but the font renderer's output is
rasterized). I.e. if the text item is to be rendered at 5.0x3.5 size and
rotated -40 degrees, the text should first be rendered into a pixbuf with
fontsize=5*original size, and then the vertical scaling and rotating be
done by GdkPixbuf (for the GDK canvas).
Transformations are currently done by libart for the AA canvas, and it
works but the fonts look horrible when zoomed, so this too could use this
method of `oversampling' the text rendering, I think.

However, as Ankh mentioned on #gnome, there may be X servers that support
affine transformations on fonts, so maybe the whole transformation could
be done by the font renderer. Also, according to Owen, rendering to a
temporary pixmap then loading it into a pixbuf then transforming it and
then rendering it into the canvas drawable is going to be slow.

So where should the transformation occur?

-- 
   .--= ULLA! =---------------------.   `We are not here to give users what
   \     http://cactus.rulez.org     \   they want'  -- RMS, at GUADEC 2001
    `---= cactus cactus rulez org =---'
'Szörnyű itt a koszt.'  'És milyen kicsik az adagok!'





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]