HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
font_style.hpp
Go to the documentation of this file.
1// Copyright Take Vos 2023.
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
8#pragma once
9
10#include "../utility/utility.hpp"
11#include "../coroutine/module.hpp"
12
13hi_export_module(hikogui.font.font_style);
14
15namespace hi {
16inline namespace v1 {
17
26hi_export enum class font_style {
29 normal = 0,
30
33 italic = 1,
34
37 oblique = 1
38};
39
40// clang-format off
41constexpr auto font_style_metadata = enum_metadata{
42 font_style::normal, "normal",
43 font_style::italic, "italic",
44};
45// clang-format on
46
47hi_export [[nodiscard]] inline generator<font_style> alternatives(font_style start) noexcept
48{
49 if (start == font_style::normal) {
50 co_yield font_style::normal;
51 co_yield font_style::italic;
52 } else {
53 co_yield font_style::italic;
54 co_yield font_style::normal;
55 }
56}
57
58}}
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
font_style
The different styles a font-family comes with.
Definition font_style.hpp:26
@ italic
A font that is italic.
@ oblique
A font that is oblique.
@ normal
A font that is normal, non-italic.
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377