HikoGUI
A low latency retained GUI
|
Public Member Functions | |
text_shaper_char (hi::grapheme const &grapheme, text_style const &style, hi::pixel_density pixel_density) noexcept | |
void | initialize_glyph (hi::font const &font) noexcept |
Initialize the glyph based on the grapheme. | |
void | initialize_glyph () noexcept |
Initialize the glyph based on the grapheme. | |
void | replace_glyph (char32_t code_point) noexcept |
Called by the bidi-algorithm to mirror glyphs. | |
font_metrics_px | font_metrics () const noexcept |
Get the scaled font metrics for this character. | |
Data Fields | |
hi::grapheme | grapheme |
The grapheme. | |
hi::text_style | style |
The style of how to display the grapheme. | |
pixel_density | pixel_density |
The scale to resize the font's size to match the physical display. | |
hi::font_book::font_glyphs_type | glyphs |
The glyph representing one or more graphemes. | |
hi::glyph_metrics | metrics |
The glyph metrics of the current starter glyph. | |
size_t | line_nr |
The line number where this character is located, counting from top to bottom line. | |
size_t | column_nr |
The column number where the character is located on the line, counting from left to right in display order. | |
point2 | position |
Position of the character. | |
aarectangle | rectangle |
The rectangle for this character. | |
unicode_general_category | general_category |
The general category of this grapheme. | |
unicode_bidi_class | direction |
The text direction for this glyph. | |
iso_15924 | script |
The script of this character. | |
au::Quantity< PixelsPerEm, float > | font_size |
The font size in pixels, rounded so that the x-height is rounded to the nearest pixel. | |
float | width = 0.0f |
The width used for this grapheme when folding lines. | |
bool | is_trailing_white_space = false |
Set to true if this glyph is a white space at the end of a line. | |
bool | glyph_is_initial = false |
The glyph is the initial glyph. | |
Friends | |
bool | operator== (text_shaper_char const &lhs, char32_t const &rhs) noexcept |
bool | operator== (text_shaper_char const &lhs, char const &rhs) noexcept |
|
inlinenoexcept |
Get the scaled font metrics for this character.
|
inlinenoexcept |
Initialize the glyph based on the grapheme.
glyph_is_initial == false
. glyph
, metrics
and width
are modified. glyph_is_initial
is set to true.
|
inlinenoexcept |
Initialize the glyph based on the grapheme.
glyph_is_initial == false
. glyph
, metrics
and width
are modified. glyph_is_initial
is set to true.
|
inlinenoexcept |
Called by the bidi-algorithm to mirror glyphs.
The glyph is replaced with a glyph from the same font using the given code-point.
glyph.num_grapheme == 1
. glyph
and metrics
are modified. glyph_is_initial
is set to false. width
remains based on the original glyph. size_t v1::text_shaper_char::column_nr |
The column number where the character is located on the line, counting from left to right in display order.
unicode_bidi_class v1::text_shaper_char::direction |
The text direction for this glyph.
This is needed to figure out where the location of the insert cursor is compared to the character.
au::Quantity<PixelsPerEm, float> v1::text_shaper_char::font_size |
The font size in pixels, rounded so that the x-height is rounded to the nearest pixel.
unicode_general_category v1::text_shaper_char::general_category |
The general category of this grapheme.
bool v1::text_shaper_char::glyph_is_initial = false |
The glyph is the initial glyph.
This flag is set to true after loading the initial glyph. This flag is set to false when the glyph is replaced by the bidi-algorithm or glyph-morphing.
hi::font_book::font_glyphs_type v1::text_shaper_char::glyphs |
The glyph representing one or more graphemes.
The glyph will change during shaping of the text:
hi::grapheme v1::text_shaper_char::grapheme |
The grapheme.
bool v1::text_shaper_char::is_trailing_white_space = false |
Set to true if this glyph is a white space at the end of a line.
size_t v1::text_shaper_char::line_nr |
The line number where this character is located, counting from top to bottom line.
hi::glyph_metrics v1::text_shaper_char::metrics |
The glyph metrics of the current starter glyph.
The metrics are scaled by scale
.
pixel_density v1::text_shaper_char::pixel_density |
The scale to resize the font's size to match the physical display.
point2 v1::text_shaper_char::position |
Position of the character.
For a non-ligature this is the origin of the glyph, where the actual glyph is located at position + metrics.bounding_rectangle
. For ligatures the position is moved based on the advance of each character within the ligature.
aarectangle v1::text_shaper_char::rectangle |
The rectangle for this character.
The rectangle is used for:
The attributes of the rectangle are:
When multiple characters are converted to a ligature, the rectangle of each of those characters occupies a subsection of the ligature-glyph. In this case the left most character will contain the ligature-glyph, and the rest of the characters of the ligature will have empty glyphs.
iso_15924 v1::text_shaper_char::script |
The script of this character.
The script of the character is based on:
unicode_script::Common
;unicode_script::Common
;hi::text_style v1::text_shaper_char::style |
The style of how to display the grapheme.
float v1::text_shaper_char::width = 0.0f |
The width used for this grapheme when folding lines.
This width is based on the initial glyph's advance after converting the grapheme using the text-style into a glyph. This width excludes kerning and glyph-morphing.