summaryrefslogtreecommitdiff
path: root/src/mbgl/text/glyph.hpp
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-03-11 10:26:19 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-03-13 17:14:53 +0200
commit8be135231d9efe41a3b12037518d02b36104e8cf (patch)
treeefecd5380232f899aed2cd5824dc16f057f0469a /src/mbgl/text/glyph.hpp
parent8a51362bccbd6487dd1ed8518443b16ba6114fd8 (diff)
downloadqtlocation-mapboxgl-8be135231d9efe41a3b12037518d02b36104e8cf.tar.gz
[core] Add possibility of overriding paint properties inside format expression #14062
* [core] Add format override expression and formatted section to evaluation context * [core] Add textColor to TaggedString's formatted section * [core] Add FormatSectionOverrides and introduce overridable properties * [core] Populate symbol layer paint properties for text sections * [core] Add benchmark for style that uses text-color override * [core] Add unit test for FormatOverrideExpression * [core] Add unit test for FormatSectionOverrides
Diffstat (limited to 'src/mbgl/text/glyph.hpp')
-rw-r--r--src/mbgl/text/glyph.hpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mbgl/text/glyph.hpp b/src/mbgl/text/glyph.hpp
index 034784dc24..c97b242c10 100644
--- a/src/mbgl/text/glyph.hpp
+++ b/src/mbgl/text/glyph.hpp
@@ -19,7 +19,7 @@ namespace mbgl {
using GlyphID = char16_t;
using GlyphIDs = std::set<GlyphID>;
-
+
// Note: this only works for the BMP
GlyphRange getGlyphRange(GlyphID glyph);
@@ -59,8 +59,8 @@ using GlyphMap = std::map<FontStackHash, Glyphs>;
class PositionedGlyph {
public:
- explicit PositionedGlyph(GlyphID glyph_, float x_, float y_, bool vertical_, FontStackHash font_, float scale_)
- : glyph(glyph_), x(x_), y(y_), vertical(vertical_), font(font_), scale(scale_)
+ explicit PositionedGlyph(GlyphID glyph_, float x_, float y_, bool vertical_, FontStackHash font_, float scale_, std::size_t sectionIndex_ = 0)
+ : glyph(glyph_), x(x_), y(y_), vertical(vertical_), font(font_), scale(scale_), sectionIndex(sectionIndex_)
{}
GlyphID glyph = 0;
@@ -70,6 +70,8 @@ public:
FontStackHash font = 0;
float scale = 0.0;
+ // Maps positioned glyph to TaggedString section
+ std::size_t sectionIndex;
};
enum class WritingModeType : uint8_t;