From d2242423f51d9c8871ed04c68c5f45065883f1fb Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Sun, 7 Sep 2025 13:04:48 +0800 Subject: [PATCH] fix: correctly parse filenames for woff/woff2 font files on Android, closes #1981 (#1990) --- .../src/app/reader/components/settings/CustomFonts.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/readest-app/src/app/reader/components/settings/CustomFonts.tsx b/apps/readest-app/src/app/reader/components/settings/CustomFonts.tsx index cad669f9..7a1e30cf 100644 --- a/apps/readest-app/src/app/reader/components/settings/CustomFonts.tsx +++ b/apps/readest-app/src/app/reader/components/settings/CustomFonts.tsx @@ -56,7 +56,8 @@ const CustomFonts: React.FC = ({ bookKey, onBack }) => { let fontFile: File; if (selectedFile.path) { const filePath = selectedFile.path; - fontPath = getFilename(filePath); + const fileobj = await appService!.fs.openFile(filePath, 'None'); + fontPath = fileobj.name || getFilename(filePath); await appService!.fs.copyFile(filePath, fontPath, 'Fonts'); fontFile = await appService!.fs.openFile(fontPath, 'Fonts'); } else if (selectedFile.file) {