Geist Font Family
repository·main·Indexed 26 days ago
https://github.com/vercel/geist-fontGeist is a font family created by Vercel in collaboration with Basement Studio, optimized for modern web interfaces and developer tools. It includes Geist Sans, Geist Mono, and Geist Pixel. The documentation covers installation via npm, integration with Next.js (App and Pages Router), configuration with Tailwind CSS V3 and V4, and technical guidance for manual font building and validation using FontSpector.
What's inside geist
- To install the fonts directly on your system, download the latest release from the GitHub releases page and install the files manually.
Configure Geist fonts with Tailwind CSS V3
mainTo use Geist fonts with Tailwind CSS V3, inject the font variables into your layout using the
.variableproperty, then extend thefontFamilyin yourtailwind.config.js.// In app/layout.js import { GeistSans } from "geist/font/sans"; import { GeistMono } from "geist/font/mono"; import { GeistPixelSquare } from "geist/font/pixel"; export default function RootLayout({ children }) { return ( <html lang="en" className={`${GeistSans.variable} ${GeistMono.variable} ${GeistPixelSquare.variable}`} > <body>{children}</body> </html> ); } // In tailwind.config.js module.exports = { theme: { extend: { fontFamily: { sans: ["var(--font-geist-sans)"], mono: ["var(--font-geist-mono)"], "pixel-square": ["var(--font-geist-pixel-square)"], "pixel-grid": ["var(--font-geist-pixel-grid)"], "pixel-circle": ["var(--font-geist-pixel-circle)"], "pixel-triangle": ["var(--font-geist-pixel-triangle)"], "pixel-line": ["var(--font-geist-pixel-line)"], }, }, }, };Use Geist fonts with Next.js App Router
mainTo use Geist Sans in the Next.js App Router, import
GeistSansfromgeist/font/sansand apply itsclassNameto the<html>or<body>tag in yourapp/layout.jsfile.import { GeistSans } from "geist/font/sans"; export default function RootLayout({ children }) { return ( <html lang="en" className={GeistSans.className}> <body>{children}</body> </html> ); }Use Geist fonts with Next.js Pages Router
mainTo use Geist Sans in the Next.js Pages Router, import
GeistSansfromgeist/font/sansand apply itsclassNameto a wrapper element (like<main>) in yourpages/_app.jsfile.import { GeistSans } from "geist/font/sans"; export default function MyApp({ Component, pageProps }) { return ( <main className={GeistSans.className}> <Component {...pageProps} /> </main> ); }Build Geist fonts manually
mainIf you need to build the font files locally, you can use the provided
Makefilecommands:make build: Produces the font files.make test: Runs quality assurance tests using Fontspector.make proof: Generates HTML proof files.
make build make test make proofInstall the Geist font family via npm
mainYou can install the Geist font family (including Geist Sans, Geist Mono, and Geist Pixel) as an npm package using the
geistpackage.For full usage instructions, refer to the npm package documentation.
npm i geistConfigure Geist fonts with Tailwind CSS V4
mainTo use Geist fonts with Tailwind CSS V4, first inject the font variables into your layout using the
.variableproperty, then map them in yourtailwind.cssfile using the@themeblock.// In app/layout.js import { GeistSans } from "geist/font/sans"; import { GeistMono } from "geist/font/mono"; import { GeistPixelSquare } from "geist/font/pixel"; export default function RootLayout({ children }) { return ( <html lang="en" className={`${GeistSans.variable} ${GeistMono.variable} ${GeistPixelSquare.variable}`} > <body>{children}</body> </html> ); } // In tailwind.css @theme { --font-sans: var(--font-geist-sans); --font-mono: var(--font-geist-mono); --font-pixel-square: var(--font-geist-pixel-square); --font-pixel-grid: var(--font-geist-pixel-grid); --font-pixel-circle: var(--font-geist-pixel-circle); --font-pixel-triangle: var(--font-geist-pixel-triangle); --font-pixel-line: var(--font-geist-pixel-line); }Install the geist package
mainInstall the Geist font family using npm to access Geist Sans, Geist Mono, and Geist Pixel in your project.
npm install geistInterpret FontSpector report results
mainA FontSpector report provides detailed geometric analysis of glyph components (Lines and Quads) to identify potential issues in font construction.
Each entry in the report follows this pattern:
* [glyph_name] ([unicode]): [component_1]/[component_2] = [ratio]- Glyph Name/Unicode: The specific character or OpenType feature (e.g.,
a (U+0061),a.ss02,g.ss05) being analyzed. - Components: The report shows the relationship between two geometric primitives, such as
LineorQuad(QuadBez { ... }). The coordinatesp0,p1, andp2define the points of the Bezier curves or lines. - Ratio: The numerical value at the end of the line represents the calculated ratio between the two components.
Checks with FATAL results: These indicate critical geometric inconsistencies that must be addressed. All other checks: These represent non-fatal findings or standard geometric data.
- Glyph Name/Unicode: The specific character or OpenType feature (e.g.,
Troubleshoot FontSpector overlapping path segments
mainTheoverlapping-path-segmentswarning indicates that certain glyphs have path segments with identical coordinates. Overlapping segments can cause issues with font rendering engines and should be cleaned up.Troubleshoot FontSpector warnings: Contour counts
mainThecontour-countwarning flags glyphs that do not have the recommended number of contours based on typical reference font families. This may indicate a design divergence or a bug, such as a glyph mapped to an incorrect codepoint. Review the design and codepoint assignment for the flagged glyphs.Troubleshoot FontSpector warnings: Language shaping
mainThewarning-language-shapingwarning identifies issues with language-specific shaping, such as missing auxiliary orthography codepoints for specific languages (e.g., Catalan, Finnish, Dutch, German, Russian, etc.) or failures in attaching combining marks (likeacutecomb) to specific codepoints during shaping.