8#include "font_family_id.hpp"
9#include "font_grapheme_id.hpp"
10#include "glyph_ids.hpp"
11#include "elusive_icon.hpp"
12#include "hikogui_icon.hpp"
13#include "../unicode/grapheme.hpp"
14#include "../geometry/module.hpp"
15#include "../utility/module.hpp"
16#include "../generator.hpp"
23namespace hi::inline
v1 {
61 void register_elusive_icon_font(std::filesystem::path
const& path)
63 _elusive_icon_font = ®ister_font(path,
false);
66 void register_hikogui_icon_font(std::filesystem::path
const& path)
68 _hikogui_icon_font = ®ister_font(path,
false);
114 [[nodiscard]]
font const& find_font(
std::string_view family_name,
font_weight weight,
bool italic) const noexcept;
126 [[nodiscard]]
glyph_ids find_glyph(elusive_icon rhs) const noexcept
129 return _elusive_icon_font->find_glyph(
grapheme{
static_cast<char32_t>(rhs)});
135 return _hikogui_icon_font->find_glyph(
grapheme{
static_cast<char32_t>(rhs)});
141 font
const *_elusive_icon_font =
nullptr;
142 font
const *_hikogui_icon_font =
nullptr;
187 [[nodiscard]] generator<std::string> generate_family_names(std::string_view name)
const noexcept;
189 void create_family_name_fallback_chain() noexcept;
205[[nodiscard]]
inline glyph_ids find_glyph(elusive_icon rhs)
noexcept
207 return font_book::global().find_glyph(rhs);
210[[nodiscard]]
inline glyph_ids
find_glyph(hikogui_icon rhs)
noexcept
212 return font_book::global().find_glyph(rhs);
#define hi_assert_not_null(x,...)
Assert if an expression is not nullptr.
Definition assert.hpp:223
DOXYGEN BUG.
Definition algorithm.hpp:13
font_weight
Definition font_weight.hpp:16
glyph_ids find_glyph(font const &font, grapheme grapheme) noexcept
Find a glyph using the given code-point.
Definition font_book.hpp:200
font_book keeps track of multiple fonts.
Definition font_book.hpp:31
void post_process() noexcept
Post process font_book Should be called after a set of register_font() calls This calculates font fal...
void register_font_directory(std::filesystem::path const &path, bool post_process=true)
Register all fonts found in a directory.
font & register_font(std::filesystem::path const &path, bool post_process=true)
Register a font.
A font variant is one of 16 different fonts that can be part of a family.
Definition font_variant.hpp:16
A set of glyph-ids of a font which composites into a single glyph.
Definition glyph_ids.hpp:134
A grapheme-cluster, what a user thinks a character is.
Definition grapheme.hpp:39