Chris Tate 5 月之前
父节点
当前提交
0199896b6d
共有 3 个文件被更改,包括 9 次插入11 次删除
  1. 8 10
      apps/web/app/og/route.tsx
  2. 二进制
      apps/web/public/Geist-Regular.ttf
  3. 1 1
      examples/dashboard/next-env.d.ts

+ 8 - 10
apps/web/app/og/route.tsx

@@ -1,11 +1,9 @@
 import { ImageResponse } from "next/og";
 
-export const runtime = "edge";
-
-export async function GET() {
-  const geistSemiBold = await fetch(
-    new URL("../fonts/GeistVF.woff", import.meta.url),
-  ).then((res) => res.arrayBuffer());
+export async function GET(request: Request) {
+  const geist = await fetch(new URL("/Geist-Regular.ttf", request.url)).then(
+    (res) => res.arrayBuffer(),
+  );
 
   return new ImageResponse(
     <div
@@ -20,9 +18,9 @@ export async function GET() {
     >
       <span
         style={{
-          fontSize: 72,
+          fontSize: 144,
           fontFamily: "Geist",
-          fontWeight: 600,
+          fontWeight: 400,
           color: "white",
           letterSpacing: "-0.02em",
         }}
@@ -36,9 +34,9 @@ export async function GET() {
       fonts: [
         {
           name: "Geist",
-          data: geistSemiBold,
+          data: geist,
           style: "normal",
-          weight: 600,
+          weight: 400,
         },
       ],
     },

二进制
apps/web/public/Geist-Regular.ttf


+ 1 - 1
examples/dashboard/next-env.d.ts

@@ -1,6 +1,6 @@
 /// <reference types="next" />
 /// <reference types="next/image-types/global" />
-import "./.next/types/routes.d.ts";
+import "./.next/dev/types/routes.d.ts";
 
 // NOTE: This file should not be edited
 // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.