Files
MapLibreParticleLab/src/mbgl/text/harfbuzz_impl.hpp
2025-07-29 22:00:27 +02:00

37 lines
791 B
C++

#pragma once
#include "freetype.hpp"
#include "harfbuzz.hpp"
#include <map>
struct hb_font_t;
struct hb_buffer_t;
using hb_font_t = hb_font_t;
using hb_buffer_t = hb_buffer_t;
namespace mbgl {
class HBShaper::Impl {
public:
explicit Impl(GlyphIDType type_, const std::string &fontFileData, const FreeTypeLibrary &lib);
~Impl();
void createComplexGlyphIDs(const std::u16string &text,
std::vector<GlyphID> &glyphIDs,
std::vector<HBShapeAdjust> &adjusts);
Glyph rasterizeGlyph(const GlyphID &glyph) { return face.rasterizeGlyph(glyph); }
bool valid() { return face.isValid(); }
private:
GlyphIDType type;
FreeTypeFace face;
hb_font_t *font;
hb_buffer_t *buffer;
};
} // namespace mbgl