diff --git a/include/mapnik/text/layout.hpp b/include/mapnik/text/layout.hpp index 966aa6e7d..a3ef49a2c 100644 --- a/include/mapnik/text/layout.hpp +++ b/include/mapnik/text/layout.hpp @@ -85,7 +85,7 @@ public: text_layout(face_manager_freetype & font_manager); inline void add_text(UnicodeString const& str, char_properties_ptr format) { - itemizer.add_text(str, format); + itemizer_.add_text(str, format); } void layout(double wrap_width, unsigned text_ratio); @@ -107,9 +107,9 @@ private: face_manager_freetype &font_manager_; //processing - text_itemizer itemizer; + text_itemizer itemizer_; /// Maps char index (UTF-16) to width. If multiple glyphs map to the same char the sum of all widths is used - std::map width_map; + std::map width_map_; double width_; double height_; diff --git a/src/text/layout.cpp b/src/text/layout.cpp index 9bc71d3c6..b96119c13 100644 --- a/src/text/layout.cpp +++ b/src/text/layout.cpp @@ -38,14 +38,14 @@ namespace mapnik { text_layout::text_layout(face_manager_freetype &font_manager) - : font_manager_(font_manager), itemizer(), width_(0), height_(0), lines_() + : font_manager_(font_manager), itemizer_(), width_(0), height_(0), lines_() { } void text_layout::layout(double wrap_width, unsigned text_ratio) { - text_line_ptr line = boost::make_shared(0, itemizer.get_text().length()); - shape_text(line, 0, itemizer.get_text().length()); //Process full text + text_line_ptr line = boost::make_shared(0, itemizer_.get_text().length()); + shape_text(line, 0, itemizer_.get_text().length()); //Process full text break_line(line, wrap_width, text_ratio); //Break line if neccessary if (lines_.size()) { @@ -71,7 +71,7 @@ void text_layout::break_line(text_line_ptr line, double wrap_width, unsigned tex for (double i = 1.0; ((wrap_at = string_width/i)/(string_height*i)) > text_ratio && (string_width/i) > wrap_width; i += 1.0) ; } - UnicodeString const& text = itemizer.get_text(); + UnicodeString const& text = itemizer_.get_text(); Locale locale; //TODO: Is the default constructor correct? UErrorCode status = U_ZERO_ERROR; BreakIterator *breakitr = BreakIterator::createLineInstance(locale, status); @@ -83,8 +83,8 @@ void text_layout::break_line(text_line_ptr line, double wrap_width, unsigned tex for (unsigned i=0; i::const_iterator width_itr = width_map.find(i); - if (width_itr != width_map.end()) + std::map::const_iterator width_itr = width_map_.find(i); + if (width_itr != width_map_.end()) { current_line_length += width_itr->second; } @@ -112,13 +112,13 @@ void text_layout::break_line(text_line_ptr line, double wrap_width, unsigned tex void text_layout::shape_text(text_line_ptr line, unsigned start, unsigned end) { - UnicodeString const& text = itemizer.get_text(); + UnicodeString const& text = itemizer_.get_text(); size_t length = end - start; line->reserve(length); //Preallocate memory - std::list const& list = itemizer.itemize(start, end); + std::list const& list = itemizer_.itemize(start, end); std::list::const_iterator itr = list.begin(), list_end = list.end(); for (; itr != list_end; itr++) { @@ -148,7 +148,7 @@ void text_layout::shape_text(text_line_ptr line, unsigned start, unsigned end) tmp.format = itr->format; face->glyph_dimensions(tmp); - width_map[glyphs[i].cluster] += tmp.width; + width_map_[glyphs[i].cluster] += tmp.width; line->add_glyph(tmp); // std::cout << "glyph:" << glyphs[i].mask << " xa:" << positions[i].x_advance << " ya:" << positions[i].y_advance << " xo:" << positions[i].x_offset << " yo:" << positions[i].y_offset << "\n"; @@ -158,7 +158,7 @@ void text_layout::shape_text(text_line_ptr line, unsigned start, unsigned end) void text_layout::clear() { - itemizer.clear(); + itemizer_.clear(); lines_.clear(); }