Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::CaretMetrics Struct Reference

Where a caret goes, in the coordinate space the widget paints text in. More...

#include <caret.hpp>

Public Attributes

float x = 0.0f
 Left edge of the caret, for every style.
float cell_top = 0.0f
 Top of the glyph cell.
float cell_height = 0.0f
 Height of the glyph cell.
float baseline = 0.0f
 Text baseline, for the underline shape.
float advance = 0.0f
 Width of the glyph at the caret; 0 at end of text.
float nominal_advance = 0.0f
 Fallback width when advance is 0.
float stroke = 1.5f
 I-beam width and underline thickness.

Detailed Description

Where a caret goes, in the coordinate space the widget paints text in.

advance is the width of the glyph the caret sits on, which sizes the underline and block shapes. At the end of the text there is no such glyph, so advance is 0 and nominal_advance is used instead — measure a representative glyph (a digit, for a numeric field) rather than leaving it 0, or the caret collapses to nothing in those two styles.

Member Data Documentation

◆ advance

float pulp::view::CaretMetrics::advance = 0.0f

Width of the glyph at the caret; 0 at end of text.

◆ baseline

float pulp::view::CaretMetrics::baseline = 0.0f

Text baseline, for the underline shape.

◆ cell_height

float pulp::view::CaretMetrics::cell_height = 0.0f

Height of the glyph cell.

◆ cell_top

float pulp::view::CaretMetrics::cell_top = 0.0f

Top of the glyph cell.

◆ nominal_advance

float pulp::view::CaretMetrics::nominal_advance = 0.0f

Fallback width when advance is 0.

◆ stroke

float pulp::view::CaretMetrics::stroke = 1.5f

I-beam width and underline thickness.

◆ x

float pulp::view::CaretMetrics::x = 0.0f

Left edge of the caret, for every style.


The documentation for this struct was generated from the following file:
  • /home/runner/work/pulp/pulp/core/view/include/pulp/view/caret.hpp