webfont 11.2.26 → 12.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.md +165 -0
- package/README.md +302 -34
- package/dist/browser.js +4 -0
- package/dist/cli.mjs +893 -0
- package/dist/index.js +1 -507
- package/dist/parseTemplateOption-5T7rSw5J.mjs +20 -0
- package/dist/parseTemplateOption-BmH_pcQh.js +1 -0
- package/dist/renderTemplates-DvRlS58E.mjs +93 -0
- package/dist/renderTemplates-zCYCzeOt.js +1 -0
- package/dist/src/browser.d.ts +2 -0
- package/dist/src/index.d.ts +4 -2
- package/dist/src/lib/applyOptimizeSvgToGlyphs.d.ts +3 -0
- package/dist/src/lib/evenoddFillRule.d.ts +2 -0
- package/dist/src/lib/execCLI/index.d.ts +3 -4
- package/dist/src/lib/inputSource.d.ts +2 -0
- package/dist/src/lib/inputSourceUtils.d.ts +4 -0
- package/dist/src/lib/largeFontLigatures.d.ts +4 -0
- package/dist/src/lib/optimizeSvgGlyphs.d.ts +4 -0
- package/dist/src/lib/p-limit/index.d.ts +2 -0
- package/dist/src/lib/parseFormats.d.ts +4 -0
- package/dist/src/lib/parseTemplateOption.d.ts +2 -0
- package/dist/src/lib/runtimeEnvironment.d.ts +4 -0
- package/dist/src/lib/sfnt/flavor.d.ts +2 -0
- package/dist/src/lib/svgDiagnostics/diagnoseSvgContents.d.ts +12 -0
- package/dist/src/lib/svgFontOutput/emptyGlyphPaths.d.ts +3 -0
- package/dist/src/lib/svgTools/applySvgDiagnostics.d.ts +13 -0
- package/dist/src/lib/svgTools/applySvgTools.d.ts +14 -0
- package/dist/src/lib/svgTools/normalizeSvgToolsOptions.d.ts +2 -0
- package/dist/src/lib/svgicons2svgfont/index.d.ts +14 -0
- package/dist/src/lib/svgicons2svgfont/metadataFromSrcPath.d.ts +11 -0
- package/dist/src/lib/templateUnicodeRange.d.ts +4 -0
- package/dist/src/lib/ttf2eot/index.d.ts +2 -0
- package/dist/src/lib/ttfEncode.d.ts +5 -0
- package/dist/src/standalone/convertTtfInput.d.ts +3 -0
- package/dist/src/standalone/convertWebfontInput.d.ts +3 -0
- package/dist/src/standalone/defaultOptions.d.ts +3 -0
- package/dist/src/standalone/fetchWebfontUrl.d.ts +1 -0
- package/dist/src/standalone/generateSvgFont.d.ts +2 -0
- package/dist/src/standalone/getGlyphsDataFromInputs.d.ts +3 -0
- package/dist/src/standalone/glyphsData.d.ts +2 -2
- package/dist/src/standalone/index.d.ts +8 -3
- package/dist/src/standalone/inputMode.d.ts +9 -0
- package/dist/src/standalone/options.d.ts +3 -3
- package/dist/src/standalone/optionsFromGlyphs.d.ts +3 -0
- package/dist/src/standalone/renderTemplates.d.ts +10 -0
- package/dist/src/standalone/runSvgPipeline.d.ts +3 -0
- package/dist/src/standalone/templateFonts.d.ts +3 -0
- package/dist/src/standalone/toTtf.d.ts +4 -0
- package/dist/src/standalone/validateWebfontOptions.d.ts +6 -0
- package/dist/src/standalone/webfontFromGlyphs.d.ts +3 -0
- package/dist/src/types/DecompressedFont.d.ts +5 -0
- package/dist/src/types/Format.d.ts +4 -4
- package/dist/src/types/GlyphContentTransformFn.d.ts +2 -0
- package/dist/src/types/GlyphData.d.ts +2 -2
- package/dist/src/types/GlyphInput.d.ts +6 -0
- package/dist/src/types/GlyphMetadata.d.ts +1 -1
- package/dist/src/types/GlyphTransformFn.d.ts +2 -2
- package/dist/src/types/InitialOptions.d.ts +7 -4
- package/dist/src/types/MetadataProvider.d.ts +5 -0
- package/dist/src/types/OptionsBase.d.ts +12 -3
- package/dist/src/types/RenderedTemplate.d.ts +7 -0
- package/dist/src/types/Result.d.ts +16 -5
- package/dist/src/types/ResultConfig.d.ts +4 -0
- package/dist/src/types/SvgToolsOptions.d.ts +13 -0
- package/dist/src/types/TranscodedFont.d.ts +7 -0
- package/dist/src/types/WebfontFromGlyphsOptions.d.ts +11 -0
- package/dist/src/types/WebfontOptions.d.ts +39 -3
- package/dist/src/types/index.d.ts +8 -6
- package/package.json +65 -57
- package/templates/template.css.njk +6 -3
- package/templates/template.html.njk +15 -4
- package/templates/template.scss.njk +6 -3
- package/templates/template.styl.njk +6 -3
- package/dist/cli.js +0 -801
- package/dist/jest.config.d.ts +0 -3
- package/dist/src/cli/index.d.ts +0 -1
- package/dist/src/cli/index.test.d.ts +0 -1
- package/dist/src/cli/meow/index.d.ts +0 -104
- package/dist/src/index.test.d.ts +0 -1
- package/dist/src/standalone/index.test.d.ts +0 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import { webfont } from
|
|
2
|
-
export {
|
|
1
|
+
import { webfont } from './standalone';
|
|
2
|
+
export { diagnoseGlyphsData, diagnoseSvgContents } from './lib/svgDiagnostics/diagnoseSvgContents';
|
|
3
|
+
export { webfont } from './standalone';
|
|
4
|
+
export type { SvgDiagnosticCode, SvgGlyphDiagnostic, SvgToolsOptions } from './types/SvgToolsOptions';
|
|
3
5
|
export default webfont;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare type Output = {
|
|
1
|
+
import { ExecException } from 'child_process';
|
|
2
|
+
export type Output = {
|
|
4
3
|
code?: number;
|
|
5
4
|
error: ExecException | null;
|
|
6
5
|
files: string[];
|
|
7
6
|
stderr?: string;
|
|
8
7
|
stdout?: string;
|
|
9
8
|
};
|
|
10
|
-
export
|
|
9
|
+
export type ExecCLI = (_args?: string, _destination?: string) => Promise<Output>;
|
|
11
10
|
/**
|
|
12
11
|
* @name execCLI
|
|
13
12
|
* @description Execute webfont CLI commands using child_process.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const isHttpUrl: (value: string) => boolean;
|
|
2
|
+
export declare const getInputExtension: (source: string) => string;
|
|
3
|
+
export declare const getWebfontSourceBasename: (source: string) => string;
|
|
4
|
+
export declare const resolveDecompressedFontBasenames: (sources: readonly string[]) => string[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Glyph count above which OpenType ligatures often hurt browser layout (Firefox / DirectWrite). */
|
|
2
|
+
export declare const LARGE_FONT_LIGATURE_GLYPH_THRESHOLD = 2000;
|
|
3
|
+
export declare const shouldWarnLargeFontLigatures: (glyphCount: number, ligaturesEnabled: boolean) => boolean;
|
|
4
|
+
export declare const formatLargeFontLigatureWarning: (glyphCount: number) => string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Config } from 'svgo';
|
|
2
|
+
/** Conservative SVGO preset: cleanup cruft without rewriting paths or removing viewBox. */
|
|
3
|
+
export declare const defaultWebfontSvgoConfig: () => Config;
|
|
4
|
+
export declare const optimizeSvgContents: (contents: string, srcPath: string, config?: Config) => string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Format, Formats } from '../types/Format';
|
|
2
|
+
export declare const assertValidFormat: (value: unknown) => Format;
|
|
3
|
+
export declare const parseFormatsList: (values: readonly unknown[]) => Formats;
|
|
4
|
+
export declare const assertFormatsOption: (formats: unknown) => Formats;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SvgGlyphDiagnostic } from '../../types/SvgToolsOptions';
|
|
2
|
+
export declare const hasStrokeOnlySvg: (svgContents: string) => boolean;
|
|
3
|
+
export declare const hasUnsupportedSvgElements: (svgContents: string) => boolean;
|
|
4
|
+
export declare const diagnoseSvgContents: (srcPath: string, svgContents: string) => SvgGlyphDiagnostic[];
|
|
5
|
+
export declare const diagnoseGlyphsData: (glyphs: ReadonlyArray<{
|
|
6
|
+
contents: string;
|
|
7
|
+
srcPath: string;
|
|
8
|
+
}>) => SvgGlyphDiagnostic[];
|
|
9
|
+
export declare const shouldLogDiagnostic: (diagnostic: SvgGlyphDiagnostic, options: {
|
|
10
|
+
diagnose?: boolean;
|
|
11
|
+
verbose?: boolean;
|
|
12
|
+
}) => boolean;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { GlyphData } from '../../types/GlyphData';
|
|
2
|
+
export declare const findEmptySvgFontGlyphNames: (svgFont: string) => string[];
|
|
3
|
+
export declare const assertNonEmptySvgFontGlyphs: (svgFont: string, glyphsData: ReadonlyArray<Pick<GlyphData, "metadata" | "srcPath">>) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GlyphData } from '../../types/GlyphData';
|
|
2
|
+
import { SvgGlyphDiagnostic } from '../../types/SvgToolsOptions';
|
|
3
|
+
export type SvgToolsReporter = (message: string) => void;
|
|
4
|
+
export type ApplySvgDiagnosticsResult = {
|
|
5
|
+
diagnostics: SvgGlyphDiagnostic[];
|
|
6
|
+
glyphs: GlyphData[];
|
|
7
|
+
};
|
|
8
|
+
export declare const applySvgDiagnosticsToGlyphs: (glyphsData: GlyphData[], svgToolsInput: {
|
|
9
|
+
diagnose?: boolean;
|
|
10
|
+
} | undefined, runtime?: {
|
|
11
|
+
reporter?: SvgToolsReporter;
|
|
12
|
+
verbose?: boolean;
|
|
13
|
+
}) => ApplySvgDiagnosticsResult;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GlyphData } from '../../types/GlyphData';
|
|
2
|
+
import { SvgGlyphDiagnostic, SvgToolsOptions } from '../../types/SvgToolsOptions';
|
|
3
|
+
import { SvgToolsReporter } from './applySvgDiagnostics';
|
|
4
|
+
export type { SvgToolsReporter } from './applySvgDiagnostics';
|
|
5
|
+
export type ApplySvgToolsResult = {
|
|
6
|
+
diagnostics: SvgGlyphDiagnostic[];
|
|
7
|
+
glyphs: GlyphData[];
|
|
8
|
+
};
|
|
9
|
+
export type ApplySvgToolsRuntime = {
|
|
10
|
+
reporter?: SvgToolsReporter;
|
|
11
|
+
/** When true, logs evenodd diagnostics even if svgTools.diagnose is off (backward compatible with --verbose). */
|
|
12
|
+
verbose?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const applySvgToolsToGlyphs: (glyphsData: GlyphData[], svgToolsInput: SvgToolsOptions | undefined, runtime?: ApplySvgToolsRuntime) => ApplySvgToolsResult;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SVGIcons2SVGFontStreamOptions, fileSorter, getMetadataService, SVGIcons2SVGFontStream } from 'svgicons2svgfont';
|
|
2
|
+
import { WebfontOptions } from '../../types';
|
|
3
|
+
export { fileSorter, getMetadataService, SVGIcons2SVGFontStream };
|
|
4
|
+
type MetadataServiceOptions = {
|
|
5
|
+
prependUnicode: boolean;
|
|
6
|
+
startUnicode: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const getMetadataServiceOptions: (options: WebfontOptions) => MetadataServiceOptions;
|
|
9
|
+
/**
|
|
10
|
+
* Coerce `round` for svgicons2svgfont; accepts number or numeric string (CLI/config).
|
|
11
|
+
* Returns undefined for undefined/null/empty/non-numeric/non-finite inputs.
|
|
12
|
+
*/
|
|
13
|
+
export declare const normalizeRoundOption: (round: string | number | null | undefined) => number | undefined;
|
|
14
|
+
export declare const getFontStreamOptions: (options: WebfontOptions) => Partial<SVGIcons2SVGFontStreamOptions>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MetadataProvider } from '../../types/MetadataProvider';
|
|
2
|
+
type MetadataServiceOptions = {
|
|
3
|
+
prependUnicode: boolean;
|
|
4
|
+
startUnicode: number;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Browser-safe metadata lookup from a virtual `srcPath` (no `fs`, no file rename).
|
|
8
|
+
* Mirrors {@link https://github.com/nfroidure/svgicons2svgfont | svgicons2svgfont} filename rules.
|
|
9
|
+
*/
|
|
10
|
+
export declare const createMetadataFromSrcPathService: (options?: Partial<MetadataServiceOptions>) => MetadataProvider;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { GlyphMetadata } from '../types/GlyphMetadata';
|
|
2
|
+
export declare const collectCodePointsFromGlyphs: (glyphs: readonly Pick<GlyphMetadata, "unicode">[]) => number[];
|
|
3
|
+
export declare const computeUnicodeRangeFromGlyphs: (glyphs: readonly Pick<GlyphMetadata, "unicode">[]) => string | undefined;
|
|
4
|
+
export declare const resolveTemplateUnicodeRange: (unicodeRange: boolean | string | undefined, glyphs: readonly Pick<GlyphMetadata, "unicode">[]) => string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fetchWebfontFromUrl: (url: string) => Promise<Buffer>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { GlyphData, WebfontOptions } from '../types';
|
|
2
|
+
type GlyphsDataGetter = (_files: Array<GlyphData["srcPath"]>, _options: WebfontOptions) => Promise<GlyphData[]>;
|
|
3
3
|
export declare const getGlyphsData: GlyphsDataGetter;
|
|
4
4
|
export {};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { cosmiconfig } from 'cosmiconfig';
|
|
2
|
+
import { InitialOptions } from '../types';
|
|
3
|
+
import { Result } from '../types/Result';
|
|
4
|
+
type CosmiconfigLoaded = NonNullable<Awaited<ReturnType<ReturnType<typeof cosmiconfig>["search"]>>>;
|
|
5
|
+
export declare const loadWebfontConfig: (options: {
|
|
6
|
+
configFile?: string;
|
|
7
|
+
}) => Promise<CosmiconfigLoaded | Record<string, never>>;
|
|
8
|
+
type Webfont = (_initialOptions?: InitialOptions) => Promise<Result>;
|
|
4
9
|
export declare const webfont: Webfont;
|
|
5
10
|
export default webfont;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Format } from '../types/Format';
|
|
2
|
+
export type InputMode = "empty" | "mixed" | "svg" | "ttf" | "webfont";
|
|
3
|
+
export declare const classifyInputFiles: (filePaths: readonly string[]) => InputMode;
|
|
4
|
+
export declare const assertSvgPipelineFormats: (formats: readonly Format[]) => void;
|
|
5
|
+
export declare const filterInputFilesByMode: (filePaths: readonly string[], mode: InputMode) => string[];
|
|
6
|
+
export type ConversionFormat = "otf" | "ttf";
|
|
7
|
+
export type TtfEncodeFormat = "eot" | "ttf" | "woff" | "woff2";
|
|
8
|
+
export declare const resolveTtfConversionFormats: (formats: readonly Format[]) => TtfEncodeFormat[];
|
|
9
|
+
export declare const resolveWebfontConversionFormats: (formats: readonly Format[]) => ConversionFormat[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { WebfontOptions } from
|
|
3
|
-
|
|
1
|
+
import { InitialOptions } from '../types/InitialOptions';
|
|
2
|
+
import { WebfontOptions } from '../types/WebfontOptions';
|
|
3
|
+
type OptionsGetter = (_initialOptions?: InitialOptions) => WebfontOptions;
|
|
4
4
|
export declare const getOptions: OptionsGetter;
|
|
5
5
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Format } from '../types/Format';
|
|
2
|
+
import { RenderedTemplate } from '../types/RenderedTemplate';
|
|
3
|
+
import { Result } from '../types/Result';
|
|
4
|
+
import { WebfontOptions } from '../types/WebfontOptions';
|
|
5
|
+
type RenderTemplatesResult = {
|
|
6
|
+
templates: RenderedTemplate[];
|
|
7
|
+
usedBuildInTemplate: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const renderTemplates: (options: WebfontOptions, result: Pick<Result, "glyphsData" | "hash"> & Partial<Result>, formats: readonly Format[]) => RenderTemplatesResult;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { WebfontOptions } from '../types/WebfontOptions';
|
|
2
|
+
/**
|
|
3
|
+
* Runtime validation for merged webfont options (API, cosmiconfig, CLI).
|
|
4
|
+
* Rejects mis-typed or unknown format names before running a pipeline (#133).
|
|
5
|
+
*/
|
|
6
|
+
export declare const validateWebfontOptions: (options: WebfontOptions) => WebfontOptions;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
1
|
+
export type Format = "eot" | "otf" | "woff" | "woff2" | "svg" | "ttf";
|
|
2
|
+
export type Formats = Array<Format>;
|
|
3
|
+
type FormatOption = {
|
|
4
4
|
copyright: null;
|
|
5
5
|
ts: null;
|
|
6
6
|
version: null;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type FormatsOptions = Partial<Record<Format, FormatOption>>;
|
|
9
9
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GlyphMetadata } from
|
|
2
|
-
export
|
|
1
|
+
import { GlyphMetadata } from './GlyphMetadata';
|
|
2
|
+
export type GlyphTransformFn = (_obj: GlyphMetadata) => GlyphMetadata | Promise<GlyphMetadata>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { GlyphContentTransformFn } from './GlyphContentTransformFn';
|
|
2
|
+
import { GlyphTransformFn } from './GlyphTransformFn';
|
|
3
|
+
import { MetadataProvider } from './MetadataProvider';
|
|
4
|
+
import { OptionsBase } from './OptionsBase';
|
|
5
|
+
export type InitialOptions = OptionsBase & {
|
|
5
6
|
files: string | Array<string>;
|
|
7
|
+
glyphContentTransformFn?: GlyphContentTransformFn;
|
|
6
8
|
glyphTransformFn?: GlyphTransformFn;
|
|
9
|
+
metadataProvider?: MetadataProvider;
|
|
7
10
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { TemplateOption } from '../lib/parseTemplateOption';
|
|
2
|
+
import { Formats } from './Format';
|
|
3
|
+
import { SvgToolsOptions } from './SvgToolsOptions';
|
|
4
|
+
export type OptionsBase = {
|
|
3
5
|
configFile?: string;
|
|
4
6
|
dest?: string;
|
|
5
7
|
destCreate?: boolean;
|
|
6
8
|
fontName?: string | unknown;
|
|
7
9
|
formats?: Formats;
|
|
8
|
-
template?:
|
|
10
|
+
template?: TemplateOption;
|
|
9
11
|
templateClassName?: string | unknown;
|
|
10
12
|
templateFontPath?: string;
|
|
11
13
|
templateFontName?: string | unknown;
|
|
@@ -26,5 +28,12 @@ export declare type OptionsBase = {
|
|
|
26
28
|
prependUnicode?: boolean | unknown;
|
|
27
29
|
metadata?: unknown;
|
|
28
30
|
sort?: boolean;
|
|
31
|
+
ligatures?: boolean;
|
|
29
32
|
addHashInFontUrl?: boolean | unknown;
|
|
33
|
+
unicodeRange?: boolean | string | unknown;
|
|
34
|
+
optimizeSvg?: boolean | unknown;
|
|
35
|
+
svgoConfig?: unknown;
|
|
36
|
+
templateFontLigatures?: boolean | unknown;
|
|
37
|
+
/** Alpha. SVG diagnostics and optional pre-conversion fixes. */
|
|
38
|
+
svgTools?: SvgToolsOptions;
|
|
30
39
|
};
|
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
import { GlyphData } from
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { DecompressedFont } from './DecompressedFont';
|
|
2
|
+
import { GlyphData } from './GlyphData';
|
|
3
|
+
import { RenderedTemplate } from './RenderedTemplate';
|
|
4
|
+
import { ResultConfig } from './ResultConfig';
|
|
5
|
+
import { SvgGlyphDiagnostic } from './SvgToolsOptions';
|
|
6
|
+
import { TranscodedFont } from './TranscodedFont';
|
|
7
|
+
export type { DecompressedFont } from './DecompressedFont';
|
|
8
|
+
export type { TranscodedFont } from './TranscodedFont';
|
|
9
|
+
export type Result = {
|
|
10
|
+
config?: ResultConfig;
|
|
11
|
+
decompressedFonts?: DecompressedFont[];
|
|
12
|
+
transcodedFonts?: TranscodedFont[];
|
|
6
13
|
eot?: Buffer;
|
|
7
14
|
glyphsData?: Array<GlyphData>;
|
|
8
15
|
hash?: string;
|
|
16
|
+
otf?: Buffer;
|
|
9
17
|
svg?: string | Buffer;
|
|
10
18
|
template?: string;
|
|
19
|
+
templates?: RenderedTemplate[];
|
|
11
20
|
ttf?: Buffer;
|
|
12
21
|
usedBuildInTemplate?: boolean;
|
|
13
22
|
woff?: Buffer;
|
|
14
23
|
woff2?: Buffer;
|
|
24
|
+
/** Alpha. Populated when `svgTools.diagnose` is enabled. */
|
|
25
|
+
svgDiagnostics?: SvgGlyphDiagnostic[];
|
|
15
26
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type SvgDiagnosticCode = "evenodd-fill-rule" | "stroke-only" | "unsupported-element";
|
|
2
|
+
export type SvgGlyphDiagnostic = {
|
|
3
|
+
code: SvgDiagnosticCode;
|
|
4
|
+
message: string;
|
|
5
|
+
srcPath: string;
|
|
6
|
+
};
|
|
7
|
+
/** Alpha. SVG diagnostics for the icon-font pipeline (see ADR 0011 — no bundled stroke-to-fill fixes). */
|
|
8
|
+
export type SvgToolsOptions = {
|
|
9
|
+
/** Scan source SVGs for known icon-font incompatibilities and report warnings. */
|
|
10
|
+
diagnose?: boolean;
|
|
11
|
+
/** Optional sink for diagnostic log lines (for example a web worker or test spy). */
|
|
12
|
+
onMessage?: (message: string) => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GlyphContentTransformFn } from './GlyphContentTransformFn';
|
|
2
|
+
import { GlyphInput } from './GlyphInput';
|
|
3
|
+
import { GlyphTransformFn } from './GlyphTransformFn';
|
|
4
|
+
import { MetadataProvider } from './MetadataProvider';
|
|
5
|
+
import { OptionsBase } from './OptionsBase';
|
|
6
|
+
export type WebfontFromGlyphsOptions = OptionsBase & {
|
|
7
|
+
glyphs: GlyphInput[];
|
|
8
|
+
glyphContentTransformFn?: GlyphContentTransformFn;
|
|
9
|
+
glyphTransformFn?: GlyphTransformFn;
|
|
10
|
+
metadataProvider?: MetadataProvider;
|
|
11
|
+
};
|
|
@@ -1,7 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Config as SvgoConfig } from 'svgo';
|
|
2
|
+
import { TemplateOption } from '../lib/parseTemplateOption';
|
|
3
|
+
import { Formats, FormatsOptions } from './Format';
|
|
4
|
+
import { GlyphContentTransformFn } from './GlyphContentTransformFn';
|
|
5
|
+
import { GlyphTransformFn } from './GlyphTransformFn';
|
|
6
|
+
import { InitialOptions } from './InitialOptions';
|
|
7
|
+
import { MetadataProvider } from './MetadataProvider';
|
|
8
|
+
import { SvgToolsOptions } from './SvgToolsOptions';
|
|
3
9
|
export interface WebfontOptions extends InitialOptions {
|
|
10
|
+
centerHorizontally: boolean;
|
|
11
|
+
descent: number;
|
|
12
|
+
fixedWidth: boolean;
|
|
13
|
+
fontHeight: unknown;
|
|
14
|
+
fontId: unknown;
|
|
15
|
+
fontName: string;
|
|
16
|
+
fontStyle: string;
|
|
17
|
+
fontWeight: string;
|
|
18
|
+
formats: Formats;
|
|
4
19
|
formatsOptions: FormatsOptions;
|
|
20
|
+
glyphTransformFn?: GlyphTransformFn;
|
|
21
|
+
glyphContentTransformFn?: GlyphContentTransformFn;
|
|
22
|
+
ligatures: boolean;
|
|
5
23
|
maxConcurrency: number;
|
|
6
|
-
|
|
24
|
+
metadata: unknown;
|
|
25
|
+
metadataProvider?: MetadataProvider;
|
|
26
|
+
normalize: boolean;
|
|
27
|
+
prependUnicode: boolean;
|
|
28
|
+
round: string | number;
|
|
29
|
+
sort: boolean;
|
|
30
|
+
startUnicode: number;
|
|
31
|
+
template?: TemplateOption;
|
|
32
|
+
templateCacheString?: unknown;
|
|
33
|
+
templateClassName?: unknown;
|
|
34
|
+
templateFontName?: unknown;
|
|
35
|
+
templateFontPath: string;
|
|
36
|
+
verbose: boolean;
|
|
37
|
+
addHashInFontUrl?: boolean;
|
|
38
|
+
unicodeRange?: boolean | string;
|
|
39
|
+
optimizeSvg?: boolean;
|
|
40
|
+
svgoConfig?: SvgoConfig;
|
|
41
|
+
templateFontLigatures?: boolean;
|
|
42
|
+
svgTools?: SvgToolsOptions;
|
|
7
43
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export type { Format } from
|
|
2
|
-
export type {
|
|
3
|
-
export type {
|
|
4
|
-
export type {
|
|
5
|
-
export type {
|
|
6
|
-
export type {
|
|
1
|
+
export type { Format, FormatsOptions } from '../types/Format';
|
|
2
|
+
export type { GlyphContentTransformFn } from './GlyphContentTransformFn';
|
|
3
|
+
export type { GlyphData } from './GlyphData';
|
|
4
|
+
export type { GlyphMetadata } from './GlyphMetadata';
|
|
5
|
+
export type { GlyphTransformFn } from './GlyphTransformFn';
|
|
6
|
+
export type { InitialOptions } from './InitialOptions';
|
|
7
|
+
export type { MetadataProvider } from './MetadataProvider';
|
|
8
|
+
export type { WebfontOptions } from './WebfontOptions';
|