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

#include <hikogui/unicode/unicode_mask.hpp>

Public Member Functions

constexpr unicode_mask (unicode_mask const &) noexcept=default
 
constexpr unicode_mask (unicode_mask &&) noexcept=default
 
constexpr unicode_maskoperator= (unicode_mask const &) noexcept=default
 
constexpr unicode_maskoperator= (unicode_mask &&) noexcept=default
 
constexpr std::size_t size () const noexcept
 
bool contains (char32_t c) const noexcept
 Check if the given code point is covered by this mask.
 
bool contains_composed (grapheme g) const noexcept
 Check if the full grapheme normalized to NFC is covered by this mask.
 
bool contains_decomposed (grapheme g) const noexcept
 Check if the full grapheme normalized to NFD is covered by this mask.
 
bool contains (grapheme g) const noexcept
 Check if the full grapheme is covered by this mask.
 
bool contains (unicode_mask const &other) const noexcept
 Check if all the code-points in other are covered by this mask.
 
void add (char32_t first, char32_t last) noexcept
 Add a range of unicode code points to this mask.
 
unicode_maskoperator|= (unicode_mask const &rhs) noexcept
 Combine two masks.
 
void optimize () noexcept
 Optimize storage.
 
void shrink_to_fit () noexcept
 
bool holds_invariant () const noexcept
 Check to see if the mask is still valid.
 

Friends

unicode_mask operator| (unicode_mask const &lhs, unicode_mask const &rhs) noexcept
 Combine two masks.
 

Detailed Description

A mask of unicode code-points.

This mask is used to determine which unicode code points are supported by a font. We need a fine grained mask so that we can find fallback glyphs for all unicode code points that are supported by the fonts.

At startup all the fonts are parsed and the unicode_mask is assembled, after this the font is unmapped from memory, but the unicode mask stays behind. Therefor the unicode mask should not use a lot of memory and be very fast to assemble.

Member Function Documentation

◆ add()

void v1::unicode_mask::add ( char32_t first,
char32_t last )
noexcept

Add a range of unicode code points to this mask.

Parameters
firstThe first code-point to add.
lastOne beyond the last code-point to add.

◆ contains() [1/3]

bool v1::unicode_mask::contains ( char32_t c) const
noexcept

Check if the given code point is covered by this mask.

◆ contains() [2/3]

bool v1::unicode_mask::contains ( grapheme g) const
noexcept

Check if the full grapheme is covered by this mask.

◆ contains() [3/3]

bool v1::unicode_mask::contains ( unicode_mask const & other) const
noexcept

Check if all the code-points in other are covered by this mask.

◆ contains_composed()

bool v1::unicode_mask::contains_composed ( grapheme g) const
noexcept

Check if the full grapheme normalized to NFC is covered by this mask.

◆ contains_decomposed()

bool v1::unicode_mask::contains_decomposed ( grapheme g) const
noexcept

Check if the full grapheme normalized to NFD is covered by this mask.

◆ holds_invariant()

bool v1::unicode_mask::holds_invariant ( ) const
noexcept

Check to see if the mask is still valid.

◆ operator|=()

unicode_mask & v1::unicode_mask::operator|= ( unicode_mask const & rhs)
inlinenoexcept

Combine two masks.

◆ optimize()

void v1::unicode_mask::optimize ( )
noexcept

Optimize storage.

Friends And Related Symbol Documentation

◆ operator|

unicode_mask operator| ( unicode_mask const & lhs,
unicode_mask const & rhs )
friend

Combine two masks.


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