fixup fontset error reporting - a likely problem in mapnik2 upgrade - closes #596

This commit is contained in:
Dane Springmeyer 2011-12-20 12:31:38 -08:00
parent 5d46850222
commit 0f0e04e6dc

View file

@ -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());
optional<std::string> face_name = get_opt_attr<std::string>(f, "face-name");
if (face_name)
{
if ( strict_ )
{
ensure_font_face( face_name );
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 )