summaryrefslogtreecommitdiff
path: root/src/mbgl/text/glyph_atlas.hpp
blob: bb9115e4b40446611b85d048ba550dc91bace191 (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
#pragma once

#include <mbgl/text/glyph.hpp>

#include <mapbox/shelf-pack.hpp>

namespace mbgl {

struct GlyphPosition {
    Rect<uint16_t> rect;
    GlyphMetrics metrics;
};

using GlyphPositionMap = std::map<GlyphID, GlyphPosition>;
using GlyphPositions = std::map<FontStack, GlyphPositionMap>;

class GlyphAtlas {
public:
    AlphaImage image;
    GlyphPositions positions;
};

GlyphAtlas makeGlyphAtlas(const GlyphMap&);

} // namespace mbgl