From b3fec7d9debd04fdbd97b8f4f5a24a2cf88a8504 Mon Sep 17 00:00:00 2001 From: Henry Heino Date: Fri, 5 Jul 2024 09:15:55 -0700 Subject: [PATCH] Desktop: Change default font to Avenir Next This is one possible fix for #10679. Benefits: - Relatively simple fix - We have confirmation that this, or a similar change, fixes the issue from a user on the Joplin Forum. Drawbacks: - Affects all platforms. - Somewhat changes the appearance of rendered notes. Has a noticeable effect on bold text (screenshots to be attached). Possible alternatives: - Try upgrading Electron. - There are a [few bugs](https://issues.chromium.org/issues?q=avenir) in the Chromium issue tracker that might be related: - https://issues.chromium.org/issues/328279705 (tagged as a duplicate of a WONTFIX(infeasible) bug), different repro conditions. - Use Montserrat as the default font and bundle it. Montserrat seems similar to Avenir and is licensed under the [Open Font License](https://fonts.google.com/specimen/Montserrat). - I don't think we can bundle Avenir, due to licensing. --- packages/app-desktop/app.ts | 2 +- packages/renderer/noteStyle.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/app-desktop/app.ts b/packages/app-desktop/app.ts index c0503faee64..6b436508fd1 100644 --- a/packages/app-desktop/app.ts +++ b/packages/app-desktop/app.ts @@ -204,7 +204,7 @@ class Application extends BaseApplication { public updateEditorFont() { const fontFamilies = []; if (Setting.value('style.editor.fontFamily')) fontFamilies.push(`"${Setting.value('style.editor.fontFamily')}"`); - fontFamilies.push('Avenir, Arial, sans-serif'); + fontFamilies.push('\'Avenir Next\', Avenir, Arial, sans-serif'); // The '*' and '!important' parts are necessary to make sure Russian text is displayed properly // https://github.com/laurent22/joplin/issues/155 diff --git a/packages/renderer/noteStyle.ts b/packages/renderer/noteStyle.ts index a702ac50ee6..6104d0ad100 100644 --- a/packages/renderer/noteStyle.ts +++ b/packages/renderer/noteStyle.ts @@ -58,7 +58,7 @@ export default function(theme: any, options: Options = null) { theme = theme ? theme : {}; - const fontFamily = '\'Avenir\', \'Arial\', sans-serif'; + const fontFamily = '\'Avenir Next\', \'Avenir\', \'Arial\', sans-serif'; const maxWidthTarget = options.contentMaxWidthTarget ? options.contentMaxWidthTarget : '#rendered-md'; const maxWidthCss = options.contentMaxWidth ? `