29 [[nodiscard]]
constexpr static size_t size()
noexcept
31 return font_weight_metadata.size() * font_style_metadata.size();
35 _value(narrow_cast<uint8_t>((std::to_underlying(weight) << 1) | std::to_underlying(style)))
43 [[nodiscard]]
constexpr operator size_t()
const noexcept
45 return std::to_underlying(style()) + std::to_underlying(weight()) * font_style_metadata.size();
48 [[nodiscard]]
size_t hash()
const noexcept
58 [[nodiscard]]
constexpr font_style style()
const noexcept
60 return static_cast<font_style
>(_value & 1);
66 _value |= std::to_underlying(rhs) << 1;
70 constexpr font_variant& set_style(font_style rhs)
noexcept
73 _value |= std::to_underlying(rhs);
85 for (
auto const s : alternatives(start.style())) {
86 for (
auto const w : alternatives(start.weight())) {
94 return std::format(
"{}", rhs.weight(), rhs.style() == font_style::italic ?
"/italic" :
"");
99 return lhs << to_string(rhs);
friend generator< font_variant > alternatives(font_variant start) noexcept
Get an alternative font variant.
Definition font_variant.hpp:83