diff --git a/apps/readest-app/src/app/reader/components/settings/FontPanel.tsx b/apps/readest-app/src/app/reader/components/settings/FontPanel.tsx index f3db1bbb..5ed3c11a 100644 --- a/apps/readest-app/src/app/reader/components/settings/FontPanel.tsx +++ b/apps/readest-app/src/app/reader/components/settings/FontPanel.tsx @@ -12,6 +12,7 @@ import { LINUX_FONTS, MACOS_FONTS, MONOSPACE_FONTS, + NON_FREE_FONTS, SANS_SERIF_FONTS, SERIF_FONTS, WINDOWS_FONTS, @@ -49,6 +50,10 @@ const handleFontFaceFont = (option: string, family: string) => { return `'${option}', ${family}`; }; +const filterNonFreeFonts = (font: string) => { + return !['android', 'linux'].includes(getOSPlatform()) || !NON_FREE_FONTS.includes(font); +}; + const FontFace = ({ className, family, @@ -291,7 +296,7 @@ const FontPanel: React.FC<{ bookKey: string }> = ({ bookKey }) => { className='config-item-top' family='serif' label={_('Serif Font')} - options={[...SERIF_FONTS, ...CJK_SERIF_FONTS]} + options={[...SERIF_FONTS.filter(filterNonFreeFonts), ...CJK_SERIF_FONTS]} moreOptions={sysFonts} selected={serifFont} onSelect={setSerifFont} @@ -299,7 +304,7 @@ const FontPanel: React.FC<{ bookKey: string }> = ({ bookKey }) => { ` +