next/font tự động: download Google Fonts tại build time (không request runtime đến Google), host fonts trên cùng server, zero layout shift với automatic size adjustment, privacy tốt hơn.
- Dùng:
import { Inter } from 'next/font/google'; const inter = Inter({ subsets: ['latin'] }). - Apply qua className.
- Hỗ trợ local fonts qua next/font/local.
next/font automatically: downloads Google Fonts at build time (no runtime requests to Google), self-hosts them on the same server, eliminates layout shift with automatic size adjustment, and improves privacy.
- Usage:
import { Inter } from 'next/font/google'; const inter = Inter({ subsets: ['latin'] }). - Apply via className.
- Local fonts are supported through next/font/local.