only memcache local fonts if not already globally known and not already cached (avoid extra io for ttc)

This commit is contained in:
Dane Springmeyer 2014-10-02 00:47:32 -07:00
parent 887f5a982b
commit 66889d32f9

View file

@ -292,6 +292,10 @@ bool Map::load_fonts()
{
bool result = false;
for (auto const& kv : font_file_mapping_)
{
auto const& global_mapping = freetype_engine::get_mapping();
if ((global_mapping.find(kv.first) == global_mapping.end()) &&
(font_memory_cache_.find(kv.second.second) == font_memory_cache_.end()))
{
mapnik::util::file file(kv.second.second);
if (file.open())
@ -300,6 +304,7 @@ bool Map::load_fonts()
if (item.second) result = true;
}
}
}
return result;
}