Some font management improvements

This commit is contained in:
jpirnay
2026-05-20 14:11:50 +02:00
parent 438ed0b47e
commit b1e430f1ca
11 changed files with 256 additions and 40 deletions
+11
View File
@@ -31,10 +31,21 @@ class FontInstaller {
/// Validate a .cpfont file on disk (check magic bytes).
bool validateCpfontFile(const char* path);
/// Compute CRC32 of a file (esp_rom_crc32_le accumulator, matches
/// zlib.crc32 used by scripts/generate-font-manifest.py). Returns false if
/// the file cannot be opened. Mirrors the upstream PR #1904 approach so
/// our manifests stay binary-compatible.
static bool computeFileCrc32(const char* path, uint32_t& outCrc);
/// Build the full SD path for a font file.
/// Writes "/.crosspoint/fonts/<family>/<filename>" to outBuf.
static void buildFontPath(const char* family, const char* filename, char* outBuf, size_t outBufSize);
/// Build the staging-dir path "<FONTS_DIR>/<family>__staging".
static void buildStagingDirPath(const char* family, char* outBuf, size_t outBufSize);
/// Build the backup-dir path "<FONTS_DIR>/<family>__backup".
static void buildBackupDirPath(const char* family, char* outBuf, size_t outBufSize);
/// Delete a family directory and all .cpfont files in it.
/// If the deleted family is the active reader font, clears the setting.
Error deleteFamily(const char* familyName);