Changeset 807
- Timestamp:
- 01/17/09 15:18:41 (19 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
include/mapnik/map.hpp (modified) (2 diffs)
-
src/font_set.cpp (modified) (1 diff)
-
src/map.cpp (modified) (1 diff)
-
src/save_map.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/mapnik/map.hpp
r796 r807 77 77 typedef std::map<std::string,feature_type_style>::const_iterator const_style_iterator; 78 78 typedef std::map<std::string,feature_type_style>::iterator style_iterator; 79 typedef std::map<std::string,FontSet>::const_iterator const_fontset_iterator; 80 typedef std::map<std::string,FontSet>::iterator fontset_iterator; 79 81 80 82 /*! \brief Default constructor. … … 170 172 FontSet const& find_fontset(std::string const& name) const; 171 173 174 /*! \brief Get all fontsets 175 * @return Const reference to fontsets 176 */ 177 std::map<std::string,FontSet> const& fontsets() const; 178 179 /*! \brief Get all fontsets 180 * @return Non-constant reference to fontsets 181 */ 182 std::map<std::string,FontSet> & fontsets(); 183 172 184 /*! \brief Get number of all layers. 173 185 */ -
trunk/src/font_set.cpp
r713 r807 32 32 { 33 33 FontSet::FontSet() 34 : name_(" default") {}34 : name_("") {} 35 35 36 36 FontSet::FontSet(std::string const& name) -
trunk/src/map.cpp
r796 r807 126 126 } 127 127 128 std::map<std::string,FontSet> const& Map::fontsets() const 129 { 130 return fontsets_; 131 } 132 133 std::map<std::string,FontSet> & Map::fontsets() 134 { 135 return fontsets_; 136 } 137 128 138 boost::optional<feature_type_style const&> Map::find_style(std::string const& name) const 129 139 { -
trunk/src/save_map.cpp
r796 r807 216 216 set_attr( node, "face_name", face_name ); 217 217 } 218 218 const std::string & fontset_name = sym.get_fontset().get_name(); 219 if ( ! fontset_name.empty() ) { 220 set_attr( node, "fontset_name", fontset_name ); 221 } 222 219 223 set_attr( node, "size", sym.get_text_size() ); 220 224 set_attr( node, "fill", sym.get_fill() ); … … 345 349 } 346 350 351 void serialize_fontset( ptree & map_node, Map::const_fontset_iterator fontset_it ) 352 { 353 const FontSet & fontset = fontset_it->second; 354 const std::string & name = fontset_it->first; 355 356 ptree & fontset_node = map_node.push_back( 357 ptree::value_type("FontSet", ptree()))->second; 358 359 set_attr(fontset_node, "name", name); 360 361 std::vector<std::string>::const_iterator it = fontset.get_face_names().begin(); 362 std::vector<std::string>::const_iterator end = fontset.get_face_names().end(); 363 for (; it != end; ++it) 364 { 365 ptree & font_node = fontset_node.push_back( 366 ptree::value_type("Font", ptree()))->second; 367 set_attr(font_node, "face_name", *it); 368 } 369 370 } 371 347 372 void serialize_datasource( ptree & layer_node, datasource_ptr datasource) 348 373 { … … 435 460 } 436 461 462 { 463 Map::const_fontset_iterator it = map.fontsets().begin(); 464 Map::const_fontset_iterator end = map.fontsets().end(); 465 for (; it != end; ++it) 466 { 467 serialize_fontset( map_node, it); 468 } 469 } 470 437 471 Map::const_style_iterator it = map.styles().begin(); 438 472 Map::const_style_iterator end = map.styles().end();
