HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
text_shaper_char.hpp
1// Copyright Take Vos 2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "text_theme.hpp"
8#include "character.hpp"
9#include "../font/module.hpp"
10#include "../unicode/module.hpp"
11#include "../geometry/module.hpp"
12
13namespace hi::inline v1 {
14
15class text_shaper_char {
16public:
20
24
28
31 hi::font const *font = nullptr;
32
35 float width = 0.0f;
36
39 point2 position = {};
40
43 float advance = 0.0f;
44
64 aarectangle rectangle = {};
65
70 lean_vector<hi::glyph_id> glyphs = {};
71
74 lean_vector<hi::aarectangle> glyph_rectangles = {};
75
79
83
88 unicode_bidi_class direction = unicode_bidi_class::L;
89
93
100 bool glyph_is_initial = false;
101
102 [[nodiscard]] text_shaper_char(hi::character const& character) noexcept :
105 {
106 }
107};
108
109} // namespace hi::inline v1
Defines the standard HikoGUI character type.
DOXYGEN BUG.
Definition algorithm.hpp:13
The standard HikoGUI character type.
Definition character.hpp:34
size_t line_nr
The line number where this character is located, counting from top to bottom line.
Definition text_shaper_char.hpp:78
lean_vector< hi::aarectangle > glyph_rectangles
The position of each of the glyphs.
Definition text_shaper_char.hpp:74
hi::font const * font
The font resolved for this character.
Definition text_shaper_char.hpp:31
unicode_bidi_class direction
The text direction for this glyph.
Definition text_shaper_char.hpp:88
float advance
Advance after glyph-morphing and positioning.
Definition text_shaper_char.hpp:43
hi::character bidi_character
The character after replacing bidi mirror glyphs.
Definition text_shaper_char.hpp:23
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:92
bool glyph_is_initial
The glyph is the initial glyph.
Definition text_shaper_char.hpp:100
point2 position
Position of the character.
Definition text_shaper_char.hpp:39
lean_vector< hi::glyph_id > glyphs
The glyph representing this grapheme.
Definition text_shaper_char.hpp:70
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:82
float width
The width of the grapheme before glyph-morphing and positioning.
Definition text_shaper_char.hpp:35
aarectangle rectangle
The rectangle for this character.
Definition text_shaper_char.hpp:64
hi::character character
The original character.
Definition text_shaper_char.hpp:19
hi::text_style style
The resolved style.
Definition text_shaper_char.hpp:27
Definition text_style.hpp:15
T max(T... args)