FarsiUI
شفیق

XB Shafigh Uzbek

منبع
وزن

نصب

روش نصب را انتخاب کنید

یک دستور — فایل‌های فونت و لایسنس در app/fonts کپی می‌شوند.

Terminal
npx farsiui@latest add font-shafigh

ساختار بعد از add:

app/fonts/
app/
└── fonts/
    └── shafigh/
        ├── Shafigh-Regular.woff2
        ├── Shafigh-Bold.woff2
        ├── Shafigh-Italic.woff2
        ├── Shafigh-BoldItalic.woff2
        ├── font-face.css
        ├── LICENSE
        └── OFL.txt

فونت را با next/font/local به layout وصل کنید.

app/layout.tsx
import localFont from "next/font/local"

const shafigh = localFont({
  src: "./fonts/shafigh/Shafigh-Regular.woff2",
  variable: "--font-shafigh",
  weight: "400",
  display: "swap",
})

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html
      lang="fa"
      dir="rtl"
      className={`${shafigh.variable} ${shafigh.className}`}
    >
      <body className="antialiased">{children}</body>
    </html>
  )
}

اختیاری — اگر className روی html کافی است رد شوید. در غیر این صورت برای توکن Tailwind از @theme و بدون Tailwind از body استفاده کنید.

app/globals.css
@theme inline {
  --font-sans: var(--font-shafigh), ui-sans-serif, system-ui, sans-serif;
}

body {
  font-family: var(--font-shafigh), ui-sans-serif, system-ui, sans-serif;
}