summaryrefslogtreecommitdiff
path: root/src/mbgl/text/font.hpp
blob: 9d34b18df103b72a98d75696789eb280ad724e60 (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
29
30
31
#ifndef MBGL_TEXT_FONT
#define MBGL_TEXT_FONT

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

#include <string>

#include <harfbuzz/hb.h>

namespace mbgl {

class Font {
public:
    Font(const std::string &filename);
    ~Font();

    Shaping shape(const std::u32string &text, const float spacing, const vec2<float> &translate);

private:
    void load();

    std::string filename_;
    hb_font_t *font_;
    hb_buffer_t *buffer_;
    unsigned int upem_;
};

} // end namespace mbgl

#endif