7#include "font_weight.hpp"
9namespace hi::inline
v1 {
20 constexpr static int max()
24 constexpr static int half()
30 value(
static_cast<uint8_t
>(
static_cast<int>(weight) + (italic ? half() : 0)))
37 [[nodiscard]]
size_t hash()
const noexcept
48 [[nodiscard]]
constexpr bool italic()
const noexcept
51 return value >= half();
56 value =
static_cast<uint8_t
>(
static_cast<int>(rhs) + (italic() ? half() : 0));
63 value =
static_cast<uint8_t
>(
static_cast<int>(weight()) + (rhs ? half() : 0));
68 constexpr operator int()
const noexcept
80 hilet w = font_weight_alterative(weight(), i % half());
81 hilet it = italic() == (i < half());
87 return std::format(
"{}", rhs.weight(), rhs.italic() ?
"/italic" :
"");
92 return lhs << to_string(rhs);
100 [[nodiscard]]
size_t operator()(hi::font_variant
const &rhs)
const noexcept
#define hi_axiom(expression)
Specify an axiom; an expression that is true.
Definition assert.hpp:133
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:15
font_weight
Definition font_weight.hpp:17
The HikoGUI namespace.
Definition ascii.hpp:19
A font variant is one of 16 different fonts that can be part of a family.
Definition font_variant.hpp:16
constexpr font_variant alternative(int i) const noexcept
Get an alternative font variant.
Definition font_variant.hpp:77