7#include "otype_utilities.hpp"
8#include "../utility/utility.hpp"
9#include "../macros.hpp"
13hi_export_module(hikogui.font.maxp);
15hi_export
namespace hi {
inline namespace v1 {
17[[nodiscard]]
inline auto otype_maxp_parse(std::span<std::byte const> bytes)
19 struct header_type_05 {
20 big_uint32_buf_t version;
21 big_uint16_buf_t num_glyphs;
24 struct header_type_10 {
25 big_uint32_buf_t version;
26 big_uint16_buf_t num_glyphs;
27 big_uint16_buf_t max_points;
28 big_uint16_buf_t max_contours;
29 big_uint16_buf_t max_component_points;
30 big_uint16_buf_t max_component_contours;
31 big_uint16_buf_t max_zones;
32 big_uint16_buf_t max_twilight_points;
33 big_uint16_buf_t max_storage;
34 big_uint16_buf_t max_function_defs;
35 big_uint16_buf_t max_instruction_defs;
36 big_uint16_buf_t max_stack_elements;
37 big_uint16_buf_t max_size_of_instructions;
38 big_uint16_buf_t max_component_elements;
39 big_uint16_buf_t max_component_depth;
46 auto const& header = implicit_cast<header_type_05>(bytes);
47 auto const version = *header.version;
48 hi_check(version == 0x00010000 || version == 0x00005000,
"MAXP version must be 0.5 or 1.0");
50 auto r = return_type{};
51 r.num_glyphs = *header.num_glyphs;
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20