#include <cstddef>
#include <cstdint>
#include <span>
#include <vector>
|
|
constexpr std::size_t | donner::fonts::kMaximumCffOutlineValidationWork = 64 * 1024 * 1024 |
| | Default whole-font work ceiling for one bounded CFF validation.
|
◆ CffOutlineValidationStatus
Outcome of bounded CFF outline validation.
| Enumerator |
|---|
| Complete | Every glyph validated within the work budget.
|
| UnsupportedVariation | Variable CFF2 operators require a decoder this validator cannot bound.
|
| WorkLimitExceeded | Validation exhausted the caller's work budget.
|
| Invalid | The CFF data is malformed.
|
◆ ValidateCffOutlineComplexities()
| CffOutlineValidationResult donner::fonts::ValidateCffOutlineComplexities |
( |
std::span< const uint8_t > | table, |
|
|
bool | cff2, |
|
|
std::size_t | expectedGlyphs, |
|
|
std::size_t | maximumWork = kMaximumCffOutlineValidationWork ) |
Validate CFF1 or non-variable CFF2 charstrings without materializing outlines.
Variable CFF2 operators return donner::fonts::CffOutlineValidationStatus::UnsupportedVariation so callers can retain directory validation while failing closed before an untrusted outline decoder. Legacy CFF1 endchar composites include their resolved component costs in the returned bound.
- Parameters
-
| table | Exact CFF or CFF2 table bytes. |
| cff2 | Whether table uses CFF2 structures and CharStrings. |
| expectedGlyphs | Glyph count from the sfnt maxp table. |
| maximumWork | Caller-owned work remaining for this validation. |