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() ?
[springmeyer] Given this patch usage would be something like:
<?xml version="1.0" encoding="utf-8"?>
<TextSymbolizer name="STATE_ABBR" face_name="Times New Roman Regular" size="12" fill="#000000"></TextSymbolizer><br>
[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.
[springmeyer] this not critical, pushing off till next release...
[springmeyer] r1195 uses similar approach to above patches
[springmeyer] I plan to take a look at this after we can get the 0.7.1 release tested and out in the wild.
[springmeyer] font directory registration functions added in r2025.
ability to trigger these functions via xml added in r2271
[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.