Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::canvas::Canvas::TextMetrics Struct Reference

Full text metrics for layout and intrinsic sizing. More...

#include <canvas.hpp>

Public Attributes

float width = 0
 Advance width of the text.
float ascent = 0
 Distance above baseline (positive value, ==fontBoundingBoxAscent).
float descent = 0
 Distance below baseline (positive value, ==fontBoundingBoxDescent).
float line_height = 0
 Recommended line spacing (ascent + descent + leading).
float actual_bounding_box_left = 0
 Distance from text origin to the left edge of the rendering bounding box.
float actual_bounding_box_right = 0
 Distance from text origin to the right edge of the rendering bounding box.
float actual_bounding_box_ascent = 0
 Distance from baseline to top of the rendering bounding box.
float actual_bounding_box_descent = 0
 Distance from baseline to bottom of the rendering bounding box.

Detailed Description

Full text metrics for layout and intrinsic sizing.

Mirrors HTML5 TextMetrics — fields beyond width/ascent/descent are the bounding-box-only metrics required by CanvasRenderingContext2D. All values are positive and in pixels at the current font size.

Member Data Documentation

◆ actual_bounding_box_ascent

float pulp::canvas::Canvas::TextMetrics::actual_bounding_box_ascent = 0

Distance from baseline to top of the rendering bounding box.

◆ actual_bounding_box_descent

float pulp::canvas::Canvas::TextMetrics::actual_bounding_box_descent = 0

Distance from baseline to bottom of the rendering bounding box.

◆ actual_bounding_box_left

float pulp::canvas::Canvas::TextMetrics::actual_bounding_box_left = 0

Distance from text origin to the left edge of the rendering bounding box.

Positive when the bounding box extends left of the origin.

◆ actual_bounding_box_right

float pulp::canvas::Canvas::TextMetrics::actual_bounding_box_right = 0

Distance from text origin to the right edge of the rendering bounding box.

◆ ascent

float pulp::canvas::Canvas::TextMetrics::ascent = 0

Distance above baseline (positive value, ==fontBoundingBoxAscent).

◆ descent

float pulp::canvas::Canvas::TextMetrics::descent = 0

Distance below baseline (positive value, ==fontBoundingBoxDescent).

◆ line_height

float pulp::canvas::Canvas::TextMetrics::line_height = 0

Recommended line spacing (ascent + descent + leading).

◆ width

float pulp::canvas::Canvas::TextMetrics::width = 0

Advance width of the text.


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