fix
All checks were successful
Build And Deploy Main / build-and-deploy (push) Successful in 35s

This commit is contained in:
2026-03-12 13:45:39 -04:00
parent 45c8c66620
commit 66b8c3011a
3 changed files with 32 additions and 18 deletions

Binary file not shown.

View File

@@ -47,20 +47,32 @@ const findTemplatePathBySite = (site) => {
const findUnicodeFontPath = (site) => {
const safeSite = [1, 2, 3].includes(Number(site)) ? Number(site) : 1;
const fileName = "NotoSansCJKsc-Regular.otf";
const primaryFileName = "NotoSansSC-VF.ttf";
const fallbackFileName = "NotoSansCJKsc-Regular.otf";
const cwd = process.cwd();
const candidatePaths = [
path.join(ROOT_DIR, "app", "assets", "fonts", fileName),
path.join(ROOT_DIR, "app", "views", "upload", fileName),
path.join(ROOT_DIR, "client", "build", "upload", fileName),
path.join(ROOT_DIR, "client", "public", "upload", fileName),
path.join(cwd, "app", "assets", "fonts", fileName),
path.join(cwd, "app", "views", "upload", fileName),
path.join(cwd, "client", "build", "upload", fileName),
path.join(cwd, "client", "public", "upload", fileName),
path.join("/www/wwwroot/upload", fileName),
path.join(`/www/wwwroot/worldshine${safeSite}`, "app", "assets", "fonts", fileName),
path.join(`/www/wwwroot/worldshine${safeSite}-tspt`, "app", "assets", "fonts", fileName)
path.join(ROOT_DIR, "app", "assets", "fonts", primaryFileName),
path.join(ROOT_DIR, "app", "views", "upload", primaryFileName),
path.join(ROOT_DIR, "client", "build", "upload", primaryFileName),
path.join(ROOT_DIR, "client", "public", "upload", primaryFileName),
path.join(cwd, "app", "assets", "fonts", primaryFileName),
path.join(cwd, "app", "views", "upload", primaryFileName),
path.join(cwd, "client", "build", "upload", primaryFileName),
path.join(cwd, "client", "public", "upload", primaryFileName),
path.join("/www/wwwroot/upload", primaryFileName),
path.join(`/www/wwwroot/worldshine${safeSite}`, "app", "assets", "fonts", primaryFileName),
path.join(`/www/wwwroot/worldshine${safeSite}-tspt`, "app", "assets", "fonts", primaryFileName),
path.join(ROOT_DIR, "app", "assets", "fonts", fallbackFileName),
path.join(ROOT_DIR, "app", "views", "upload", fallbackFileName),
path.join(ROOT_DIR, "client", "build", "upload", fallbackFileName),
path.join(ROOT_DIR, "client", "public", "upload", fallbackFileName),
path.join(cwd, "app", "assets", "fonts", fallbackFileName),
path.join(cwd, "app", "views", "upload", fallbackFileName),
path.join(cwd, "client", "build", "upload", fallbackFileName),
path.join(cwd, "client", "public", "upload", fallbackFileName),
path.join("/www/wwwroot/upload", fallbackFileName),
path.join(`/www/wwwroot/worldshine${safeSite}`, "app", "assets", "fonts", fallbackFileName),
path.join(`/www/wwwroot/worldshine${safeSite}-tspt`, "app", "assets", "fonts", fallbackFileName)
];
return candidatePaths.find((candidate) => fs.existsSync(candidate)) || "";
};
@@ -278,7 +290,7 @@ exports.exportRouteReportZip = async (req, res) => {
return res.status(500).send({ message: `Missing PDF template for site ${site}.` });
}
if (!unicodeFontPath) {
return res.status(500).send({ message: "Missing Unicode font file: NotoSansCJKsc-Regular.otf" });
return res.status(500).send({ message: "Missing Unicode font file: NotoSansSC-VF.ttf" });
}
const [routes, drivers, vehicles] = await Promise.all([