@sheetxl/models
Version:
Models - A Headless javascript spreadsheet library.
46 lines • 1.4 kB
TypeScript
import { IFontFace } from "./FontFace";
export declare enum FontGenericName {
Serif = "serif",
SanSerif = "sans-serif",
MonoSpace = "monospace",
Cursive = "cursive",
Fantasy = "fantasy",
SystemUI = "system-ui",// call this UISystem for consistency?
UISystem = "system-ui",// call this UISystem for consistency?
UISerif = "ui-serif",
UISanSerif = "ui-sans-serif",
UIMonoSpace = "ui-monospace",
UIRounded = "ui-rounded",
Math = "math",
Emoji = "emoji",
Fangsong = "fangsong"
}
export interface FontHandle {
fontRef: IFontFace;
loaded: boolean;
}
export declare function setFontList(fontList: IFontFace[] | string[]): void;
export declare function getFontList(): readonly FontHandle[];
export interface FindClosestFontOptions {
/**
* Defaults to false
*/
bold?: boolean;
/**
* Defaults to false
*/
italic?: boolean;
/**
* A list of font names or generic font family
*/
fallbacks?: string[];
panose?: string;
}
/**
* Tries to find a font that match the fontName exactly. If this is not found then it will use the fallback
* options if provided. If there is no font and no font fallback it will return null.
* @param fontName
* @returns
*/
export declare const S: (fontName: string, options?: FindClosestFontOptions) => FontHandle;
//# sourceMappingURL=FontLibrary.d.ts.map