HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
v1::text_shaper_char Class Reference

Public Member Functions

 text_shaper_char (hi::character const &character) noexcept
 

Data Fields

hi::character character = {}
 The original character.
 
hi::character bidi_character = {}
 The character after replacing bidi mirror glyphs.
 
hi::text_style style = {}
 The resolved style.
 
hi::font const * font = nullptr
 The font resolved for this character.
 
float width = 0.0f
 The width of the grapheme before glyph-morphing and positioning.
 
point2 position = {}
 Position of the character.
 
float advance = 0.0f
 Advance after glyph-morphing and positioning.
 
aarectangle rectangle = {}
 The rectangle for this character.
 
lean_vector< hi::glyph_id > glyphs = {}
 The glyph representing this grapheme.
 
lean_vector< hi::aarectangleglyph_rectangles = {}
 The position of each of the glyphs.
 
size_t line_nr = std::numeric_limits<size_t>::max()
 The line number where this character is located, counting from top to bottom line.
 
size_t column_nr = std::numeric_limits<size_t>::max()
 The column number where the character is located on the line, counting from left to right in display order.
 
unicode_bidi_class direction = unicode_bidi_class::L
 The text direction for this glyph.
 
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.
 

Field Documentation

◆ advance

float v1::text_shaper_char::advance = 0.0f

Advance after glyph-morphing and positioning.

◆ bidi_character

hi::character v1::text_shaper_char::bidi_character = {}

The character after replacing bidi mirror glyphs.

◆ character

hi::character v1::text_shaper_char::character = {}

The original character.

◆ column_nr

size_t v1::text_shaper_char::column_nr = std::numeric_limits<size_t>::max()

The column number where the character is located on the line, counting from left to right in display order.

◆ direction

unicode_bidi_class v1::text_shaper_char::direction = unicode_bidi_class::L

The text direction for this glyph.

This is needed to figure out where the location of the insert cursor is compared to the character.

◆ font

hi::font const* v1::text_shaper_char::font = nullptr

The font resolved for this character.

◆ glyph_is_initial

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.

◆ glyph_rectangles

lean_vector<hi::aarectangle> v1::text_shaper_char::glyph_rectangles = {}

The position of each of the glyphs.

◆ glyphs

lean_vector<hi::glyph_id> v1::text_shaper_char::glyphs = {}

The glyph representing this grapheme.

It is possible for this grapheme not to have any glyphs when the glyphs where merged during the morphing process.

◆ is_trailing_white_space

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.

◆ line_nr

size_t v1::text_shaper_char::line_nr = std::numeric_limits<size_t>::max()

The line number where this character is located, counting from top to bottom line.

◆ position

point2 v1::text_shaper_char::position = {}

Position of the character.

◆ rectangle

aarectangle v1::text_shaper_char::rectangle = {}

The rectangle for this character.

The rectangle is used for:

  • creating a selection box around the character.
  • creating cursors before, after and on the character.
  • converting mouse-position to character.

The attributes of the rectangle are:

  • left side is equal to the position.x
  • The width is the advance of the grapheme within the ligature.
  • The bottom is at the descender
  • The top is at the ascender

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.

◆ style

hi::text_style v1::text_shaper_char::style = {}

The resolved style.

◆ width

float v1::text_shaper_char::width = 0.0f

The width of the grapheme before glyph-morphing and positioning.


The documentation for this class was generated from the following file: