Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Text halo not correctly rendered after Cairo scaling #585
In MapOSMatic, we are currently working on a new version of our map rendering engine (still based on Mapnik, of course ;-). We are running into a weird issue with the halo_radius attribute of the TextSymbolizer. It appears the halo is not properly rendered across Cairo scaling, which we didn't do before.
Now, we tell Mapnik to render its map in a "big enough" surface that is then scaled down with Cairo (using CairoContext.scale) to fit into a certain area on the Cairo surface.
I'm not sure how to describe the problem, but the halo (which apparently is a thin white path following the glyph of each letter) doesn't behave properly when rescaled. Attached are screenshots of the PDF and SVG outputs.
We have another problem with text rendering when scaling that only happens when rendering to PNG. I'm not sure if it's related, so I'll create a separate ticket with another screenshot for it.
referenced this issue
Dec 11, 2011
With the following stripped-down and updated version of python snippet from http://220.127.116.11:8000/mapnik_trac/ticket/586 :
With mapnik-2.0.0 and following stripped-down json from previous URL:
And with mapnik git and following json:
This tends to indicate there is a cache-like effect going on. But I didn't get very far trying to find the root cause.
I could manage to work around the bug by disabling the cache in
We didn't benchmark, but I'd bet perfs s(t)ink.
Does it ring any bell to anyone?
That would be great, thanks!