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 iso_639 language = {};
18 iso_15924 script = {};
19 iso_3166 country = {};
20 font_family_id family_id = {};
21 font_variant variant = {};
22 int size = {};
23 hi::color color = {};
24
25 constexpr text_style() noexcept = default;
26 constexpr text_style(text_style const&) noexcept = default;
27 constexpr text_style(text_style&&) noexcept = default;
28 constexpr text_style& operator=(text_style const&) noexcept = default;
29 constexpr text_style& operator=(text_style&&) noexcept = default;
30 [[nodiscard]] constexpr friend bool operator==(text_style const&, text_style const&) noexcept = default;
31
32 constexpr text_style(
33 text_phrasing_mask phrasing_mask,
34 iso_639 language,
35 iso_15924 script,
36 iso_3166 country,
37 font_family_id family_id,
38 font_variant variant,
39 int size,
41 phrasing_mask(phrasing_mask),
42 language(language),
43 script(script),
44 country(country),
45 family_id(family_id),
46 variant(variant),
47 size(size),
49 {
50 }
51
52 [[nodiscard]] constexpr friend bool
53 matches(text_style const& lhs, text_phrasing phrasing, iso_639 language, iso_3166 country, iso_15924 script) noexcept
54 {
55 return matches(lhs.phrasing_mask, phrasing) and matches(lhs.language, language) and
56 matches(lhs.country, country) and matches(lhs.script, script);
57 }
58};
59
60}} // 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