7#include "otype_utilities.hpp"
8#include "../utility/utility.hpp"
9#include "../macros.hpp"
13hi_export_module(hikogui.font.otype_head);
15hi_export
namespace hi {
inline namespace v1 {
17[[
nodiscard]]
inline auto otype_head_parse(std::span<std::byte const>
bytes)
20 big_uint16_buf_t major_version;
21 big_uint16_buf_t minor_version;
25 big_uint16_buf_t flags;
29 otype_fword_buf_t x_min;
30 otype_fword_buf_t y_min;
31 otype_fword_buf_t x_max;
32 otype_fword_buf_t y_max;
47 hi_check(*
header.major_version == 1
and *
header.minor_version == 0,
"'head' version is not 1.0");
48 hi_check(*
header.magic_number == 0x5f0f3cf5,
"'head' magic is not 0x5f0f3cf5");
54 switch (*
header.index_to_loc_format) {
56 r.loca_is_offset32 =
false;
59 r.loca_is_offset32 =
true;
62 throw parse_error(
"'head' index_to_loc_format must be 0 or 1.");
68 throw parse_error(
"'head' units_per_em must not be 0.0.");
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377