svgicons2svgfont
Version:
Read a set of SVG icons and output a SVG font
42 lines (41 loc) • 1.28 kB
TypeScript
import { Transform } from 'stream';
import { SVGPathData } from 'svg-pathdata';
import { SVGIconStream } from './iconsdir.js';
export { fileSorter } from './filesorter.js';
export * from './iconsdir.js';
export * from './metadata.js';
export interface SVGIcons2SVGFontStreamOptions {
fontName: string;
fontId: string;
fixedWidth: boolean;
descent: number;
ascent?: number;
round: number;
metadata: string;
usePathBounds: boolean;
normalize?: boolean;
preserveAspectRatio?: boolean;
centerHorizontally?: boolean;
centerVertically?: boolean;
fontWeight?: number | string;
fontHeight?: number;
fontStyle?: string;
callback?: (glyphs: Glyph[]) => void;
}
export interface Glyph {
name: string;
color?: string;
width: number;
height: number;
defaultHeight?: number | boolean;
defaultWidth?: number | boolean;
unicode: string[];
paths?: SVGPathData[];
}
export declare class SVGIcons2SVGFontStream extends Transform {
private _options;
glyphs: Glyph[];
constructor(options: Partial<SVGIcons2SVGFontStreamOptions>);
_transform(svgIconStream: SVGIconStream, _unused: unknown, svgIconStreamCallback: () => undefined): void;
_flush(svgFontFlushCallback: () => void): void;
}