fix: compatibility fix for some formerly imported corrupted metadata (#307)

* fix: compatibility fix for some formerly imported corrupted metadata

* fix: use font family names of sys fonts
This commit is contained in:
Huang Xin
2025-02-07 02:53:30 +01:00
parent 023ba663e3
commit adfdb10d8e
9 changed files with 17 additions and 11 deletions
+1 -1
View File
@@ -64,8 +64,8 @@ export const getBookLangCode = (lang: string | string[] | undefined) => {
};
export const formatAuthors = (
bookLang: string | string[] | undefined,
contributors: string | Contributor | [string | Contributor],
bookLang?: string | string[],
) => {
const langCode = getBookLangCode(bookLang);
return Array.isArray(contributors)
+1 -1
View File
@@ -17,7 +17,7 @@ export const getSysFontsList = async (): Promise<string[]> => {
const osPlatform = getOSPlatform();
if (FONT_ENUM_SUPPORTED_OS_PLATFORMS.includes(osPlatform)) {
const fonts = await invoke<string[]>('list_fonts');
cachedSysFonts = fonts.filter((font) => !isSymbolicFontName(font)).sort();
cachedSysFonts = [...new Set(fonts.filter((font) => !isSymbolicFontName(font)))].sort();
console.log('Fetched font list:', cachedSysFonts);
return cachedSysFonts;
} else {