|
HikoGUI
A low latency retained GUI
|
#include <hikogui/text/font_book.hpp>
Public Member Functions | |
| font_book (std::vector< URL > const &font_directories) | |
| font & | register_font (URL url, bool post_process=true) |
| Register a font. | |
| void | register_elusive_icon_font (URL url) |
| void | register_hikogui_icon_font (URL url) |
| void | post_process () noexcept |
| Post process font_book Should be called after a set of register_font() calls This calculates font fallbacks. | |
| font_family_id | find_family (std::string_view family_name) const noexcept |
| Find font family id. | |
| font_family_id | register_family (std::string_view family_name) noexcept |
| Register font family id. | |
| font const & | find_font (font_family_id family_id, font_variant variant) const noexcept |
| Find a font closest to the variant. | |
| font const & | find_font (font_family_id family_id, font_weight weight, bool italic) const noexcept |
| Find a font closest to the variant. | |
| font const & | find_font (std::string_view family_name, font_weight weight, bool italic) const noexcept |
| Find a font closest to the variant. | |
| glyph_ids | find_glyph (font const &font, grapheme grapheme) const noexcept |
| Find a glyph using the given code-point. | |
| glyph_ids | find_glyph (elusive_icon rhs) const noexcept |
| glyph_ids | find_glyph (hikogui_icon rhs) const noexcept |
font_book keeps track of multiple fonts.
The font_book is instantiated during application startup and is available through Foundation_globals->font_book.
|
noexcept |
Find font family id.
This function will always return a valid font_family_id by walking the fallback-chain.
|
noexcept |
Find a font closest to the variant.
This function will always return a valid font_id.
| family_id | a valid family id. |
| variant | The variant of the font to select. |
|
noexcept |
Find a font closest to the variant.
This function will always return a valid font_id.
| family_id | a valid family id. |
| weight | The weight of the font to select. |
| italic | If the font to select should be italic or not. |
|
noexcept |
Find a font closest to the variant.
This function will always return a valid font_id.
| family_name | A name of a font family, which may be invalid. |
| weight | The weight of the font to select. |
| italic | If the font to select should be italic or not. |
Find a glyph using the given code-point.
This function will find a glyph matching the grapheme in the selected font, or find the glyph in the fallback font.
| font_id | The font to use to find the grapheme in. |
| grapheme | The Unicode grapheme to find in the font. |
|
noexcept |
Post process font_book Should be called after a set of register_font() calls This calculates font fallbacks.
|
noexcept |
Register font family id.
If the family already exists the existing family_id is returned.
Register a font.
Duplicate registrations will be ignored.
When a font file is registered the file will be temporarily opened to read and cache a set of properties:
| url | Location of font. |
| post_process | Calculate font fallback |