summaryrefslogtreecommitdiff
path: root/src/mbgl/text/font_stack.hpp
blob: 4ca967d7a8faf30b955b12cd51c7e44c4f70721c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef MBGL_TEXT_FONT_STACK
#define MBGL_TEXT_FONT_STACK

#include <mbgl/text/glyph.hpp>
#include <mbgl/util/vec.hpp>

namespace mbgl {

class FontStack {
public:
    void insert(uint32_t id, const SDFGlyph &glyph);
    const std::map<uint32_t, GlyphMetrics> &getMetrics() const;
    const std::map<uint32_t, SDFGlyph> &getSDFs() const;
    const Shaping getShaping(const std::u32string &string, float maxWidth, float lineHeight,
                             float horizontalAlign, float verticalAlign, float justify,
                             float spacing, const vec2<float> &translate) const;
    void lineWrap(Shaping &shaping, float lineHeight, float maxWidth, float horizontalAlign,
                  float verticalAlign, float justify, const vec2<float> &translate) const;

private:
    std::map<uint32_t, std::string> bitmaps;
    std::map<uint32_t, GlyphMetrics> metrics;
    std::map<uint32_t, SDFGlyph> sdfs;
};

} // end namespace mbgl

#endif