From 2fc2b4c443393f0d09fff22ed9f45bf9e7371b7f Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 7 Oct 2010 01:49:07 +0000 Subject: [PATCH] add 'font_directory' attribute to map to allow for regstration of fonts within - in combination with r2025 this closes #168 --- CHANGELOG | 2 ++ src/load_map.cpp | 6 ++++++ tests/data/good_maps/rtl_text_map.xml | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 970a661ff..098ee2600 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,8 @@ For a complete change history, see the SVN log. Mapnik Trunk ------------ +- Added ability to register fonts within XML using Map level 'font_directory' parameter (#168) + - TextSymbolizer: Change text_convert to text_transform to better match css naming (r2211) - Shapefile Plugin: Throw error if attribute name is requested that does not exist (#604) diff --git a/src/load_map.cpp b/src/load_map.cpp index f5451e0d4..f8c7e8d52 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -192,6 +192,12 @@ void map_parser::parse_map( Map & map, ptree const & pt ) map.set_buffer_size(*buffer_size); } + optional font_directory = get_opt_attr(map_node,"font_directory"); + if (font_directory) + { + freetype_engine::register_fonts( ensure_relative_to_xml(font_directory), false); + } + // Check if relative paths should be interpreted as relative to/from XML location // Default is true, and map_parser::ensure_relative_to_xml will be called to modify path optional paths_from_xml = get_opt_attr(map_node, "paths_from_xml"); diff --git a/tests/data/good_maps/rtl_text_map.xml b/tests/data/good_maps/rtl_text_map.xml index 4ad024b83..16535378d 100644 --- a/tests/data/good_maps/rtl_text_map.xml +++ b/tests/data/good_maps/rtl_text_map.xml @@ -1,5 +1,5 @@ - +