19 [[nodiscard]]
constexpr static size_t size()
noexcept
21 return font_weight_metadata.size() * font_style_metadata.size();
25 _value(narrow_cast<uint8_t>((to_underlying(weight) << 1) | to_underlying(style)))
33 [[nodiscard]]
constexpr operator size_t()
const noexcept
35 return to_underlying(style()) + to_underlying(weight()) * font_style_metadata.size();
38 [[nodiscard]]
size_t hash()
const noexcept
48 [[nodiscard]]
constexpr font_style style()
const noexcept
50 return static_cast<font_style
>(_value & 1);
56 _value |= to_underlying(rhs) << 1;
60 constexpr font_variant& set_style(font_style rhs)
noexcept
63 _value |= to_underlying(rhs);
75 for (
hilet s : alternatives(start.style())) {
76 for (
hilet w : alternatives(start.weight())) {
84 return std::format(
"{}", rhs.weight(), rhs.style() == font_style::italic ?
"/italic" :
"");
89 return lhs << to_string(rhs);
friend generator< font_variant > alternatives(font_variant const &start) noexcept
Get an alternative font variant.
Definition font_variant.hpp:73