import { createLocalFontOptions, type ThemeFontDefinition } from "./types";

const PRETENDARD_SRC = "../../fonts/pretendard-jp/PretendardJPVariable.woff2";

export const pretendardFont: ThemeFontDefinition = {
  name: "PretendardJPVariable",
  family: "Pretendard JP Variable",
  cssVariable: "--theme-font-family-pretendard",
  fallbacks: [
    "Pretendard JP",
    "Pretendard Variable",
    "Pretendard",
    "Inter",
    "-apple-system",
    "BlinkMacSystemFont",
    "Segoe UI",
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Malgun Gothic",
    "sans-serif",
  ],
  display: "swap",
  preload: true,
  sources: [
    {
      filename: PRETENDARD_SRC,
      weight: "100 900",
      style: "normal",
    },
  ],
};

export const pretendardLocalFont = createLocalFontOptions(
  pretendardFont,
  import.meta.url,
);
