refactor(fonts): 将Google字体替换为本地字体文件

使用本地字体文件替代Google字体,提升加载性能并避免隐私问题
This commit is contained in:
2026-01-22 16:21:30 +08:00
parent e27b08a9e6
commit 8a6a0c2dca

View File

@@ -4,20 +4,32 @@ import { TooltipProvider } from "@/components/ui/tooltip";
import { DATA } from "@/data/resume"; import { DATA } from "@/data/resume";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import type { Metadata } from "next"; import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google"; import localFont from "next/font/local";
import "./globals.css"; import "./globals.css";
import { FlickeringGrid } from "@/components/magicui/flickering-grid"; import { FlickeringGrid } from "@/components/magicui/flickering-grid";
const geist = Geist({ const geist = localFont({
subsets: ["latin"], src: [
{
path: "../../public/fonts/CabinetGrotesk-Medium.ttf",
weight: "500",
style: "normal",
},
],
variable: "--font-sans", variable: "--font-sans",
weight: ["400", "500", "600", "700"], display: "swap",
}); });
const geistMono = Geist_Mono({ const geistMono = localFont({
subsets: ["latin"], src: [
weight: ["300", "400", "500", "600", "700"], {
path: "../../public/fonts/ClashDisplay-Semibold.ttf",
weight: "600",
style: "normal",
},
],
variable: "--font-mono", variable: "--font-mono",
display: "swap",
}); });
export const metadata: Metadata = { export const metadata: Metadata = {