HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Data Fields | Static Public Attributes
hi::v1::ucd_decomposition_info Struct Reference

#include <hikogui/unicode/ucd_decompositions.hpp>

Public Types

using value_type = uint32_t
 

Public Member Functions

constexpr size_t cp_index () const noexcept
 The code-point-index into the decomposition code-point table.
 
constexpr size_t cp_size () const noexcept
 The number of code-points to extract from the decomposition code-point table.
 
constexpr unicode_decomposition_type type () const noexcept
 Decomposition compatibility type for this code-point.
 
constexpr bool should_decompose (size_t decomposition_mask) const noexcept
 Check if this code-point should be decomposed based on a mask of compatibility flags.
 
constexpr std::u32string decompose () const noexcept
 Decompose the code-point.
 
constexpr std::optional< char32_t > canonical_equivalent () const noexcept
 Get the canonical equivalent of this code-point.
 

Data Fields

value_type value
 

Static Public Attributes

static constexpr unsigned cp_index_width = 15
 
static constexpr unsigned cp_size_width = 5
 
static constexpr unsigned type_width = 5
 

Detailed Description

The decomposition info is used to determine how to decompose a code-point.

Member Function Documentation

◆ canonical_equivalent()

constexpr std::optional< char32_t > hi::v1::ucd_decomposition_info::canonical_equivalent ( ) const
inlineconstexprnoexcept

Get the canonical equivalent of this code-point.

The canonical equivalent is the code-point after NFC-normalization. This is equal to canonical decomposition to a single code-point.

Returns
The canonical equivalent code-point or nullopt if there is not equivalent.

◆ cp_index()

constexpr size_t hi::v1::ucd_decomposition_info::cp_index ( ) const
inlineconstexprnoexcept

The code-point-index into the decomposition code-point table.

◆ cp_size()

constexpr size_t hi::v1::ucd_decomposition_info::cp_size ( ) const
inlineconstexprnoexcept

The number of code-points to extract from the decomposition code-point table.

◆ decompose()

constexpr std::u32string hi::v1::ucd_decomposition_info::decompose ( ) const
inlineconstexprnoexcept

Decompose the code-point.

Performance should be okay due to small-string optimization.

Returns
The decomposed code-points.

◆ should_decompose()

constexpr bool hi::v1::ucd_decomposition_info::should_decompose ( size_t decomposition_mask) const
inlineconstexprnoexcept

Check if this code-point should be decomposed based on a mask of compatibility flags.

Parameters
decomposition_maskA mask of decomposition-types.
Returns
True if this code-point should be decomposed.

◆ type()

constexpr unicode_decomposition_type hi::v1::ucd_decomposition_info::type ( ) const
inlineconstexprnoexcept

Decomposition compatibility type for this code-point.


The documentation for this struct was generated from the following file: