|
ZenitUI
Retained-mode C++20 UI framework
|
Composable set of Unicode codepoints for static font-atlas baking. More...
#include <Utf8.hpp>
Public Member Functions | |
| CodepointSet & | addCodepoint (uint32_t cp) |
| Add a single valid Unicode scalar value. | |
| CodepointSet & | addRange (uint32_t first, uint32_t last) |
| Add an inclusive range [first, last], skipping UTF-16 surrogates. | |
| CodepointSet & | addFromUtf8 (std::string_view text) |
| Extract and add every valid printable codepoint from a UTF-8 string. | |
| CodepointSet & | merge (const CodepointSet &other) |
Merge all codepoints from other into this set. | |
| void | clear () |
| Remove all codepoints. | |
| bool | empty () const |
| true if no codepoints have been added. | |
| std::vector< int > | build () const |
| Build a sorted, deduplicated codepoint vector for font loading. | |
Composable set of Unicode codepoints for static font-atlas baking.
Provides common language/symbol presets (ascii, defaultLatin, latinExtendedA, greek, cyrillic, symbols) plus fluent builders (addRange, addCodepoint, addFromUtf8, merge) that produce a sorted, deduplicated std::vector<int> suitable for backends like Raylib's LoadFontEx.
|
inline |
Extract and add every valid printable codepoint from a UTF-8 string.
Useful to include specific symbols or localized strings directly, e.g. set.addFromUtf8("★☆♥♦♠♣✓✗→←").