Cairo always hints text #1774

Open
herm opened this Issue Mar 25, 2013 · 3 comments

2 participants

@herm
Mapnik member

Cairo always hints rendered text aligning it to pixel boundaries. This leads to uneven character spacings and bad overall quality.
This problem is definitely present in harfbuzz branch and probably also in master.
Disabling hinting with cairo_font_options_set_hint_style and cairo_font_options_set_hint_metrics doesn't help.

Attached it an example gif where all character should be shifted by 0.1 pixels between the two images. One can see some characters moving 1.0 pixels and others not moving at all. AGG works fine on the same data.

cairo-text

@springmeyer
Mapnik member

Yes, also present in master, or at least in the visual tests I've disabled comparison of agg against cairo results because of this. Instead master visual tests now compare cairo to cairo, simply to avoid regressions and track the impact of fixes. So, you can page through the expected images comparing cairo and agg in master and see this issue pretty clearly.

@herm
Mapnik member

@springmeyer: any idea why this is happening? I'm unable to disable this behavior.

@springmeyer
Mapnik member

No, not looked deeply at it. Bummer it is not obvious to disable. I wonder if it might something specific to the image background in Cairo and not other back ends like PDF/svg. My sense it's the png/image backend to Cairo does not get a ton of love.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment