mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-04 13:02:50 -05:00
FontDb::new copied every bundled and craft-fonts font into the font catalog with add_bytes, which keeps its own copy of the bytes. A CLI run that exports a small SVG peaked at about 130 MiB, against about 26 MiB in 0.24.1. The database now adds the bundled fonts the first time FontDb::catalog is called, and its own catalog lookups go through that call. A run that never looks a font up in the catalog does not copy them: exporting a 10 x 10 SVG with vectorcraft-cli on Linux peaks at 42 MiB instead of 130 MiB, with the same PNG. The workaround can go once the catalog takes static bytes without copying them (craft-libs#4888). Part of #10666