21 [[nodiscard]]
constexpr static size_t size()
noexcept
23 return font_weight_metadata.size() * font_style_metadata.size();
27 _value(narrow_cast<uint8_t>((std::to_underlying(weight) << 1) | std::to_underlying(style)))
35 [[nodiscard]]
constexpr operator size_t()
const noexcept
37 return std::to_underlying(style()) + std::to_underlying(weight()) * font_style_metadata.size();
40 [[nodiscard]]
size_t hash()
const noexcept
50 [[nodiscard]]
constexpr font_style style()
const noexcept
52 return static_cast<font_style
>(_value & 1);
58 _value |= std::to_underlying(rhs) << 1;
62 constexpr font_variant& set_style(font_style rhs)
noexcept
65 _value |= std::to_underlying(rhs);
77 for (hilet s : alternatives(start.style())) {
78 for (hilet w : alternatives(start.weight())) {
86 return std::format(
"{}", rhs.weight(), rhs.style() == font_style::italic ?
"/italic" :
"");
91 return lhs << to_string(rhs);
friend generator< font_variant > alternatives(font_variant start) noexcept
Get an alternative font variant.
Definition font_variant.hpp:75