HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
text_style.hpp
1// Copyright Take Vos 2021-2022.
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
5#pragma once
6
7#include "../i18n/module.hpp"
8#include "../font/font_family_id.hpp"
9#include "../font/font_variant.hpp"
10#include "../color/color.hpp"
11#include "text_phrasing.hpp"
12
13namespace hi { inline namespace v1 {
14
15struct text_style {
16 text_phrasing_mask phrasing_mask = {};
17 language_tag language_mask = {};
18 font_family_id family_id = {};
19 font_variant variant = {};
20 float size = 0.0f;
21 hi::color color = {};
22
23 constexpr text_style() noexcept = default;
24 constexpr text_style(text_style const&) noexcept = default;
25 constexpr text_style(text_style&&) noexcept = default;
26 constexpr text_style& operator=(text_style const&) noexcept = default;
27 constexpr text_style& operator=(text_style&&) noexcept = default;
28 [[nodiscard]] constexpr friend bool operator==(text_style const&, text_style const&) noexcept = default;
29
30 constexpr text_style(
31 text_phrasing_mask phrasing_mask,
32 language_tag language_mask,
33 font_family_id family_id,
34 font_variant variant,
35 float size,
37 phrasing_mask(phrasing_mask),
38 language_mask(language_mask),
39 family_id(family_id),
40 variant(variant),
41 size(size),
43 {
44 }
45
46 [[nodiscard]] constexpr friend bool
47 matches(text_style const& lhs, text_phrasing phrasing, language_tag language) noexcept
48 {
49 return matches(lhs.phrasing_mask, phrasing) and matches(lhs.language_mask, language);
50 }
51};
52
53}} // namespace hi::v1
Defined the color type.
The text_phrasing type.
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
This is a RGBA floating point color.
Definition color.hpp:44
Definition text_style.hpp:15