only memcache local fonts if not already globally known and not already cached (avoid extra io for ttc)
This commit is contained in:
parent
887f5a982b
commit
66889d32f9
1 changed files with 9 additions and 4 deletions
|
@ -292,6 +292,10 @@ bool Map::load_fonts()
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
for (auto const& kv : font_file_mapping_)
|
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);
|
mapnik::util::file file(kv.second.second);
|
||||||
if (file.open())
|
if (file.open())
|
||||||
|
@ -300,6 +304,7 @@ bool Map::load_fonts()
|
||||||
if (item.second) result = true;
|
if (item.second) result = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue