vercel / geist-font

https://vercel.com/font
SIL Open Font License 1.1
2.36k stars 64 forks source link

Inappropreate fallback font for Geist Mono #17

Closed mwskwong closed 11 months ago

mwskwong commented 11 months ago

Font Name (Geist Sans/Geist Mono):

Description of the Issue: Currently, Geist Mono makes use of adjustFontFallback from next/font, which defaults to Arial. Yet, for a monospace font, this makes absolutely no sense and may result in undesired text display behavior.

Steps to Reproduce:

  1. Import GeistMono and make use of it in a Next.js project

Expected Behavior: Geist Mono should make use of a monospace font as the fallback font. It can be done by adding the following options:

diff --git a/node_modules/geist/dist/font.js b/node_modules/geist/dist/font.js
index c1d4da3..ad07bdd 100644
--- a/node_modules/geist/dist/font.js
+++ b/node_modules/geist/dist/font.js
@@ -100,4 +100,6 @@ export const GeistMono = localFont({
     },
   ],
   variable: "--font-geist-mono",
+  adjustFontFallback: false,
+  fallback: ['monospace'],
 });

Screenshots: image

Environment (please complete the following information):

Additional Context: N/A