JS counts UTF-16, ICU APIs vary between UTF-16 and scalar offsets, HarfBuzz reports cluster indices, accessibility APIs vary by platform, and Pulp's internal storage is UTF-8. More...
#include <shaped_text.hpp>
Public Member Functions | |
| std::size_t | scalar_count () const noexcept |
Public Attributes | |
| std::vector< std::uint32_t > | scalar_offsets |
| scalar_offsets[i] = UTF-8 byte index of the i-th Unicode scalar value (codepoint). | |
| std::vector< std::uint32_t > | utf16_offsets |
| utf16_offsets[i] = UTF-16 code-unit index of the i-th Unicode scalar. | |
| std::vector< std::uint32_t > | byte_to_cluster |
| utf8_byte → cluster index. | |
JS counts UTF-16, ICU APIs vary between UTF-16 and scalar offsets, HarfBuzz reports cluster indices, accessibility APIs vary by platform, and Pulp's internal storage is UTF-8.
This index map gives consumers a shared conversion table instead of making each path recompute offsets.
|
inlinenoexcept |
| std::vector<std::uint32_t> pulp::canvas::UnicodeIndexMap::byte_to_cluster |
utf8_byte → cluster index.
One entry per UTF-8 byte plus a trailing sentinel equal to clusters.size().
| std::vector<std::uint32_t> pulp::canvas::UnicodeIndexMap::scalar_offsets |
scalar_offsets[i] = UTF-8 byte index of the i-th Unicode scalar value (codepoint).
One entry per codepoint plus a sentinel equal to the input byte length.
| std::vector<std::uint32_t> pulp::canvas::UnicodeIndexMap::utf16_offsets |
utf16_offsets[i] = UTF-16 code-unit index of the i-th Unicode scalar.
One entry per codepoint plus a sentinel equal to the total UTF-16 code-unit count.