pantoken / formats/icon-font/src / buildIconFont
Function: buildIconFont()
buildIconFont(
options?):Promise<IconFontResult>
Beta
Build the icon font.
Parameters
options?
BuildIconFontOptions = {}
Returns
Promise<IconFontResult>
The IconFontResult.
Examples
Build the full font and write the artifacts
ts
import { buildIconFont } from "@pantoken/icon-font";
import { writeFileSync } from "node:fs";
const font = await buildIconFont();
writeFileSync("PanTokens.woff2", font.woff2);
writeFileSync("PanTokens.ttf", font.ttf);
writeFileSync("icons.css", font.css);A custom font name and a subset of icons from another theme
ts
import { buildIconFont } from "@pantoken/icon-font";
const font = await buildIconFont({
fontName: "Instructure",
icons: ["arrow-left", "check-mark"],
theme: "canvas",
});
font.codepoints; // { "arrow-left": "e000", "check-mark": "e001" }