diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-01-25 15:24:29 -0800 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-01-25 17:21:18 -0800 |
commit | 191c0124c7f167a5da90acb958e088e1e3e46b08 (patch) | |
tree | fa5dfd846fcb59c618589b0505a568e569c6fc9c /src | |
parent | c148a7a0616568b0ae82ab8dc89c1c096af10537 (diff) | |
download | qtlocation-mapboxgl-191c0124c7f167a5da90acb958e088e1e3e46b08.tar.gz |
[core] don't force downloading of Open Sans fonts
When a SymbolLayer doesn't have a text-font defined, we automatically add Open Sans/Arial Unicode MS. However, when the SymbolLayer is only used for rendering icons, it doesn't have text-field defined either. In those cases, we still force downloading Open Sans/Arial Unicode MS during offline pack creation. If the user doesn't use this font, this change should save ~15MB and a few seconds in download time.
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/style/parser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mbgl/style/parser.cpp b/src/mbgl/style/parser.cpp index b177f2159c..8d14d7972c 100644 --- a/src/mbgl/style/parser.cpp +++ b/src/mbgl/style/parser.cpp @@ -277,7 +277,7 @@ std::vector<FontStack> Parser::fontStacks() const { std::set<FontStack> result; for (const auto& layer : layers) { - if (layer->is<SymbolLayer>()) { + if (layer->is<SymbolLayer>() && !layer->as<SymbolLayer>()->getTextField().isUndefined()) { layer->as<SymbolLayer>()->getTextFont().match( [&] (Undefined) { result.insert({"Open Sans Regular", "Arial Unicode MS Regular"}); |