Font Manager Update

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
jpirnay
2026-05-04 00:34:17 +02:00
co-authored by Copilot
parent 4946bd1b35
commit 3df8ce56de
6 changed files with 43 additions and 7 deletions
@@ -128,8 +128,14 @@ bool FontDownloadActivity::fetchAndParseManifest() {
if (family.installed) {
for (const auto& file : family.files) {
std::string localFilename = file.name;
std::string familyPrefix = family.name + "/";
if (localFilename.find(familyPrefix) == 0) {
localFilename = localFilename.substr(familyPrefix.length());
}
char path[128];
FontInstaller::buildFontPath(family.name.c_str(), file.name.c_str(), path, sizeof(path));
FontInstaller::buildFontPath(family.name.c_str(), localFilename.c_str(), path, sizeof(path));
FsFile f;
if (Storage.openFileForRead("FONT", path, f)) {
size_t actual = f.fileSize();
@@ -219,8 +225,14 @@ void FontDownloadActivity::downloadFamily(ManifestFamily& family) {
}
requestUpdateAndWait();
std::string localFilename = file.name;
std::string familyPrefix = family.name + "/";
if (localFilename.find(familyPrefix) == 0) {
localFilename = localFilename.substr(familyPrefix.length());
}
char stagedPath[128];
snprintf(stagedPath, sizeof(stagedPath), "%s/%s", stagingDir, file.name.c_str());
snprintf(stagedPath, sizeof(stagedPath), "%s/%s", stagingDir, localFilename.c_str());
// Make sure parent directories exist for the file
std::string stagedPathStr(stagedPath);