[GRASS-dev] raster offset with cairo driver

Glynn Clements glynn at gclements.plus.com
Thu Nov 22 14:06:19 EST 2007


Hamish wrote:

> I'm trying out the new Cairo driver. To make things easier I just
> added support for it to d.out.file: use the -c flag with a raster
> image format.
> 
> As AFAICT there is no user documentation, so I also added a small wiki
> page for it: http://grass.gdf-hannover.de/wiki/Cairo_driver
> 
> It is missing a display/drivers/cairo/description.html page, modeled
> after the equivalent PNG driver page.
> 
> 
> There's a problem in that the raster data is being rendered offset vs. 
> the vector data. For a window with the same aspect ratio as the region
> it seems to line up ok. Else, not.

The code overlooks the fact that the top-left coordinates are
subjected to the scaling.

I should have a fix shortly.

> There's another problem with fonts- True/FreeType fonts gets scrambled.
> This reminds me of a long ago bug in d.text.freetype, fixed in rev 1.42.
> "use correct pitch for reading bitmap buffer & fix scrambled letters"
>  http://freegis.org/cgi-bin/viewcvs.cgi/grass6/display/d.text.freetype/main.c
> 
> example:  http://bambi.otago.ac.nz/hamish/grass/bugs/sf_cairo2.png
>  (d.* commands given on the above wiki page)

I was looking into this; it appears that I forgot about it.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list