0
0
NextJSframework~5 mins

Font optimization and self-hosting in NextJS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is font optimization in Next.js?
Font optimization in Next.js means loading fonts in a way that makes pages load faster and look good quickly. It automatically preloads and subsets fonts to reduce the size and improve performance.
Click to reveal answer
beginner
Why should you self-host fonts instead of using third-party font providers?
Self-hosting fonts means storing font files on your own server. This improves privacy, reduces external requests, and gives you full control over font loading and caching.
Click to reveal answer
intermediate
How do you add a Google font with optimization in Next.js?
You can import fonts from 'next/font/google' and use them as React components. Next.js will automatically optimize and preload these fonts for you.
Click to reveal answer
intermediate
What is the benefit of font subsetting?
Font subsetting means including only the characters you need from a font. This reduces file size and speeds up page loading.
Click to reveal answer
intermediate
How can you self-host custom fonts in a Next.js project?
Place font files in the public folder, then use CSS @font-face rules to load them. This lets you control font loading without relying on external services.
Click to reveal answer
What does Next.js do automatically when you import fonts from 'next/font/google'?
AUploads fonts to a third-party server
BPreloads and subsets fonts for better performance
CConverts fonts to images
DDisables font loading
Why is self-hosting fonts better for privacy?
ABecause it avoids sending user data to external font servers
BBecause it encrypts fonts automatically
CBecause it hides fonts from the browser
DBecause it disables fonts
Where should you place font files to self-host them in a Next.js project?
AIn the node_modules folder
BIn the styles folder only
CIn the pages folder
DIn the public folder
What is font subsetting?
AIncluding only needed characters in a font file
BChanging font colors
CConverting fonts to SVG
DUsing multiple fonts at once
Which of these is NOT a benefit of font optimization?
AFaster page load times
BReduced font file size
CAutomatic font color changes
DBetter user experience
Explain how Next.js helps with font optimization when using Google Fonts.
Think about how Next.js handles font files behind the scenes.
You got /4 concepts.
    Describe the steps to self-host a custom font in a Next.js project.
    Consider where static files go and how CSS loads fonts.
    You got /4 concepts.