#pragma once #include #include #include #define TTFP_VARIABLE_FONTS #include #include "glyph.h" class TtfParserFont { Q_DECLARE_TR_FUNCTIONS(TtfParserFont) public: TtfParserFont(); void open(const QString &path, const quint32 index = 0); bool isOpen() const; FontInfo fontInfo() const; Glyph outline(const quint16 gid) const; QVector loadVariations(); void setVariations(const QVector &variations); private: struct FreeCPtr { void operator()(void* x) { free(x); } }; QByteArray m_fontData; std::unique_ptr m_face; };