HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
FontGraphemeID.hpp
1// Copyright 2020 Pokitec
2// All rights reserved.
3
4#pragma once
5
6#include "TTauri/Foundation/hash.hpp"
7#include "TTauri/Text/FontID.hpp"
8#include "TTauri/Text/Grapheme.hpp"
9
10namespace tt {
11
15 FontID font_id;
16 Grapheme g;
17
18 [[nodiscard]] size_t hash() const noexcept {
19 return hash_mix(font_id, g);
20 }
21
22 [[nodiscard]] friend bool operator==(FontGraphemeID const &lhs, FontGraphemeID const &rhs) noexcept {
23 return (lhs.font_id == rhs.font_id) && (lhs.g == rhs.g);
24 }
25};
26
27}
28
29namespace std {
30
31template<>
32struct hash<tt::FontGraphemeID> {
33 [[nodiscard]] size_t operator() (tt::FontGraphemeID const &rhs) const noexcept {
34 return rhs.hash();
35 }
36};
37
38}
STL namespace.
Combined FontID + Grapheme for use as a key in a std::unordered_map.
Definition FontGraphemeID.hpp:14
Definition Grapheme.hpp:20
T operator()(T... args)