diff --git a/components/email/email-viewer.tsx b/components/email/email-viewer.tsx index a72135ac9..9d28f1389 100644 --- a/components/email/email-viewer.tsx +++ b/components/email/email-viewer.tsx @@ -662,6 +662,7 @@ export function EmailViewer({ const tWelcome = useTranslations('welcome'); const externalContentPolicy = useSettingsStore((state) => state.externalContentPolicy); const messageSpacing = useSettingsStore((state) => state.messageSpacing); + const plainTextFont = useSettingsStore((state) => state.plainTextFont); const mailAttachmentAction = useSettingsStore((state) => state.mailAttachmentAction); const attachmentPosition = useSettingsStore((state) => state.attachmentPosition); const addTrustedSender = useSettingsStore((state) => state.addTrustedSender); @@ -5024,7 +5025,7 @@ export function EmailViewer({ className="email-content-text text-foreground" dangerouslySetInnerHTML={{ __html: sanitizePlainTextRenderedHtml(effectiveEmailContent.html) }} style={{ - fontFamily: 'ui-monospace, "SF Mono", Consolas, monospace', + ...(plainTextFont === 'mono' && { fontFamily: 'ui-monospace, "SF Mono", Consolas, monospace' }), fontSize: '14px', lineHeight: '1.6', wordBreak: 'break-word', diff --git a/components/email/thread-conversation-view.tsx b/components/email/thread-conversation-view.tsx index 9b339cdca..26de3e08d 100644 --- a/components/email/thread-conversation-view.tsx +++ b/components/email/thread-conversation-view.tsx @@ -240,6 +240,7 @@ function EmailCard({ const mailAttachmentAction = useSettingsStore((state) => state.mailAttachmentAction); const hideInlineImageAttachments = useSettingsStore((state) => state.hideInlineImageAttachments); const emailAlwaysLightMode = useSettingsStore((state) => state.emailAlwaysLightMode); + const plainTextFont = useSettingsStore((state) => state.plainTextFont); const sender = email.from?.[0]; const isUnread = !email.keywords?.$seen; const isStarred = email.keywords?.$flagged; @@ -616,7 +617,7 @@ function EmailCard({ "[&_table]:border-collapse [&_td]:p-2 [&_th]:p-2", "[&_img]:max-w-full [&_img]:h-auto" )} - style={{ whiteSpace: 'pre-wrap', fontFamily: 'ui-monospace, "SF Mono", Consolas, monospace', fontSize: '13px' }} + style={{ whiteSpace: 'pre-wrap', ...(plainTextFont === 'mono' && { fontFamily: 'ui-monospace, "SF Mono", Consolas, monospace' }), fontSize: '13px' }} dangerouslySetInnerHTML={{ __html: sanitizePlainTextRenderedHtml(emailContent.html) }} /> )} diff --git a/components/settings/reading-settings.tsx b/components/settings/reading-settings.tsx index 8ce27ab5f..0c959e0d1 100644 --- a/components/settings/reading-settings.tsx +++ b/components/settings/reading-settings.tsx @@ -36,6 +36,7 @@ export function ReadingSettings() { hideInlineImageAttachments, attachmentImagePreviewsEnabled, messageSpacing, + plainTextFont, updateSetting, } = useSettingsStore(); @@ -130,6 +131,19 @@ export function ReadingSettings() { )} + {!isSettingHidden('plainTextFont') && ( + +