HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions
hi::v1::font_char_map Class Reference

#include <hikogui/font/font_char_map.hpp>

Public Member Functions

constexpr font_char_map (font_char_map const &) noexcept=default
 
constexpr font_char_map (font_char_map &&) noexcept=default
 
constexpr font_char_mapoperator= (font_char_map const &) noexcept=default
 
constexpr font_char_mapoperator= (font_char_map &&) noexcept=default
 
constexpr bool empty () const noexcept
 
constexpr void reserve (size_t n)
 Reserve space for a set of ranges to be added.
 
constexpr size_t count () const noexcept
 Get the number of code-points supported by the char-map.
 
constexpr size_t update_mask (std::bitset< 0x11 '0000 > &mask) const noexcept
 Update a code-point mask.
 
constexpr void add (char32_t start_code_point, char32_t end_code_point, uint16_t start_glyph) noexcept
 Add a range of code points.
 
void prepare () noexcept
 Prepare the map for searching.
 
glyph_id find (char32_t code_point) const noexcept
 Find a glyph for a code_point.
 

Detailed Description

Character map of a font.

This type serves the check if a code-point is supported by a font (even when the font is unloaded), and to retrieve the glyph mapped to the code-point.

Member Function Documentation

◆ add()

constexpr void hi::v1::font_char_map::add ( char32_t start_code_point,
char32_t end_code_point,
uint16_t start_glyph )
inlineconstexprnoexcept

Add a range of code points.

Parameters
start_code_pointThe starting code-point of the range.
end_code_pointThe ending code-point of the range (inclusive).
start_glyphThe starting glyph of the range.

◆ count()

constexpr size_t hi::v1::font_char_map::count ( ) const
inlineconstexprnoexcept

Get the number of code-points supported by the char-map.

◆ find()

glyph_id hi::v1::font_char_map::find ( char32_t code_point) const
inlinenoexcept

Find a glyph for a code_point.

Parameters
code_pointThe code-point to find in the character map.
Returns
The corrosponding glyph found representing the code-point, or an empty glyph if not found.

◆ prepare()

void hi::v1::font_char_map::prepare ( )
inlinenoexcept

Prepare the map for searching.

Precondition
All ranged of code-point must have been added with add().
Postcondition
The character map can be searched using find().

◆ reserve()

constexpr void hi::v1::font_char_map::reserve ( size_t n)
inlineconstexpr

Reserve space for a set of ranges to be added.

Parameters
nThe number of ranges to be added.

◆ update_mask()

constexpr size_t hi::v1::font_char_map::update_mask ( std::bitset< 0x11 '0000 > & mask) const
inlineconstexprnoexcept

Update a code-point mask.

Parameters
maskThe mask to be updated.
Returns
Number of code-point that where added and where not in the mask before.

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