| 1 |
#pragma once |
| 2 |
|
| 3 |
#include <QCoreApplication> |
| 4 |
|
| 5 |
#include "glyph.h" |
| 6 |
|
| 7 |
struct hb_blob_t; |
| 8 |
struct hb_face_t; |
| 9 |
struct hb_font_t; |
| 10 |
struct hb_draw_funcs_t; |
| 11 |
|
| 12 |
class HarfBuzzFont |
| 13 |
{ |
| 14 |
Q_DECLARE_TR_FUNCTIONS(HarfBuzzFont) |
| 15 |
|
| 16 |
public: |
| 17 |
HarfBuzzFont(); |
| 18 |
~HarfBuzzFont(); |
| 19 |
|
| 20 |
void open(const QString &path, const quint32 index = 0); |
| 21 |
bool isOpen() const; |
| 22 |
|
| 23 |
Glyph outline(const quint16 gid) const; |
| 24 |
|
| 25 |
void setVariations(const QVector<Variation> &variations); |
| 26 |
|
| 27 |
private: |
| 28 |
void reset(); |
| 29 |
|
| 30 |
private: |
| 31 |
hb_blob_t *m_blob = nullptr; |
| 32 |
hb_face_t *m_face = nullptr; |
| 33 |
hb_font_t *m_font = nullptr; |
| 34 |
}; |