17 nonstd::span<std::byte const> file_bytes;
19 uint16_t OS2_xHeight = 0;
20 uint16_t OS2_HHeight = 0;
24 nonstd::span<std::byte const> cmapTableBytes;
27 nonstd::span<std::byte const> cmapBytes;
30 nonstd::span<std::byte const> glyfTableBytes;
33 nonstd::span<std::byte const> headTableBytes;
36 bool locaTableIsOffset32;
39 nonstd::span<std::byte const> hheaTableBytes;
43 uint16_t numberOfHMetrics;
46 nonstd::span<std::byte const> hmtxTableBytes;
49 nonstd::span<std::byte const> locaTableBytes;
52 nonstd::span<std::byte const> maxpTableBytes;
56 nonstd::span<std::byte const> nameTableBytes;
59 nonstd::span<std::byte const> postTableBytes;
62 nonstd::span<std::byte const> os2TableBytes;
65 nonstd::span<std::byte const> kernTableBytes;
79 view(
std::move(view)) {
80 file_bytes = this->view->bytes();
84 TrueTypeFont() =
delete;
85 TrueTypeFont(TrueTypeFont
const &other) =
delete;
86 TrueTypeFont &operator=(TrueTypeFont
const &other) =
delete;
87 TrueTypeFont(TrueTypeFont &&other) =
delete;
88 TrueTypeFont &operator=(TrueTypeFont &&other) =
delete;
89 ~TrueTypeFont() =
default;
120 void parseFontDirectory();
125 void parseHeadTable(nonstd::span<std::byte const> headTableBytes);
127 void parseHheaTable(nonstd::span<std::byte const> bytes);
129 void parseNameTable(nonstd::span<std::byte const> bytes);
131 void parseOS2Table(nonstd::span<std::byte const> bytes);
141 void parseMaxpTable(nonstd::span<std::byte const> bytes);
146 bool getGlyphBytes(
GlyphID glyph_id, nonstd::span<std::byte const> &bytes)
const noexcept;
153 bool loadSimpleGlyph(nonstd::span<std::byte const> bytes, Path &glyph)
const noexcept;
163 bool loadCompoundGlyph(nonstd::span<std::byte const> bytes, Path &glyph, GlyphID &metrics_glyph_id)
const noexcept;
172 bool loadCompoundGlyphMetrics(nonstd::span<std::byte const> bytes, GlyphID &metrics_glyph_id)
const noexcept;