Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scale_factor breaks font rendering in 2.1; was ok in 2.0 #1273

Closed
woodpeck opened this issue Jun 29, 2012 · 6 comments
Closed

scale_factor breaks font rendering in 2.1; was ok in 2.0 #1273

woodpeck opened this issue Jun 29, 2012 · 6 comments
Assignees

Comments

@woodpeck
Copy link
Contributor

I'm setting a scale_factor of 2.0 on the agg renderer and this breaks font rendering in Mapnik 2.1. I'm using more or less the standard OSM Mapnik style. A test tile with scale 1.0 look ok:

normal tile

The same tile rendered with scale_factor 2.0 in Mapnik 2.0 (2.0.1+dev20120507.git.7fe677d-1~precise1) looks right (icons are not scaled but that's a different issue):

double-sized tile

However with Mapnik 2.1 (2.1.0+dev20120627.git.d9880ef-1~precise1) I am seeing:

double-sized tile with too small font

It almost looks as if the font rendering engine was reverting to unifont for some reason.

@artemp
Copy link
Member

artemp commented Jun 29, 2012

@woodpeck - should be fixed in bf60dd9

@herm - can you check the fix doesn't break new text placement logic?

@ghost ghost assigned artemp Jun 29, 2012
@herm
Copy link
Member

herm commented Jun 29, 2012

Looks good to me.

@herm herm closed this as completed Jun 29, 2012
@springmeyer
Copy link
Member

This change seems to work in simple tests: basically it has no effect when scale_factor is 1, but when greater now allows larger text rather than just larger spacing. But it broke 4 of the visual tests. @herm - can you see if you can figure out if the tests are valid or if they need to be updated?

@woodpeck
Copy link
Contributor Author

Confirm fixed in my test case as well, using almost-latest trunk (not yet including your above halo fix):

font now correct again

Thank you!

@springmeyer
Copy link
Member

Great to hear @woodpeck! Thanks for reporting.

@herm
Copy link
Member

herm commented Jun 29, 2012

Sorry, my last comment was wrong. The line in font_engine_freetype.cpp is actually needed. What the code does is:

  • Calculate the size of all characters (which might have different font sizes) and pass them to placement finder so it doesn't have to ask freetype again and again.
  • Find placement
  • Render all characters at their calculated positions with the correct font size.

If you don't set the font size in the last step you end up with all characters being the size of the last character.

herm added a commit that referenced this issue Jun 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants