Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::css::FontFaceSource Struct Reference

A single entry listed in src:-either a local face, a URL, or inline data. More...

#include "donner/css/FontFace.h"

Public Types

enum class  Kind : uint8_t {
  Local ,
  Url ,
  Data
}
 Specifies the source type for a font face declaration. More...

Public Attributes

Kind kind
 Font source kind.
std::variant< RcString, std::shared_ptr< const std::vector< uint8_t > > > payload
 The payload of the source, which can be a URL or shared font data bytes. Using shared_ptr for the data variant avoids deep-copying font bytes (~13MB per font set) when FontFace objects are copied across documents, preventing glibc heap fragmentation in test suites.
RcString formatHint
 Format hint, if provided, e.g. "woff2" or "opentype".
std::vector< RcStringtechHints
 Technology hints, if provided, e.g. {"variations","color-COLRv1"}.
bool trusted = false
 True only for application-controlled font bytes, never parsed document sources.

Detailed Description

A single entry listed in src:-either a local face, a URL, or inline data.

FontFaceIdentityKey is total over every field below: it is what decides whether two declarations are the same declaration, and callers deduplicate on it, dropping the later of two that match. A field added here without being added there makes two sources that differ only in that field indistinguishable, and the second one is then silently discarded in favour of the first. Extend the key with any field added here.

Member Enumeration Documentation

◆ Kind

enum class donner::css::FontFaceSource::Kind : uint8_t
strong

Specifies the source type for a font face declaration.

Enumerator
Local 

Font is loaded from a local system font by name (local() function).

Url 

Font is loaded from a remote URL or file path (url() function).

Data 

Font is embedded as inline data using a data URI scheme.


The documentation for this struct was generated from the following file: