Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
design_line_metrics.hpp
Go to the documentation of this file.
1// The line metrics a browser laid captured text out with: a DesignIR value
2// type, so it stays standard-library only like the rest of pulp-design-ir.
3#pragma once
4
5#include <cmath>
6
7namespace pulp::view {
8
14 float ascent = 0.0f;
15 float descent = 0.0f;
16
19 bool valid() const {
20 return std::isfinite(ascent) && std::isfinite(descent) && ascent > 0.0f && descent >= 0.0f;
21 }
22};
23
24} // namespace pulp::view
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
A text run's primary-font ascent and descent in CSS px, as the browser rounded and adjusted them when...
Definition design_line_metrics.hpp:13
float ascent
Definition design_line_metrics.hpp:14
float descent
Definition design_line_metrics.hpp:15
bool valid() const
Finite, with a positive ascent and a non-negative descent.
Definition design_line_metrics.hpp:19