7#include "text_style.hpp"
8#include "glyph_ids.hpp"
9#include "glyph_metrics.hpp"
11#include "../unicode/unicode_description.hpp"
12#include "../unicode/grapheme.hpp"
13#include "../geometry/point.hpp"
14#include "../geometry/axis_aligned_rectangle.hpp"
16namespace hi::inline
v1 {
31 float dpi_scale = 1.0f;
120 bool is_trailing_white_space =
false;
128 bool glyph_is_initial =
false;
160 return scale * glyph.font().metrics;
165 if (&(glyph.font()) != &(next.glyph.font()) or scale != next.scale or not glyph.has_num_glyphs<1>() or
166 not next.glyph.has_num_glyphs<1>()) {
169 hilet kerning = glyph.font().get_kerning(glyph.get_single(),
next.glyph.get_single());
170 return scale * kerning;
174 [[nodiscard]]
friend bool operator==(text_shaper_char
const &lhs,
char32_t const &rhs)
noexcept
176 return lhs.grapheme == rhs;
179 [[nodiscard]]
friend bool operator==(text_shaper_char
const &lhs,
char const &rhs)
noexcept
181 return lhs.grapheme == rhs;
187 void set_glyph(hi::glyph_ids &&new_glyph)
noexcept;
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:15
unicode_bidi_class
Bidirectional class Unicode Standard Annex #9: https://unicode.org/reports/tr9/.
Definition unicode_bidi_class.hpp:17
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:20
font_book keeps track of multiple fonts.
Definition font_book.hpp:31
Definition text_shaper_char.hpp:19
size_t line_nr
The line number where this character is located, counting from top to bottom line.
Definition text_shaper_char.hpp:53
void initialize_glyph(hi::font_book &font_book) noexcept
Initialize the glyph based on the grapheme.
unicode_bidi_class direction
The text direction for this glyph.
Definition text_shaper_char.hpp:97
hi::font_metrics font_metrics() const noexcept
Get the scaled font metrics for this character.
Definition text_shaper_char.hpp:158
void initialize_glyph(hi::font_book &font_book, hi::font const &font) noexcept
Initialize the glyph based on the grapheme.
unicode_script script
The script of this character.
Definition text_shaper_char.hpp:105
hi::grapheme grapheme
The grapheme.
Definition text_shaper_char.hpp:23
hi::glyph_ids glyph
The glyph representing one or more graphemes.
Definition text_shaper_char.hpp:43
point2 position
Position of the character.
Definition text_shaper_char.hpp:65
hi::glyph_metrics metrics
The glyph metrics of the currently glyph.
Definition text_shaper_char.hpp:49
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:57
unicode_description const * description
The unicode description of the grapheme.
Definition text_shaper_char.hpp:91
aarectangle rectangle
The rectangle for this character.
Definition text_shaper_char.hpp:87
hi::text_style style
The style of how to display the grapheme.
Definition text_shaper_char.hpp:27
void replace_glyph(char32_t code_point) noexcept
Called by the bidi-algorithm to mirror glyphs.
Definition text_style.hpp:175
A grapheme-cluster, what a user thinks a character is.
Definition grapheme.hpp:41
Description of a unicode code point.
Definition unicode_description.hpp:33