|
HikoGUI
A low latency retained GUI
|
#include <hikogui/font/font_metrics.hpp>
Public Member Functions | |
| constexpr | font_metrics (font_metrics const &) noexcept=default |
| constexpr | font_metrics (font_metrics &&) noexcept=default |
| constexpr font_metrics & | operator= (font_metrics const &) noexcept=default |
| constexpr font_metrics & | operator= (font_metrics &&) noexcept=default |
| float | round_scale (float size) const noexcept |
| Round a scale so that the scaled x-height is an integral. | |
Data Fields | |
| float | ascender = 0.0f |
| Distance from baseline of highest ascender. | |
| float | descender = 0.0f |
| Distance from baseline of lowest descender. | |
| float | line_gap = 0.0f |
| Distance between lines. | |
| float | cap_height = 0.0f |
| Height of capital letter, or height of the letter 'H'. | |
| float | x_height = 0.0f |
| Height of lower case characters without ascenders or descenders, or the small letter 'x'. | |
| float | digit_advance = 0.0f |
| The advance for digits, specifically the digit '8'. | |
| float | line_spacing = 1.0f |
| The multiplier for the space between lines of the same paragraph. | |
| float | paragraph_spacing = 1.5f |
| The multiplier for the space between two paragraphs. | |
Friends | |
| constexpr friend bool | operator== (font_metrics const &, font_metrics const &) noexcept=default |
| constexpr friend font_metrics | operator* (float const &lhs, font_metrics const &rhs) noexcept |
| Scale the metrics by a scalar value. | |
| constexpr friend font_metrics | max (font_metrics const &a, font_metrics const &b) noexcept |
The metrics of a font.
These are the metrics that are used for the font as a whole. Inside the font these are in 'em' units, outside the font they may have been scaled to 'points' or 'dp'.
Round a scale so that the scaled x-height is an integral.
|
friend |
Scale the metrics by a scalar value.
| float v1::font_metrics::ascender = 0.0f |
Distance from baseline of highest ascender.
| float v1::font_metrics::cap_height = 0.0f |
Height of capital letter, or height of the letter 'H'.
| float v1::font_metrics::descender = 0.0f |
Distance from baseline of lowest descender.
| float v1::font_metrics::digit_advance = 0.0f |
The advance for digits, specifically the digit '8'.
| float v1::font_metrics::line_gap = 0.0f |
Distance between lines.
The distance between the descender of a line and the ascender of the next line.
| float v1::font_metrics::line_spacing = 1.0f |
The multiplier for the space between lines of the same paragraph.
| float v1::font_metrics::paragraph_spacing = 1.5f |
The multiplier for the space between two paragraphs.
| float v1::font_metrics::x_height = 0.0f |
Height of lower case characters without ascenders or descenders, or the small letter 'x'.