7#include "otype_utilities.hpp"
8#include "../utility/module.hpp"
12namespace hi {
inline namespace v1 {
14[[nodiscard]]
inline auto otype_maxp_parse(std::span<std::byte const> bytes)
16 struct header_type_05 {
17 big_uint32_buf_t version;
18 big_uint16_buf_t num_glyphs;
21 struct header_type_10 {
22 big_uint32_buf_t version;
23 big_uint16_buf_t num_glyphs;
24 big_uint16_buf_t max_points;
25 big_uint16_buf_t max_contours;
26 big_uint16_buf_t max_component_points;
27 big_uint16_buf_t max_component_contours;
28 big_uint16_buf_t max_zones;
29 big_uint16_buf_t max_twilight_points;
30 big_uint16_buf_t max_storage;
31 big_uint16_buf_t max_function_defs;
32 big_uint16_buf_t max_instruction_defs;
33 big_uint16_buf_t max_stack_elements;
34 big_uint16_buf_t max_size_of_instructions;
35 big_uint16_buf_t max_component_elements;
36 big_uint16_buf_t max_component_depth;
43 hilet& header = implicit_cast<header_type_05>(bytes);
44 hilet version = *header.version;
45 hi_check(version == 0x00010000 || version == 0x00005000,
"MAXP version must be 0.5 or 1.0");
47 auto r = return_type{};
48 r.num_glyphs = *header.num_glyphs;
#define hi_check(expression, message,...)
Check if the expression is valid, or throw a parse_error.
Definition assert.hpp:110
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11