From 0f0e04e6dc787c0325b86324568035aa2cca9ec5 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 20 Dec 2011 12:31:38 -0800 Subject: [PATCH] fixup fontset error reporting - a likely problem in mapnik2 upgrade - closes #596 --- src/load_map.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/load_map.cpp b/src/load_map.cpp index 055948f3d..d7665000b 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -560,14 +560,19 @@ void map_parser::parse_font(font_set & fset, ptree const & f) { ensure_attrs(f, "Font", "face-name"); - std::string face_name = get_attr(f, "face-name", std::string()); - - if ( strict_ ) + optional face_name = get_opt_attr(f, "face-name"); + if (face_name) { - ensure_font_face( face_name ); + if ( strict_ ) + { + ensure_font_face(*face_name); + } + fset.add_face_name(*face_name); + } + else + { + throw config_error(std::string("Must have 'face-name' set")); } - - fset.add_face_name(face_name); } void map_parser::parse_layer( Map & map, ptree const & lay )