For local fonts, place your font files in the /documents/static directory and use @font-face to define them:
All font files must be placed in the /documents/static directory of your project. This is the required location for serving static assets in your document templates.
Copy
import { Document, Head } from "@htmldocs/react"function MyDocument() { return ( <Document> <Head> <style> {` @font-face { font-family: 'CustomFont'; src: url('/static/fonts/CustomFont.woff2') format('woff2'), url('/static/fonts/CustomFont.woff') format('woff'); font-weight: normal; font-style: normal; font-display: swap; } `} </style> </Head> <div style={{ fontFamily: 'CustomFont' }}> Text using local custom font </div> </Document> )}