7#include "text_style.hpp"
8#include "../font/font.hpp"
9#include "../unicode/unicode.hpp"
10#include "../geometry/module.hpp"
11#include "../macros.hpp"
13namespace hi::inline
v1 {
15class text_shaper_char {
39 hi::font_book::font_glyphs_type
glyphs;
171 hi_axiom_not_null(
glyphs.font);
182 hi_axiom_not_null(
glyphs.font);
186 [[nodiscard]]
friend bool operator==(
text_shaper_char const& lhs,
char32_t const& rhs)
noexcept
188 return lhs.grapheme == rhs;
191 [[nodiscard]]
friend bool operator==(text_shaper_char
const& lhs,
char const& rhs)
noexcept
193 return lhs.grapheme == rhs;
199 void set_glyph(hi::font_book::font_glyphs_type&& new_glyphs)
noexcept
202 hi_axiom_not_null(glyphs.font);
203 scale = glyphs.get_font_metrics().round_scale(dpi_scale * style->size);
204 metrics = scale * glyphs.get_starter_metrics();
DOXYGEN BUG.
Definition algorithm.hpp:16
hi_export font const & find_font(font_family_id family_id, font_variant variant=font_variant{}) noexcept
Find a font closest to the variant.
Definition font_book.hpp:412
hi_export auto find_glyph(font const &font, grapheme grapheme) noexcept
Find a glyph using the given code-point.
Definition font_book.hpp:437
Definition font_book.hpp:62
Definition font_font.hpp:31
glyph_id find_glyph(char32_t c) const noexcept
Get the glyph for a code-point.
Definition font_font.hpp:89
A high-level geometric point Part of the high-level vec, point, mat and color types.
Definition point2.hpp:26
Definition text_shaper_char.hpp:15
size_t line_nr
The line number where this character is located, counting from top to bottom line.
Definition text_shaper_char.hpp:49
unicode_bidi_class direction
The text direction for this glyph.
Definition text_shaper_char.hpp:93
hi::font_metrics font_metrics() const noexcept
Get the scaled font metrics for this character.
Definition text_shaper_char.hpp:180
hi::grapheme grapheme
The grapheme.
Definition text_shaper_char.hpp:19
void initialize_glyph() noexcept
Initialize the glyph based on the grapheme.
Definition text_shaper_char.hpp:156
hi::font_book::font_glyphs_type glyphs
The glyph representing one or more graphemes.
Definition text_shaper_char.hpp:39
bool is_trailing_white_space
Set to true if this glyph is a white space at the end of a line.
Definition text_shaper_char.hpp:116
bool glyph_is_initial
The glyph is the initial glyph.
Definition text_shaper_char.hpp:124
point2 position
Position of the character.
Definition text_shaper_char.hpp:61
hi::glyph_metrics metrics
The glyph metrics of the current starter glyph.
Definition text_shaper_char.hpp:45
iso_15924 script
The script of this character.
Definition text_shaper_char.hpp:101
unicode_general_category general_category
The general category of this grapheme.
Definition text_shaper_char.hpp:87
size_t column_nr
The column number where the character is located on the line, counting from left to right in display ...
Definition text_shaper_char.hpp:53
float width
The width used for this grapheme when folding lines.
Definition text_shaper_char.hpp:112
aarectangle rectangle
The rectangle for this character.
Definition text_shaper_char.hpp:83
float dpi_scale
The scale to resize the font's size to match the physical display.
Definition text_shaper_char.hpp:27
hi::text_style style
The style of how to display the grapheme.
Definition text_shaper_char.hpp:23
void replace_glyph(char32_t code_point) noexcept
Called by the bidi-algorithm to mirror glyphs.
Definition text_shaper_char.hpp:169
float scale
The scale of the glyph for displaying on the screen.
Definition text_shaper_char.hpp:105
void initialize_glyph(hi::font const &font) noexcept
Initialize the glyph based on the grapheme.
Definition text_shaper_char.hpp:141
Definition text_style.hpp:181