Donner SVG 0.8.0
0.8.0 ยท ebf353960.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::editor::FontPreviewCache Class Reference

Bounded on-disk outlined SVG previews with validated RGBA reloads. More...

#include "donner/editor/FontPreviewCache.h"

Public Member Functions

 FontPreviewCache (std::filesystem::path directory, std::string buildIdentity)
std::optional< svg::RendererBitmap > load (std::string_view family, std::string_view contentIdentity, Vector2i dimensions) const
 Load only when the build, font asset, dimensions, and sidecar integrity match.
void store (std::string_view family, std::string_view contentIdentity, std::string_view outlinedSvg, const svg::RendererBitmap &bitmap) const
 Persist a preview after the resolved text was converted to outline paths.

Detailed Description

Bounded on-disk outlined SVG previews with validated RGBA reloads.

Constructor & Destructor Documentation

◆ FontPreviewCache()

donner::editor::FontPreviewCache::FontPreviewCache ( std::filesystem::path directory,
std::string buildIdentity )
Parameters
directoryPrivate per-user cache directory; empty disables persistence.
buildIdentityEmbedded editor build identity.

Member Function Documentation

◆ load()

std::optional< svg::RendererBitmap > donner::editor::FontPreviewCache::load ( std::string_view family,
std::string_view contentIdentity,
Vector2i dimensions ) const
nodiscard

Load only when the build, font asset, dimensions, and sidecar integrity match.

Parameters
familyFont family displayed in the menu.
contentIdentityImmutable catalog content id and generation.
dimensionsExpected output bitmap dimensions.

◆ store()

void donner::editor::FontPreviewCache::store ( std::string_view family,
std::string_view contentIdentity,
std::string_view outlinedSvg,
const svg::RendererBitmap & bitmap ) const

Persist a preview after the resolved text was converted to outline paths.

Parameters
familyFont family displayed in the menu.
contentIdentityImmutable catalog content id and generation.
outlinedSvgStandalone SVG containing paths and no text nodes.
bitmapRendered bitmap for immediate subsequent display.

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