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

How to draw text onto an image with draw_text(). More...

#include <text.h>

Collaboration diagram for scimesh::TextDrawStyle:

Public Attributes

Color color = Color(0.0f, 0.0f, 0.0f, 1.0f)
 Text color; alpha values below 1 blend with the background.
 
Color halo_color = Color(0.0f, 0.0f, 0.0f, 0.0f)
 Color of the halo (outline) drawn behind the glyphs.
 
float halo_width = 1.0f
 Halo thickness in pixels (default: 1.0).
 
float line_spacing = 1.2f
 Distance between two lines of a multi-line string, as a multiple of the height of the font's glyph box (default: 1.2).
 
float rotation = 0.0f
 Rotation of the text in degrees, counter-clockwise, about the point (x, baseline_y) passed to draw_text() (default: 0).
 

Detailed Description

How to draw text onto an image with draw_text().

See also
draw_text()

Definition at line 70 of file text.h.

Member Data Documentation

◆ color

Color scimesh::TextDrawStyle::color = Color(0.0f, 0.0f, 0.0f, 1.0f)

Text color; alpha values below 1 blend with the background.

Definition at line 72 of file text.h.

◆ halo_color

Color scimesh::TextDrawStyle::halo_color = Color(0.0f, 0.0f, 0.0f, 0.0f)

Color of the halo (outline) drawn behind the glyphs.

The default has alpha 0, which disables the halo. A halo makes labels readable on top of busy or dark geometry.

Definition at line 78 of file text.h.

◆ halo_width

float scimesh::TextDrawStyle::halo_width = 1.0f

Halo thickness in pixels (default: 1.0).

Definition at line 81 of file text.h.

◆ line_spacing

float scimesh::TextDrawStyle::line_spacing = 1.2f

Distance between two lines of a multi-line string, as a multiple of the height of the font's glyph box (default: 1.2).

Definition at line 85 of file text.h.

◆ rotation

float scimesh::TextDrawStyle::rotation = 0.0f

Rotation of the text in degrees, counter-clockwise, about the point (x, baseline_y) passed to draw_text() (default: 0).

Useful values are 90 (reads bottom to top, the usual orientation of a y-axis label), -90 or 270 (reads top to bottom) and 180 (upside down). Arbitrary angles work as well; glyphs are resampled with bilinear interpolation.

Definition at line 94 of file text.h.


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