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

Shield dimensions #4453

Merged
merged 2 commits into from
Aug 29, 2021
Merged

Shield dimensions #4453

merged 2 commits into from
Aug 29, 2021

Conversation

pitdicker
Copy link
Contributor

@pitdicker pitdicker commented Aug 26, 2021

In #4205 I offered to clean up all svg files, and work on the problems that keep some patterns from being usable as vector images.
I have been at it for a couple of weeks, and am mostly there (also working on three related Mapnik issues).
This is the first of three PRs. The rest wil come as time allows ;-)

This PR is a tiny one that only touches the shields.
Previously they were generated with a width and height of 100%. Percentages are allowed by the SVG specification, but don't make much sense. Inkscape, viewers, browsers and Mapnik differ in their interpretation. Is the percentage relative to a screen, the whole map, a tile, or user supplied marker dimensions? Or to implicit image dimensions?

In the case of mapnik it falls back to the width and height of the viewBox, and scales them by the percentage. If the SVG contains no viewBox, it acts as if no width and height are given.

It all doesn't matter much in the end, as the rendering in Mapnik was already as desired. But it was little work to update the shield generation script to Python 3 (no expert by far, but it seems to work), and change it to simply write out the true width and height.

@imagico
Copy link
Collaborator

imagico commented Aug 26, 2021

I have not tested or looked at this in detail yet but it seems solid.

For the patterns - you might want to have a look at http://blog.imagico.de/managing-patterns/ and imagico@00eb1a3 - a lot of the work for generating mapnik compatible pattern SVGs has been done there already. Also not having the colors of the patterns hardcoded in SVG but coloring them via script like demonstrated there would be useful in support of our goal of customizability.

@pnorman pnorman merged commit 6f4c740 into gravitystorm:master Aug 29, 2021
@pitdicker pitdicker deleted the shield_dimensions branch August 30, 2021 06:13
@pitdicker
Copy link
Contributor Author

@imagico Thank you for your quick reply. And I have definitely studied a number of your PRs around patterns, jsdotpattern, your blog and the repo! I'd like to hear your thoughts once the PR is up.

@pnorman This week I can make the other two PRs. At least the first one is hopefully not hard to review, that does some cleanup on the SVG of all symbols. (Only thing left for the first is write a good description.) Maybe worth waiting for with #4454?

@imagico imagico mentioned this pull request Sep 26, 2021
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

Successfully merging this pull request may close these issues.

3 participants