Remove unused files.
This commit is contained in:
parent
fdc4df3fc5
commit
d2918590b5
2 changed files with 0 additions and 148 deletions
|
@ -1,62 +0,0 @@
|
||||||
/*****************************************************************************
|
|
||||||
*
|
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
|
||||||
*
|
|
||||||
* Copyright (C) 2012 Artem Pavlenko
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
*****************************************************************************/
|
|
||||||
#ifndef PROCESSED_TEXT_HPP
|
|
||||||
#define PROCESSED_TEXT_HPP
|
|
||||||
|
|
||||||
// mapnik
|
|
||||||
#include <mapnik/text_properties.hpp>
|
|
||||||
#include <mapnik/font_engine_freetype.hpp>
|
|
||||||
#include <mapnik/text_path.hpp>
|
|
||||||
|
|
||||||
namespace mapnik
|
|
||||||
{
|
|
||||||
|
|
||||||
class processed_text : boost::noncopyable
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
class processed_expression
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
processed_expression(char_properties_ptr properties, UnicodeString const& text) :
|
|
||||||
p(properties), str(text) {}
|
|
||||||
char_properties p;
|
|
||||||
UnicodeString str;
|
|
||||||
};
|
|
||||||
public:
|
|
||||||
processed_text(face_manager<freetype_engine> & font_manager, double scale_factor);
|
|
||||||
void push_back(char_properties_ptr properties, UnicodeString const& text);
|
|
||||||
unsigned size() const { return expr_list_.size(); }
|
|
||||||
unsigned empty() const { return expr_list_.empty(); }
|
|
||||||
void clear();
|
|
||||||
typedef std::list<processed_expression> expression_list;
|
|
||||||
expression_list::const_iterator begin() const;
|
|
||||||
expression_list::const_iterator end() const;
|
|
||||||
string_info &get_string_info();
|
|
||||||
private:
|
|
||||||
expression_list expr_list_;
|
|
||||||
face_manager<freetype_engine> &font_manager_;
|
|
||||||
double scale_factor_;
|
|
||||||
string_info info_;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // ns mapnik
|
|
||||||
#endif // PROCESSED_TEXT_HPP
|
|
|
@ -1,86 +0,0 @@
|
||||||
/*****************************************************************************
|
|
||||||
*
|
|
||||||
* This file is part of Mapnik (c++ mapping toolkit)
|
|
||||||
*
|
|
||||||
* Copyright (C) 2012 Artem Pavlenko
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
#include <mapnik/processed_text.hpp>
|
|
||||||
#include <mapnik/config_error.hpp>
|
|
||||||
|
|
||||||
namespace mapnik
|
|
||||||
{
|
|
||||||
|
|
||||||
void processed_text::push_back(char_properties_ptr properties, UnicodeString const& text)
|
|
||||||
{
|
|
||||||
expr_list_.push_back(processed_expression(properties, text));
|
|
||||||
}
|
|
||||||
|
|
||||||
processed_text::expression_list::const_iterator processed_text::begin() const
|
|
||||||
{
|
|
||||||
return expr_list_.begin();
|
|
||||||
}
|
|
||||||
|
|
||||||
processed_text::expression_list::const_iterator processed_text::end() const
|
|
||||||
{
|
|
||||||
return expr_list_.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
processed_text::processed_text(face_manager<freetype_engine> & font_manager, double scale_factor)
|
|
||||||
: font_manager_(font_manager), scale_factor_(scale_factor)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void processed_text::clear()
|
|
||||||
{
|
|
||||||
info_.clear();
|
|
||||||
expr_list_.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
string_info &processed_text::get_string_info()
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
info_.clear(); //if this function is called twice invalid results are returned, so clear string_info first
|
|
||||||
expression_list::iterator itr = expr_list_.begin();
|
|
||||||
expression_list::iterator end = expr_list_.end();
|
|
||||||
for (; itr != end; ++itr)
|
|
||||||
{
|
|
||||||
char_properties const &p = itr->p;
|
|
||||||
face_set_ptr faces = font_manager_.get_face_set(p.face_name, p.fontset);
|
|
||||||
if (faces->size() == 0)
|
|
||||||
{
|
|
||||||
if (!p.fontset.get_name().empty())
|
|
||||||
{
|
|
||||||
throw config_error("Unable to find specified font set '" + p.fontset.get_name() + "'");
|
|
||||||
} else if (!p.face_name.empty()) {
|
|
||||||
throw config_error("Unable to find specified font face '" + p.face_name + "'");
|
|
||||||
} else {
|
|
||||||
throw config_error("Both font set and face name are empty!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
faces->set_character_sizes(p.text_size * scale_factor_);
|
|
||||||
faces->get_string_info(info_, itr->str, &(itr->p));
|
|
||||||
info_.add_text(itr->str);
|
|
||||||
}
|
|
||||||
return info_;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
} //ns mapnik
|
|
Loading…
Reference in a new issue