7#include "otype_utilities.hpp"
8#include "../utility/utility.hpp"
9#include "../macros.hpp"
13hi_export_module(hikogui.font.otype_loca);
15hi_export
namespace hi {
inline namespace v1 {
19 auto const entries = implicit_cast<big_uint16_buf_t>(bytes, bytes.size() /
sizeof(big_uint16_buf_t));
20 auto const first = wide_cast<size_t>(*hi_check_at(entries, *glyph_id)) * 2;
21 auto const last = wide_cast<size_t>(*hi_check_at(entries, *glyph_id + 1)) * 2;
22 hi_check(first <= last,
"'loca' table has invalid entries.");
28 auto const entries = implicit_cast<big_uint32_buf_t>(bytes, bytes.size() /
sizeof(big_uint32_buf_t));
29 auto const first = wide_cast<size_t>(*hi_check_at(entries, *glyph_id));
30 auto const last = wide_cast<size_t>(*hi_check_at(entries, *glyph_id + 1));
31 hi_check(first <= last,
"'loca' table has invalid entries.");
36otype_loca_get(std::span<std::byte const> loca_bytes, hi::glyph_id glyph_id,
bool loca_is_offset32)
38 if (loca_is_offset32) {
39 return otype_loca32_get(loca_bytes, glyph_id);
41 return otype_loca16_get(loca_bytes, glyph_id);
45[[nodiscard]]
inline std::span<std::byte const> otype_loca_get(
46 std::span<std::byte const> loca_bytes,
47 std::span<std::byte const> glyf_bytes,
48 hi::glyph_id glyph_id,
49 bool loca_is_offset32)
51 auto const[first, last] = otype_loca_get(loca_bytes, glyph_id, loca_is_offset32);
52 auto const size = last - first;
53 return hi_check_subspan(glyf_bytes, first, size);
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20