HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends
v1::unicode_description Class Reference

#include <hikogui/unicode/unicode_description.hpp>

Public Member Functions

 unicode_description (unicode_description const &)=delete
 
unicode_descriptionoperator= (unicode_description const &)=delete
 
constexpr unicode_description (unicode_description &&) noexcept=default
 
constexpr unicode_descriptionoperator= (unicode_description &&) noexcept=default
 
constexpr unicode_description (unicode_general_category general_category, unicode_grapheme_cluster_break grapheme_cluster_break, unicode_line_break_class line_break_class, unicode_word_break_property word_break_property, unicode_sentence_break_property sentence_break_property, unicode_east_asian_width east_asian_width, unicode_script script, unicode_bidi_class bidi_class, unicode_bidi_bracket_type bidi_bracket_type, char32_t bidi_mirroring_glyph, uint8_t canonical_combining_class, unicode_decomposition_type decomposition_type, uint32_t decomposition_index, uint16_t composition_index) noexcept
 
constexpr unicode_general_category general_category () const noexcept
 The general category of this code-point.
 
constexpr unicode_grapheme_cluster_break grapheme_cluster_break () const noexcept
 The grapheme cluster break of this code-point.
 
constexpr unicode_line_break_class line_break_class () const noexcept
 
constexpr unicode_word_break_property word_break_property () const noexcept
 
constexpr unicode_sentence_break_property sentence_break_property () const noexcept
 
constexpr unicode_east_asian_width east_asian_width () const noexcept
 
constexpr unicode_bidi_class bidi_class () const noexcept
 The bidi class of this code-point This function is used by the bidirectional algorithm to figure out if the code-point represents a character that is written left-to-right or right-to-left.
 
constexpr unicode_script script () const noexcept
 Get the script of this character.
 
constexpr unicode_bidi_bracket_type bidi_bracket_type () const noexcept
 Get the bidi bracket type.
 
constexpr char32_t bidi_mirroring_glyph () const noexcept
 Get the mirrored glyph.
 
constexpr unicode_decomposition_type decomposition_type () const noexcept
 This character has a canonical decomposition.
 
constexpr uint8_t canonical_combining_class () const noexcept
 Get the combining class.
 
std::u32string decompose () const noexcept
 Decompose this code-point.
 
char32_t compose (char32_t other) const noexcept
 Compose this code-point with another.
 
constexpr char32_t canonical_equivalent () const noexcept
 Get the canonical equivalent of this code-point.
 

Static Public Member Functions

static unicode_description const & find (char32_t code_point) noexcept
 Find a code-point in the global unicode_description table.
 

Friends

bool operator== (unicode_description const &lhs, unicode_general_category const &rhs) noexcept
 
bool operator== (unicode_description const &lhs, unicode_decomposition_type const &rhs) noexcept
 
bool operator== (unicode_description const &lhs, unicode_bidi_bracket_type const &rhs) noexcept
 
bool operator== (unicode_description const &lhs, unicode_bidi_class const &rhs) noexcept
 
bool operator== (unicode_description const &lhs, unicode_east_asian_width const &rhs) noexcept
 
bool operator== (unicode_description const &lhs, unicode_sentence_break_property const &rhs) noexcept
 
bool operator== (unicode_description const &lhs, unicode_line_break_class const &rhs) noexcept
 
bool operator== (unicode_description const &lhs, unicode_word_break_property const &rhs) noexcept
 
bool operator== (unicode_description const &lhs, unicode_grapheme_cluster_break const &rhs) noexcept
 
bool is_C (unicode_description const &rhs) noexcept
 

Detailed Description

Description of a unicode code point.

This class holds information of a unicode code point.

The information is compressed to use bit-fields to reduce memory usage of the unicode database.

Member Function Documentation

◆ bidi_bracket_type()

constexpr unicode_bidi_bracket_type v1::unicode_description::bidi_bracket_type ( ) const
inlineconstexprnoexcept

Get the bidi bracket type.

This function is used by the bidirectional algorithm for mirroring characters when needing to reverse the writing direction.

Returns
n = no-mirror, o = open-bracket, c = close-bracket, m = bidi-mirrored.

◆ bidi_class()

constexpr unicode_bidi_class v1::unicode_description::bidi_class ( ) const
inlineconstexprnoexcept

The bidi class of this code-point This function is used by the bidirectional algorithm to figure out if the code-point represents a character that is written left-to-right or right-to-left.

Returns
the bidi class of this code-point.

◆ bidi_mirroring_glyph()

constexpr char32_t v1::unicode_description::bidi_mirroring_glyph ( ) const
inlineconstexprnoexcept

Get the mirrored glyph.

Returns
The mirrored glyph or U+ffff when there is no mirrored glyph.

◆ canonical_combining_class()

constexpr uint8_t v1::unicode_description::canonical_combining_class ( ) const
inlineconstexprnoexcept

Get the combining class.

The combing class describes how a code-point combines with other code-points. Specifically the value 0 means that the code-point is a starter character, and the numeric value of the combing class determines the order of the the code-points after a starter before trying to look up composition in the composition table.

Returns
The numeric combining class of this code point.

◆ canonical_equivalent()

constexpr char32_t v1::unicode_description::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 U+ffff if there is not equivalent.

◆ compose()

char32_t v1::unicode_description::compose ( char32_t other) const
noexcept

Compose this code-point with another.

Parameters
otherThe other code-point.
Returns
The composed code-point, or 0xffff if the composition was not found.

◆ decompose()

std::u32string v1::unicode_description::decompose ( ) const
noexcept

Decompose this code-point.

Returns
The decomposition of this code-point.

◆ decomposition_type()

constexpr unicode_decomposition_type v1::unicode_description::decomposition_type ( ) const
inlineconstexprnoexcept

This character has a canonical decomposition.

Returns
When true you can decompose the character canonically.

◆ find()

static unicode_description const & v1::unicode_description::find ( char32_t code_point)
staticnoexcept

Find a code-point in the global unicode_description table.

For any valid unicode code point this function will return a reference to the unicode_description. It may return a unicode_description to the U+fffd 'REPLACEMENT CHARACTER' if the code-point could not be found in the table. Or it may return unicode_description to a single element in a range of code-points, such as for hangul-syllables, or private use areas.

Parameters
code_pointThe code point to look up.
Returns
a const reference to the unicode_description entry.

◆ general_category()

constexpr unicode_general_category v1::unicode_description::general_category ( ) const
inlineconstexprnoexcept

The general category of this code-point.

This function is used to determine what kind of code-point this, this allows you to determine if the code-point is a letter, number, punctuation, white-space, etc.

Returns
The general category of this code-point

◆ grapheme_cluster_break()

constexpr unicode_grapheme_cluster_break v1::unicode_description::grapheme_cluster_break ( ) const
inlineconstexprnoexcept

The grapheme cluster break of this code-point.

This function is used to determine where to break a string of code-points into grapheme clusters.

Returns
The grapheme cluster break of this code-point

◆ script()

constexpr unicode_script v1::unicode_description::script ( ) const
inlineconstexprnoexcept

Get the script of this character.


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