48 : _height(height), _ascent(ascent), _descent(descent), _internal_leading(internal_leading), _external_leading(external_leading), _line_height(line_height)
51 if (_line_height == 0.0
f)
54 _baseline_offset = (_line_height - _height) * 0.5
f + ascent;
55 _baseline_offset = std::round(_baseline_offset / pixel_ratio) * pixel_ratio;
59 float height()
const {
return _height; }
68 float ascent()
const {
return _ascent; }
71 float descent()
const {
return _descent; }
82 float _descent = 0.0f;
83 float _internal_leading = 0.0f;
84 float _external_leading = 0.0f;
85 float _line_height = 0.0f;
86 float _baseline_offset = 0.0f;
float baseline_offset() const
Returns the baseline offset from the top of a line.
Definition: font_metrics.h:65
float line_height() const
Return the distance between lines.
Definition: font_metrics.h:62
FontMetrics(float height, float ascent, float descent, float internal_leading, float external_leading, float line_height, float pixel_ratio)
Definition: font_metrics.h:47
Font metrics class.
Definition: font_metrics.h:41
float descent() const
Returns the font descender.
Definition: font_metrics.h:71
FontMetrics()
Definition: font_metrics.h:46
float height() const
Returns the height of the font.
Definition: font_metrics.h:59
float internal_leading() const
Returns the amount of leading (space) inside the bounds set by the height() function.
Definition: font_metrics.h:74
float external_leading() const
Returns the amount of extra leading (space) that to add between rows.
Definition: font_metrics.h:77
float ascent() const
Returns the font ascender.
Definition: font_metrics.h:68
Definition: Application/application.h:35