#include <cstddef>
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
|
| namespace | donner |
| | Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
|
| namespace | donner::svg |
| | Donner SVG library, which can load, manipulate and render SVG files.
|
|
|
constexpr size_t | donner::svg::text_transform::kMaximumFullWidthBytes = 64u * 1024u * 1024u |
| | Maximum transient UTF-8 and source-index payload retained for one transformed span.
|
◆ FullWidthCodepoint()
| char32_t donner::svg::text_transform::FullWidthCodepoint |
( |
char32_t | codepoint, |
|
|
bool | preserveSpaces ) |
Return the Unicode full-width mapping, retaining a collapsed ASCII space unchanged.
- Parameters
-
| codepoint | Original Unicode codepoint. |
| preserveSpaces | Whether a U+0020 space was preserved by whitespace normalization. |
◆ MakeFullWidth()
| std::optional< FullWidthText > donner::svg::text_transform::MakeFullWidth |
( |
std::string_view | text, |
|
|
bool | preserveSpaces, |
|
|
size_t | maximumBytes = kMaximumFullWidthBytes ) |
Transform one source span, preserving codepoint count and original byte indices.
- Parameters
-
| text | Original normalized text, which remains unchanged. |
| preserveSpaces | Whether U+0020 survived whitespace normalization as preserved space. |
| maximumBytes | Maximum combined UTF-8 and source-index payload, checked before allocation. |
- Returns
- No result when the payload exceeds the bound or 32-bit shaping cluster indices.
◆ NeedsFullWidth()
| bool donner::svg::text_transform::NeedsFullWidth |
( |
std::string_view | text, |
|
|
bool | preserveSpaces ) |
Whether text contains a character whose full-width form differs.
- Parameters
-
| text | Original normalized UTF-8 text. |
| preserveSpaces | Whether U+0020 spaces were preserved by whitespace normalization. |