diff --git a/include/mapnik/enumeration.hpp b/include/mapnik/enumeration.hpp index 935d2f8e2..69e81e946 100644 --- a/include/mapnik/enumeration.hpp +++ b/include/mapnik/enumeration.hpp @@ -30,6 +30,7 @@ #include #include #include +#include namespace mapnik { @@ -176,9 +177,11 @@ public: * */ void from_string(std::string const& str) { + std::string str_copy(str); + std::replace(str_copy.begin(), str_copy.end(), '_', '-'); for (unsigned i = 0; i < THE_MAX; ++i) { - if (str == our_strings_[i]) + if (str_copy == our_strings_[i]) { value_ = static_cast(i); return; diff --git a/include/mapnik/text/placement_finder.hpp b/include/mapnik/text/placement_finder.hpp index 5069dc33f..9a6c439e4 100644 --- a/include/mapnik/text/placement_finder.hpp +++ b/include/mapnik/text/placement_finder.hpp @@ -76,7 +76,7 @@ private: bool collision(box2d const& box, const value_unicode_string &repeat_key, bool line_placement) const; // Adds marker to glyph_positions and to collision detector. Returns false if there is a collision. bool add_marker(glyph_positions_ptr glyphs, pixel_position const& pos) const; - // Maps upright==auto, left_only and right_only to left,right to simplify processing. + // Maps upright==auto, left-only and right-only to left,right to simplify processing. // angle = angle of at start of line (to estimate best option for upright==auto) text_upright_e simplify_upright(text_upright_e upright, double angle) const; box2d get_bbox(text_layout const& layout, glyph_info const& glyph, pixel_position const& pos, rotation const& rot); diff --git a/src/symbolizer_enumerations.cpp b/src/symbolizer_enumerations.cpp index dfa91860d..9632d10df 100644 --- a/src/symbolizer_enumerations.cpp +++ b/src/symbolizer_enumerations.cpp @@ -35,7 +35,7 @@ IMPLEMENT_ENUM( line_cap_e, line_cap_strings ) static const char * line_join_strings[] = { "miter", - "miter_revert", + "miter-revert", "round", "bevel", "" @@ -171,8 +171,8 @@ static const char * text_upright_strings[] = { "auto-down", "left", "right", - "left_only", - "right_only", + "left-only", + "right-only", "" }; IMPLEMENT_ENUM(text_upright_e, text_upright_strings) diff --git a/src/text/placement_finder.cpp b/src/text/placement_finder.cpp index 2c3b5a806..169cc24ef 100644 --- a/src/text/placement_finder.cpp +++ b/src/text/placement_finder.cpp @@ -300,7 +300,7 @@ bool placement_finder::single_line_placement(vertex_cache &pp, text_upright_e or begin.restore(); return single_line_placement(pp, real_orientation == UPRIGHT_RIGHT ? UPRIGHT_LEFT : UPRIGHT_RIGHT); } - // upright==left_only or right_only and more than 50% of characters upside down => no placement + // upright==left-only or right-only and more than 50% of characters upside down => no placement else if (orientation == UPRIGHT_LEFT_ONLY || orientation == UPRIGHT_RIGHT_ONLY) { return false;