summaryrefslogtreecommitdiff
path: root/include/mbgl/style/expression/formatted.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/style/expression/formatted.hpp')
-rw-r--r--include/mbgl/style/expression/formatted.hpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/mbgl/style/expression/formatted.hpp b/include/mbgl/style/expression/formatted.hpp
index 9e7e7308cb..f4f08e9197 100644
--- a/include/mbgl/style/expression/formatted.hpp
+++ b/include/mbgl/style/expression/formatted.hpp
@@ -1,9 +1,9 @@
#pragma once
#include <mbgl/style/conversion.hpp>
+#include <mbgl/util/color.hpp>
#include <mbgl/util/font_stack.hpp>
#include <mbgl/util/optional.hpp>
-#include <mbgl/util/variant.hpp>
#include <vector>
#include <string>
@@ -12,15 +12,25 @@ namespace mbgl {
namespace style {
namespace expression {
+extern const char* const kFormattedSectionFontScale;
+extern const char* const kFormattedSectionTextFont;
+extern const char* const kFormattedSectionTextColor;
+
struct FormattedSection {
- FormattedSection(std::string text_, optional<double> fontScale_, optional<FontStack> fontStack_)
+ FormattedSection(std::string text_,
+ optional<double> fontScale_,
+ optional<FontStack> fontStack_,
+ optional<Color> textColor_)
: text(std::move(text_))
, fontScale(std::move(fontScale_))
, fontStack(std::move(fontStack_))
+ , textColor(std::move(textColor_))
{}
+
std::string text;
optional<double> fontScale;
optional<FontStack> fontStack;
+ optional<Color> textColor;
};
class Formatted {
@@ -28,7 +38,7 @@ public:
Formatted() = default;
Formatted(const char* plainU8String) {
- sections.emplace_back(std::string(plainU8String), nullopt, nullopt);
+ sections.emplace_back(std::string(plainU8String), nullopt, nullopt, nullopt);
}
Formatted(std::vector<FormattedSection> sections_)