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
+7
View File
@@ -29,7 +29,13 @@ struct SdCardFontFamilyInfo {
class SdCardFontRegistry {
public:
static constexpr int MAX_SD_FAMILIES = 128;
// Primary (writable) location. All installs/downloads/deletes target this root.
static constexpr const char* FONTS_DIR = "/.crosspoint/fonts";
// Read-only fallback roots for upstream crosspoint-reader compatibility.
// Upstream uses "/.fonts" (preferred, hidden) and "/fonts" (visible). Both are
// scanned after the primary; primary wins on family-name conflicts.
static constexpr const char* FONTS_DIR_UPSTREAM_HIDDEN = "/.fonts";
static constexpr const char* FONTS_DIR_UPSTREAM_VISIBLE = "/fonts";
// Scan SD card, populate families_. Returns true if any families found.
bool discover();
@@ -44,4 +50,5 @@ class SdCardFontRegistry {
static bool parseFilename(const char* filename, uint8_t& size, uint8_t& style);
void scanDirectory(const char* dirPath, SdCardFontFamilyInfo& family);
void scanRoot(const char* rootPath);
};