7#include "otype_utilities.hpp"
8#include "../utility/module.hpp"
15template<fixed_
string Name>
16[[nodiscard]]
inline std::span<std::byte const> otype_sfnt_search(std::span<std::byte const> bytes)
19 big_uint32_buf_t scaler_type;
20 big_uint16_buf_t num_tables;
21 big_uint16_buf_t search_range;
22 big_uint16_buf_t entry_selector;
23 big_uint16_buf_t range_shift;
28 big_uint32_buf_t check_sum;
29 big_uint32_buf_t offset;
30 big_uint32_buf_t length;
34 hilet& header = implicit_cast<header_type>(offset, bytes);
36 if (not (*header.scaler_type ==
"true"_fcc or *header.scaler_type == 0x00010000)) {
37 throw parse_error(
"sfnt.scalerType is not 'true' or 0x00010000");
40 hilet entries = implicit_cast<entry_type>(offset, bytes, *header.num_tables);
42 if (
hilet entry = fast_binary_search_eq<std::endian::big>(entries, fourcc<Name>())) {
#define hi_check_subspan(span, offset,...)
Get a subspan, or throw a parse_error.
Definition assert.hpp:136
#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