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

Ability to register fonts within XML #168

Closed
artemp opened this issue Oct 11, 2011 · 7 comments
Closed

Ability to register fonts within XML #168

artemp opened this issue Oct 11, 2011 · 7 comments
Milestone

Comments

@artemp
Copy link
Member

artemp commented Oct 11, 2011

Registering fonts, or whole directories of fonts, should be possible via the xml mapfile.

The attached patch enables registration of a specific font file within load_map(), but perhaps there are better ways of doing this.

Also, any thoughts on a better attribute name, whether registration should happen in another element (maybe ), and how to get a list of registered fonts to serialize in save_map() ?

@artemp
Copy link
Member Author

artemp commented Oct 11, 2011

[springmeyer] Given this patch usage would be something like:

{{{

<Style name="states_shp_labels"> </Style> }}}

@artemp
Copy link
Member Author

artemp commented Oct 11, 2011

[springmeyer] I took a crack at writing up some functions to try to load all fonts within a given directory. It seems to work somewhat, but I've managed to get both bus errors and segmentation faults :)

Perhaps its generally a bad idea to allow wholesale registration of multiple fonts within a directory in c++, but it seems to work fine via glob in python, so hopefully someone can improve and fix my faulty code.

Attached patch add methods to register all .ttf and .otf fonts in a given directory and includes testing print statements.

@artemp
Copy link
Member Author

artemp commented Oct 11, 2011

[springmeyer] this not critical, pushing off till next release...

@artemp
Copy link
Member Author

artemp commented Oct 11, 2011

[springmeyer] r1195 uses similar approach to above patches

@artemp
Copy link
Member Author

artemp commented Oct 11, 2011

[springmeyer] I plan to take a look at this after we can get the 0.7.1 release tested and out in the wild.

@artemp
Copy link
Member Author

artemp commented Oct 11, 2011

[springmeyer] font directory registration functions added in r2025.
ability to trigger these functions via xml added in r2271

@artemp
Copy link
Member Author

artemp commented Oct 11, 2011

[springmeyer] r2273 finishes this up by storing the 'font_directory' in a mapnik::parameter on the map object so that this can be properly serialized with save_map and not lost in translation.

@artemp artemp closed this as completed Oct 11, 2011
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

1 participant