Self-host Anuphan font instead of next/font/google

The Coolify build server has no outbound access to fonts.googleapis.com,
which crashed `npm run build` inside the Docker build with a next/font
google-loader TypeError. Switch to next/font/local with the variable TTF
fetched from the Google Fonts GitHub repo (same OFL-licensed font, no
build-time network dependency).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
chaloemphong
2026-11-22 12:31:13 +07:00
parent 9d32552457
commit 1cb75a163f
3 changed files with 99 additions and 4 deletions
+6 -4
View File
@@ -1,11 +1,13 @@
import type { Metadata, Viewport } from "next";
import { Anuphan } from "next/font/google";
import localFont from "next/font/local";
import { ServiceWorker } from "@/components/ServiceWorker";
import "./globals.css";
const anuphan = Anuphan({
subsets: ["thai", "latin"],
weight: ["400", "500", "600", "700"],
// Self-hosted (not next/font/google): the Coolify build server has no egress
// to fonts.googleapis.com, which crashed `npm run build` there.
const anuphan = localFont({
src: "./fonts/Anuphan-Variable.ttf",
weight: "100 700",
variable: "--font-anuphan",
display: "swap",
});