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

#include <utility>
#include <cstdint>
#include <unordered_set>
#include <mbgl/util/hash.hpp>

namespace mbgl {

using GlyphRange = std::pair<uint16_t, uint16_t>;

constexpr uint32_t GLYPHS_PER_GLYPH_RANGE = 256;
constexpr uint32_t GLYPH_RANGES_PER_FONT_STACK = 256;

} // end namespace mbgl

namespace std {

template <>
struct hash<mbgl::GlyphRange> {
    std::size_t operator()(const mbgl::GlyphRange& range) const {
        return mbgl::util::hash(range.first, range.second);
    }
};

} // namespace std