fix: correctly parse filenames for woff/woff2 font files on Android, closes #1981 (#1990)

This commit is contained in:
Huang Xin
2025-09-07 13:04:48 +08:00
committed by GitHub
parent 782e9c8b20
commit d2242423f5
@@ -56,7 +56,8 @@ const CustomFonts: React.FC<CustomFontsProps> = ({ 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) {