HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
glyph_metrics.hpp
1// Copyright Take Vos 2019, 2021.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "../utility/module.hpp"
8#include "../geometry/module.hpp"
9
10namespace hi::inline v1 {
11
19 aarectangle bounding_rectangle = {};
20
27 float left_side_bearing = 0.0f;
28
33 float right_side_bearing = 0.0f;
34
37 vector2 advance = {0.0f, 0.0f};
38
39 glyph_metrics() noexcept = default;
40 glyph_metrics(glyph_metrics const &) noexcept = default;
41 glyph_metrics(glyph_metrics &&) noexcept = default;
42 glyph_metrics &operator=(glyph_metrics const &) noexcept = default;
43 glyph_metrics &operator=(glyph_metrics &&) noexcept = default;
44
47 [[nodiscard]] constexpr friend glyph_metrics operator*(float const &lhs, glyph_metrics const &rhs) noexcept
48 {
50 r.bounding_rectangle = scale2(lhs) * rhs.bounding_rectangle;
51 r.left_side_bearing = lhs * rhs.left_side_bearing;
52 r.right_side_bearing = lhs * rhs.right_side_bearing;
53 r.advance = lhs * rhs.advance;
54 return r;
55 }
56};
57
58} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm.hpp:13
Definition glyph_metrics.hpp:16
aarectangle bounding_rectangle
Definition glyph_metrics.hpp:19
float right_side_bearing
Definition glyph_metrics.hpp:33
float left_side_bearing
Definition glyph_metrics.hpp:27
vector2 advance
Definition glyph_metrics.hpp:37