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

#include <hikogui/text/glyph_ids.hpp>

Public Member Functions

constexpr glyph_ids (glyph_ids const &other) noexcept
 
constexpr glyph_idsoperator= (glyph_ids const &other) noexcept
 
constexpr glyph_ids (glyph_ids &&other) noexcept
 
constexpr glyph_idsoperator= (glyph_ids &&other) noexcept
 
constexpr glyph_ids () noexcept
 Create an empty glyph_ids object.
 
constexpr glyph_ids (hi::font const &font) noexcept
 Create an empty glyph_ids for a font.
 
constexpr font constfont () const noexcept
 Get the font for this glyph_ids object.
 
void set_font (hi::font const &font) noexcept
 Set the font for this glyph_ids object.
 
constexpr void clear () noexcept
 Clear the glyphs in this glyph_ids object.
 
constexpr bool empty () const noexcept
 Check if glyphs are attached.
 
constexpr operator bool () const noexcept
 Check if glyphs are attached.
 
template<std::size_t N>
constexpr bool has_num_glyphs () const noexcept
 Check if this object contains a number of glyphs.
 
constexpr glyph_id get_single () const noexcept
 Get the value of the single glyph.
 
constexpr std::size_t num_glyphs () const noexcept
 Get the number of glyphs.
 
constexpr std::size_t num_graphemes () const noexcept
 
constexpr void set_num_graphemes (std::size_t num_graphemes) noexcept
 
constexpr std::size_t hash () const noexcept
 Get the hash value.
 
constexpr glyph_idsoperator+= (glyph_id id) noexcept
 Add a glyph to this object.
 
constexpr glyph_id operator[] (std::size_t index) const noexcept
 Get a glyph.
 
glyph_atlas_infoatlas_info () const noexcept
 Get information where the glyph is drawn in the atlas.
 
std::pair< graphic_path, aarectangleget_path_and_bounding_box () const noexcept
 Get the bounding box and the graphical path of the combined glyphs.
 
aarectangle get_bounding_box () const noexcept
 Get the bounding box of the combined glyphs.
 

Friends

template<std::size_t I>
constexpr friend glyph_id get (glyph_ids const &rhs) noexcept
 
constexpr friend bool operator== (glyph_ids const &lhs, glyph_ids const &rhs) noexcept
 

Detailed Description

A set of glyph-ids of a font which composites into a single glyph.

The normal operation for getting a glyph-ids is by:

Constructor & Destructor Documentation

◆ glyph_ids() [1/2]

constexpr v1::glyph_ids::glyph_ids ( )
inlineconstexprnoexcept

Create an empty glyph_ids object.

This constructor should only be used for default member initialization. Normally the font should always be assigned.

◆ glyph_ids() [2/2]

constexpr v1::glyph_ids::glyph_ids ( hi::font const & font)
inlineconstexprnoexcept

Create an empty glyph_ids for a font.

This is the normal constructor.

Parameters
fontThe font to be used for this glyph_ids.

Member Function Documentation

◆ atlas_info()

glyph_atlas_info & v1::glyph_ids::atlas_info ( ) const
noexcept

Get information where the glyph is drawn in the atlas.

◆ clear()

constexpr void v1::glyph_ids::clear ( )
inlineconstexprnoexcept

Clear the glyphs in this glyph_ids object.

The font remains attached to this object.

◆ empty()

constexpr bool v1::glyph_ids::empty ( ) const
inlineconstexprnoexcept

Check if glyphs are attached.

◆ font()

constexpr font const & v1::glyph_ids::font ( ) const
inlineconstexprnoexcept

Get the font for this glyph_ids object.

◆ get_bounding_box()

aarectangle v1::glyph_ids::get_bounding_box ( ) const
noexcept

Get the bounding box of the combined glyphs.

The unit of the values are in: em.

◆ get_path_and_bounding_box()

std::pair< graphic_path, aarectangle > v1::glyph_ids::get_path_and_bounding_box ( ) const
noexcept

Get the bounding box and the graphical path of the combined glyphs.

The unit of the values are in: em.

◆ get_single()

constexpr glyph_id v1::glyph_ids::get_single ( ) const
inlineconstexprnoexcept

Get the value of the single glyph.

◆ has_num_glyphs()

template<std::size_t N>
constexpr bool v1::glyph_ids::has_num_glyphs ( ) const
inlineconstexprnoexcept

Check if this object contains a number of glyphs.

A single glyph may represent 1 or more graphemes.

Template Parameters
NThe number of glyphs to check, must fit in a short glyph.
Returns
True if the number of glyphs equals N.

◆ hash()

constexpr std::size_t v1::glyph_ids::hash ( ) const
inlineconstexprnoexcept

Get the hash value.

◆ num_glyphs()

constexpr std::size_t v1::glyph_ids::num_glyphs ( ) const
inlineconstexprnoexcept

Get the number of glyphs.

◆ operator bool()

constexpr v1::glyph_ids::operator bool ( ) const
inlineconstexprnoexcept

Check if glyphs are attached.

◆ operator+=()

constexpr glyph_ids & v1::glyph_ids::operator+= ( glyph_id id)
inlineconstexprnoexcept

Add a glyph to this object.

Parameters
idThe glyph to add.

◆ operator[]()

constexpr glyph_id v1::glyph_ids::operator[] ( std::size_t index) const
inlineconstexprnoexcept

Get a glyph.

Parameters
indexThe index to the glyph to access

◆ set_font()

void v1::glyph_ids::set_font ( hi::font const & font)
inlinenoexcept

Set the font for this glyph_ids object.


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