Пример #1
0
bool Map::insert_fontset(std::string const& name, font_set const& fontset)
{
    if (fontset.get_name() != name)
    {
        throw mapnik::config_error("Fontset name must match the name used to reference it on the map");
    }
    return fontsets_.emplace(name, fontset).second;
}
Пример #2
0
face_set_ptr face_manager::get_face_set(font_set const& fset)
{
    std::vector<std::string> const& names = fset.get_face_names();
    face_set_ptr face_set = std::make_unique<font_face_set>();
    for (auto const& name : names)
    {
        face_ptr face = get_face(name);
        if (face)
        {
            face_set->add(face);
        }
#ifdef MAPNIK_LOG
        else
        {
            MAPNIK_LOG_DEBUG(font_engine_freetype)
                << "Failed to find face '" << name
                << "' in font set '" << fset.get_name() << "'\n";
        }
#endif
    }
    return face_set;
}
Пример #3
0
face_set_ptr face_manager<T>::get_face_set(const font_set &fset)
{
    std::vector<std::string> const& names = fset.get_face_names();
    face_set_ptr face_set = std::make_shared<font_face_set>();
    for (std::vector<std::string>::const_iterator name = names.begin(); name != names.end(); ++name)
    {
        face_ptr face = get_face(*name);
        if (face)
        {
            face_set->add(face);
        }
#ifdef MAPNIK_LOG
        else
        {
            MAPNIK_LOG_DEBUG(font_engine_freetype)
                    << "Failed to find face '" << *name
                    << "' in font set '" << fset.get_name() << "'\n";
        }
#endif
    }
    return face_set;
}
Пример #4
0
 static boost::python::tuple
 getinitargs(const font_set& fs)
 {
     return boost::python::make_tuple(fs.get_name());
 }