scimesh 0.3.4
Headless CPU-only 3D software renderer for scientific mesh visualization
Loading...
Searching...
No Matches
scimesh::TextExtent Struct Reference

Size of a (possibly multi-line) piece of text. More...

#include <text.h>

Public Attributes

float width = 0.0f
 Width of the widest line, in pixels.
 
float height = 0.0f
 Height of the whole text block, in pixels.
 
float ascent = 0.0f
 Distance from the first baseline to the top of the block, in pixels.
 
float descent = 0.0f
 Distance from the last baseline to the bottom of the block, in pixels.
 
size_t line_count = 0
 Number of lines (a trailing newline does not add one).
 

Detailed Description

Size of a (possibly multi-line) piece of text.

The text box used by the renderer: width is the width of the widest line, height the height of the whole block, and the anchor is placed on this box with TextLayer::adj. Use it for layout decisions such as "which corner is still free for a caption", or to centre a title.

See also
measure_text(), Font::measure()

Definition at line 105 of file text.h.

Member Data Documentation

◆ ascent

float scimesh::TextExtent::ascent = 0.0f

Distance from the first baseline to the top of the block, in pixels.

Definition at line 113 of file text.h.

◆ descent

float scimesh::TextExtent::descent = 0.0f

Distance from the last baseline to the bottom of the block, in pixels.

Definition at line 116 of file text.h.

◆ height

float scimesh::TextExtent::height = 0.0f

Height of the whole text block, in pixels.

Definition at line 110 of file text.h.

◆ line_count

size_t scimesh::TextExtent::line_count = 0

Number of lines (a trailing newline does not add one).

Definition at line 119 of file text.h.

◆ width

float scimesh::TextExtent::width = 0.0f

Width of the widest line, in pixels.

Definition at line 107 of file text.h.


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