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:
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user