diff options
Diffstat (limited to 'src/mbgl/style/layers/symbol_layer_impl.cpp')
-rw-r--r-- | src/mbgl/style/layers/symbol_layer_impl.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mbgl/style/layers/symbol_layer_impl.cpp b/src/mbgl/style/layers/symbol_layer_impl.cpp index 753b2fa184..e177391686 100644 --- a/src/mbgl/style/layers/symbol_layer_impl.cpp +++ b/src/mbgl/style/layers/symbol_layer_impl.cpp @@ -1,5 +1,7 @@ #include <mbgl/style/layers/symbol_layer_impl.hpp> +#include <mbgl/util/logging.hpp> + namespace mbgl { namespace style { @@ -12,5 +14,30 @@ bool SymbolLayer::Impl::hasLayoutDifference(const Layer::Impl& other) const { paint.hasDataDrivenPropertyDifference(impl.paint); } +void SymbolLayer::Impl::populateFontStack(std::set<FontStack>& fontStack) const { + if (layout.get<TextField>().isUndefined()) { + return; + } + + layout.get<TextFont>().match( + [&] (Undefined) { + fontStack.insert({"Open Sans Regular", "Arial Unicode MS Regular"}); + }, + [&] (const FontStack& constant) { + fontStack.insert(constant); + }, + [&] (const auto& function) { + for (const auto& value : function.possibleOutputs()) { + if (value) { + fontStack.insert(*value); + } else { + Log::Warning(Event::ParseStyle, "Layer '%s' has an invalid value for text-font and will not render text. Output values must be contained as literals within the expression.", id.c_str()); + break; + } + } + } + ); +} + } // namespace style } // namespace mbgl |