Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::canvas::UnicodeIndexMap Struct Reference

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.

Detailed Description

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.

Member Function Documentation

◆ scalar_count()

std::size_t pulp::canvas::UnicodeIndexMap::scalar_count ( ) const
inlinenoexcept

Member Data Documentation

◆ byte_to_cluster

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().

◆ scalar_offsets

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.

◆ utf16_offsets

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.


The documentation for this struct was generated from the following file:
  • /home/runner/work/pulp/pulp/core/canvas/include/pulp/canvas/shaped_text.hpp