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

Public Member Functions

constexpr line_metric (size_t index) noexcept
 
void add_char (unicode_general_category category, float estimated_width, hi::font_metrics font_metrics) noexcept
 
template<bool LastWord>
void _add_word (line_metrics const &rhs) noexcept
 
void add_word (line_metrics const &rhs) noexcept
 
void add_last_word (line_metrics const &rhs) noexcept
 

Data Fields

hi::font_metrics font_metrics
 The combined metrics for all the glyphs on the line.
 
std::size_t index = 0
 The index of the first character in the text belonging to this line.
 
std::size_t size = 0
 The number of characters on this line.
 
float estimated_width = 0.0f
 The estimated width of the line.
 
float width = 0.0
 The width of the line.
 
float y = 0.0f
 The line position.
 
float x = 0.0f
 The horizontal line position.
 
unicode_general_category category = unicode_general_category::Cn
 The category of the last (logical ordering) character on the line.
 
bool is_visible
 The line has visible characters.
 

Field Documentation

◆ category

unicode_general_category v1::line_metrics::category = unicode_general_category::Cn

The category of the last (logical ordering) character on the line.

When:

  • Zp: End of paragraph, use paragraph-spacing after this line.
  • Zl: End of line, use line-spacing after this line.
  • *: Line was folded, use line-spacing and insert a virtual end-of-line for the bidi algorithm; or
  • *: last line without an explicit paragraph.

◆ estimated_width

float v1::line_metrics::estimated_width = 0.0f

The estimated width of the line.

Based on the advance of each glyph, except for white-space at the end of a line. The estimated width does not take into account kerning or glyph-morphing.

◆ font_metrics

hi::font_metrics v1::line_metrics::font_metrics

The combined metrics for all the glyphs on the line.

◆ index

std::size_t v1::line_metrics::index = 0

The index of the first character in the text belonging to this line.

◆ is_visible

bool v1::line_metrics::is_visible

The line has visible characters.

◆ size

std::size_t v1::line_metrics::size = 0

The number of characters on this line.

◆ width

float v1::line_metrics::width = 0.0

The width of the line.

The width includes bidi-algorithm, kerning, glyph-morphing and bounding rectangles of the glyphs. The width excludes the white space at the end of the line.

◆ x

float v1::line_metrics::x = 0.0f

The horizontal line position.

This value is calculated after determining width and then horizontally aligning the text.

◆ y

float v1::line_metrics::y = 0.0f

The line position.

The top line is at y = 0. Following lines will have negative y values.


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