Reads font information from file.
interface FontInfo {
family: string;
familylang: string;
style: string;
stylelang: string;
fullname: string;
fullnamelang: string;
file: string;
outline: boolean;
scalable: boolean;
lang: string;
capability: string;
fontformat: string;
decorative: boolean;
postscriptname: string;
color: boolean;
symbol: boolean;
variable: boolean;
}
This package depends on fc-scan
. Make sure you have it installed in your system.
npm i get-font-info
Using typescript or modern javascript:
import { getFontInfo } from "get-font-info";
const font = await getFontInfo("./Inter-Regular.otf");
console.log({ font });
Using es5:
const { geFontInfo } = require("get-font-info");
const font = await getFontInfo("./Inter-Regular.otf");
console.log({ font });