webfont 12.0.0 → 12.1.1
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 +14 -2
- package/README.md +199 -20
- package/dist/browser.js +4 -0
- package/dist/cli.mjs +850 -495
- package/dist/index.js +1 -1
- package/dist/index.mjs +513 -0
- package/dist/parseTemplateOption-BmH_pcQh.js +1 -0
- package/dist/parseTemplateOption-Bvbie1SQ.mjs +19 -0
- package/dist/parseTemplateOption-DLNu6PPx.mjs +38 -0
- package/dist/renderTemplates-Biyrk6t-.mjs +92 -0
- package/dist/renderTemplates-CXVKq3Op.mjs +102 -0
- package/dist/renderTemplates-zCYCzeOt.js +1 -0
- package/dist/src/browser.d.mts +2 -0
- package/dist/src/browser.d.ts +2 -0
- package/dist/src/index.d.mts +5 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/lib/applyOptimizeSvgToGlyphs.d.mts +3 -0
- package/dist/src/lib/applyOptimizeSvgToGlyphs.d.ts +3 -0
- package/dist/src/lib/evenoddFillRule.d.mts +2 -0
- package/dist/src/lib/evenoddFillRule.d.ts +2 -0
- package/dist/src/lib/execCLI/index.d.mts +24 -0
- package/dist/src/lib/inputSource.d.mts +2 -0
- package/dist/src/lib/inputSource.d.ts +1 -4
- package/dist/src/lib/inputSourceUtils.d.mts +4 -0
- package/dist/src/lib/inputSourceUtils.d.ts +4 -0
- package/dist/src/lib/largeFontLigatures.d.mts +4 -0
- package/dist/src/lib/largeFontLigatures.d.ts +4 -0
- package/dist/src/lib/optimizeSvgGlyphs.d.mts +4 -0
- package/dist/src/lib/optimizeSvgGlyphs.d.ts +4 -0
- package/dist/src/lib/p-limit/index.d.mts +2 -0
- package/dist/src/lib/parseFormats.d.mts +4 -0
- package/dist/src/lib/parseFormats.d.ts +4 -0
- package/dist/src/lib/parseTemplateOption.d.mts +2 -0
- package/dist/src/lib/parseTemplateOption.d.ts +2 -0
- package/dist/src/lib/runtimeEnvironment.d.mts +4 -0
- package/dist/src/lib/runtimeEnvironment.d.ts +4 -0
- package/dist/src/lib/sfnt/flavor.d.mts +2 -0
- package/dist/src/lib/svgDiagnostics/diagnoseSvgContents.d.mts +13 -0
- package/dist/src/lib/svgDiagnostics/diagnoseSvgContents.d.ts +13 -0
- package/dist/src/lib/svgFontOutput/emptyGlyphPaths.d.mts +3 -0
- package/dist/src/lib/svgFontOutput/emptyGlyphPaths.d.ts +3 -0
- package/dist/src/lib/svgTools/applySvgDiagnostics.d.mts +13 -0
- package/dist/src/lib/svgTools/applySvgDiagnostics.d.ts +13 -0
- package/dist/src/lib/svgTools/applySvgTools.d.mts +14 -0
- package/dist/src/lib/svgTools/applySvgTools.d.ts +14 -0
- package/dist/src/lib/svgTools/normalizeSvgToolsOptions.d.mts +2 -0
- package/dist/src/lib/svgTools/normalizeSvgToolsOptions.d.ts +2 -0
- package/dist/src/lib/svgicons2svgfont/index.d.mts +14 -0
- package/dist/src/lib/svgicons2svgfont/index.d.ts +5 -0
- package/dist/src/lib/svgicons2svgfont/metadataFromSrcPath.d.mts +11 -0
- package/dist/src/lib/svgicons2svgfont/metadataFromSrcPath.d.ts +11 -0
- package/dist/src/lib/templateUnicodeRange.d.mts +4 -0
- package/dist/src/lib/templateUnicodeRange.d.ts +4 -0
- package/dist/src/lib/ttf2eot/index.d.mts +2 -0
- package/dist/src/lib/ttfEncode.d.mts +5 -0
- package/dist/src/lib/ttfEncode.d.ts +5 -0
- package/dist/src/standalone/convertTtfInput.d.mts +3 -0
- package/dist/src/standalone/convertTtfInput.d.ts +3 -0
- package/dist/src/standalone/convertWebfontInput.d.mts +3 -0
- package/dist/src/standalone/defaultOptions.d.mts +3 -0
- package/dist/src/standalone/defaultOptions.d.ts +3 -0
- package/dist/src/standalone/fetchWebfontUrl.d.mts +1 -0
- package/dist/src/standalone/generateSvgFont.d.mts +2 -0
- package/dist/src/standalone/generateSvgFont.d.ts +2 -0
- package/dist/src/standalone/getGlyphsDataFromInputs.d.mts +3 -0
- package/dist/src/standalone/getGlyphsDataFromInputs.d.ts +3 -0
- package/dist/src/standalone/glyphsData.d.mts +4 -0
- package/dist/src/standalone/glyphsData.d.ts +1 -1
- package/dist/src/standalone/index.d.mts +10 -0
- package/dist/src/standalone/index.d.ts +5 -0
- package/dist/src/standalone/inputMode.d.mts +9 -0
- package/dist/src/standalone/inputMode.d.ts +3 -1
- package/dist/src/standalone/options.d.mts +5 -0
- package/dist/src/standalone/optionsFromGlyphs.d.mts +3 -0
- package/dist/src/standalone/optionsFromGlyphs.d.ts +3 -0
- package/dist/src/standalone/renderTemplates.d.mts +10 -0
- package/dist/src/standalone/renderTemplates.d.ts +10 -0
- package/dist/src/standalone/runSvgPipeline.d.mts +3 -0
- package/dist/src/standalone/runSvgPipeline.d.ts +3 -0
- package/dist/src/standalone/templateFonts.d.mts +3 -0
- package/dist/src/standalone/toTtf.d.mts +4 -0
- package/dist/src/standalone/validateWebfontOptions.d.mts +6 -0
- package/dist/src/standalone/validateWebfontOptions.d.ts +6 -0
- package/dist/src/standalone/webfontFromGlyphs.d.mts +3 -0
- package/dist/src/standalone/webfontFromGlyphs.d.ts +3 -0
- package/dist/src/types/DecompressedFont.d.mts +5 -0
- package/dist/src/types/Format.d.mts +9 -0
- package/dist/src/types/GlyphContentTransformFn.d.mts +2 -0
- package/dist/src/types/GlyphContentTransformFn.d.ts +2 -0
- package/dist/src/types/GlyphData.d.mts +6 -0
- package/dist/src/types/GlyphInput.d.mts +6 -0
- package/dist/src/types/GlyphInput.d.ts +6 -0
- package/dist/src/types/GlyphMetadata.d.mts +10 -0
- package/dist/src/types/GlyphTransformFn.d.mts +2 -0
- package/dist/src/types/InitialOptions.d.mts +10 -0
- package/dist/src/types/InitialOptions.d.ts +2 -0
- package/dist/src/types/MetadataProvider.d.mts +5 -0
- package/dist/src/types/OptionsBase.d.mts +39 -0
- package/dist/src/types/OptionsBase.d.ts +9 -1
- package/dist/src/types/RenderedTemplate.d.mts +7 -0
- package/dist/src/types/RenderedTemplate.d.ts +7 -0
- package/dist/src/types/Result.d.mts +26 -0
- package/dist/src/types/Result.d.ts +8 -0
- package/dist/src/types/ResultConfig.d.mts +4 -0
- package/dist/src/types/SvgToolsOptions.d.mts +13 -0
- package/dist/src/types/SvgToolsOptions.d.ts +13 -0
- package/dist/src/types/TranscodedFont.d.mts +7 -0
- package/dist/src/types/TranscodedFont.d.ts +7 -0
- package/dist/src/types/WebfontFromGlyphsOptions.d.mts +11 -0
- package/dist/src/types/WebfontFromGlyphsOptions.d.ts +11 -0
- package/dist/src/types/WebfontOptions.d.mts +43 -0
- package/dist/src/types/WebfontOptions.d.ts +12 -2
- package/dist/src/types/index.d.mts +8 -0
- package/dist/src/types/index.d.ts +2 -1
- package/dist/templates/index.d.mts +19 -0
- package/package.json +42 -11
- 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
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { cosmiconfig } from 'cosmiconfig';
|
|
1
2
|
import { InitialOptions } from '../types';
|
|
2
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>>;
|
|
3
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.mjs';
|
|
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,7 +1,9 @@
|
|
|
1
1
|
import { Format } from '../types/Format';
|
|
2
|
-
export type InputMode = "empty" | "mixed" | "svg" | "webfont";
|
|
2
|
+
export type InputMode = "empty" | "mixed" | "svg" | "ttf" | "webfont";
|
|
3
3
|
export declare const classifyInputFiles: (filePaths: readonly string[]) => InputMode;
|
|
4
4
|
export declare const assertSvgPipelineFormats: (formats: readonly Format[]) => void;
|
|
5
5
|
export declare const filterInputFilesByMode: (filePaths: readonly string[], mode: InputMode) => string[];
|
|
6
6
|
export type ConversionFormat = "otf" | "ttf";
|
|
7
|
+
export type TtfEncodeFormat = "eot" | "ttf" | "woff" | "woff2";
|
|
8
|
+
export declare const resolveTtfConversionFormats: (formats: readonly Format[]) => TtfEncodeFormat[];
|
|
7
9
|
export declare const resolveWebfontConversionFormats: (formats: readonly Format[]) => ConversionFormat[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Format } from '../types/Format.mjs';
|
|
2
|
+
import { RenderedTemplate } from '../types/RenderedTemplate.mjs';
|
|
3
|
+
import { Result } from '../types/Result.mjs';
|
|
4
|
+
import { WebfontOptions } from '../types/WebfontOptions.mjs';
|
|
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,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.mjs';
|
|
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;
|
|
@@ -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;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type Format = "eot" | "otf" | "woff" | "woff2" | "svg" | "ttf";
|
|
2
|
+
export type Formats = Array<Format>;
|
|
3
|
+
type FormatOption = {
|
|
4
|
+
copyright: null;
|
|
5
|
+
ts: null;
|
|
6
|
+
version: null;
|
|
7
|
+
};
|
|
8
|
+
export type FormatsOptions = Partial<Record<Format, FormatOption>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GlyphContentTransformFn } from './GlyphContentTransformFn.mjs';
|
|
2
|
+
import { GlyphTransformFn } from './GlyphTransformFn.mjs';
|
|
3
|
+
import { MetadataProvider } from './MetadataProvider.mjs';
|
|
4
|
+
import { OptionsBase } from './OptionsBase.mjs';
|
|
5
|
+
export type InitialOptions = OptionsBase & {
|
|
6
|
+
files: string | Array<string>;
|
|
7
|
+
glyphContentTransformFn?: GlyphContentTransformFn;
|
|
8
|
+
glyphTransformFn?: GlyphTransformFn;
|
|
9
|
+
metadataProvider?: MetadataProvider;
|
|
10
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { GlyphContentTransformFn } from './GlyphContentTransformFn';
|
|
1
2
|
import { GlyphTransformFn } from './GlyphTransformFn';
|
|
2
3
|
import { MetadataProvider } from './MetadataProvider';
|
|
3
4
|
import { OptionsBase } from './OptionsBase';
|
|
4
5
|
export type InitialOptions = OptionsBase & {
|
|
5
6
|
files: string | Array<string>;
|
|
7
|
+
glyphContentTransformFn?: GlyphContentTransformFn;
|
|
6
8
|
glyphTransformFn?: GlyphTransformFn;
|
|
7
9
|
metadataProvider?: MetadataProvider;
|
|
8
10
|
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TemplateOption } from '../lib/parseTemplateOption.mjs';
|
|
2
|
+
import { Formats } from './Format.mjs';
|
|
3
|
+
import { SvgToolsOptions } from './SvgToolsOptions.mjs';
|
|
4
|
+
export type OptionsBase = {
|
|
5
|
+
configFile?: string;
|
|
6
|
+
dest?: string;
|
|
7
|
+
destCreate?: boolean;
|
|
8
|
+
fontName?: string | unknown;
|
|
9
|
+
formats?: Formats;
|
|
10
|
+
template?: TemplateOption;
|
|
11
|
+
templateClassName?: string | unknown;
|
|
12
|
+
templateFontPath?: string;
|
|
13
|
+
templateFontName?: string | unknown;
|
|
14
|
+
templateCacheString?: string | unknown;
|
|
15
|
+
destTemplate?: string | unknown;
|
|
16
|
+
verbose?: boolean;
|
|
17
|
+
fontId?: string | unknown;
|
|
18
|
+
fontStyle?: string | unknown;
|
|
19
|
+
fontWeight?: string | unknown;
|
|
20
|
+
fixedWidth?: string | unknown;
|
|
21
|
+
centerHorizontally?: boolean | unknown;
|
|
22
|
+
normalize?: boolean;
|
|
23
|
+
fontHeight?: string | unknown;
|
|
24
|
+
round?: string | number;
|
|
25
|
+
descent?: string | number;
|
|
26
|
+
ascent?: string;
|
|
27
|
+
startUnicode?: string | unknown;
|
|
28
|
+
prependUnicode?: boolean | unknown;
|
|
29
|
+
metadata?: unknown;
|
|
30
|
+
sort?: boolean;
|
|
31
|
+
ligatures?: boolean;
|
|
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;
|
|
39
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { TemplateOption } from '../lib/parseTemplateOption';
|
|
1
2
|
import { Formats } from './Format';
|
|
3
|
+
import { SvgToolsOptions } from './SvgToolsOptions';
|
|
2
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;
|
|
@@ -28,4 +30,10 @@ export type OptionsBase = {
|
|
|
28
30
|
sort?: boolean;
|
|
29
31
|
ligatures?: boolean;
|
|
30
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;
|
|
31
39
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DecompressedFont } from './DecompressedFont.mjs';
|
|
2
|
+
import { GlyphData } from './GlyphData.mjs';
|
|
3
|
+
import { RenderedTemplate } from './RenderedTemplate.mjs';
|
|
4
|
+
import { ResultConfig } from './ResultConfig.mjs';
|
|
5
|
+
import { SvgGlyphDiagnostic } from './SvgToolsOptions.mjs';
|
|
6
|
+
import { TranscodedFont } from './TranscodedFont.mjs';
|
|
7
|
+
export type { DecompressedFont } from './DecompressedFont.mjs';
|
|
8
|
+
export type { TranscodedFont } from './TranscodedFont.mjs';
|
|
9
|
+
export type Result = {
|
|
10
|
+
config?: ResultConfig;
|
|
11
|
+
decompressedFonts?: DecompressedFont[];
|
|
12
|
+
transcodedFonts?: TranscodedFont[];
|
|
13
|
+
eot?: Buffer;
|
|
14
|
+
glyphsData?: Array<GlyphData>;
|
|
15
|
+
hash?: string;
|
|
16
|
+
otf?: Buffer;
|
|
17
|
+
svg?: string | Buffer;
|
|
18
|
+
template?: string;
|
|
19
|
+
templates?: RenderedTemplate[];
|
|
20
|
+
ttf?: Buffer;
|
|
21
|
+
usedBuildInTemplate?: boolean;
|
|
22
|
+
woff?: Buffer;
|
|
23
|
+
woff2?: Buffer;
|
|
24
|
+
/** Alpha. Populated when `svgTools.diagnose` is enabled. */
|
|
25
|
+
svgDiagnostics?: SvgGlyphDiagnostic[];
|
|
26
|
+
};
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { DecompressedFont } from './DecompressedFont';
|
|
2
2
|
import { GlyphData } from './GlyphData';
|
|
3
|
+
import { RenderedTemplate } from './RenderedTemplate';
|
|
3
4
|
import { ResultConfig } from './ResultConfig';
|
|
5
|
+
import { SvgGlyphDiagnostic } from './SvgToolsOptions';
|
|
6
|
+
import { TranscodedFont } from './TranscodedFont';
|
|
4
7
|
export type { DecompressedFont } from './DecompressedFont';
|
|
8
|
+
export type { TranscodedFont } from './TranscodedFont';
|
|
5
9
|
export type Result = {
|
|
6
10
|
config?: ResultConfig;
|
|
7
11
|
decompressedFonts?: DecompressedFont[];
|
|
12
|
+
transcodedFonts?: TranscodedFont[];
|
|
8
13
|
eot?: Buffer;
|
|
9
14
|
glyphsData?: Array<GlyphData>;
|
|
10
15
|
hash?: string;
|
|
11
16
|
otf?: Buffer;
|
|
12
17
|
svg?: string | Buffer;
|
|
13
18
|
template?: string;
|
|
19
|
+
templates?: RenderedTemplate[];
|
|
14
20
|
ttf?: Buffer;
|
|
15
21
|
usedBuildInTemplate?: boolean;
|
|
16
22
|
woff?: Buffer;
|
|
17
23
|
woff2?: Buffer;
|
|
24
|
+
/** Alpha. Populated when `svgTools.diagnose` is enabled. */
|
|
25
|
+
svgDiagnostics?: SvgGlyphDiagnostic[];
|
|
18
26
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type SvgDiagnosticCode = "evenodd-fill-rule" | "stroke-only" | "unsupported-element" | "use-reference";
|
|
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,13 @@
|
|
|
1
|
+
export type SvgDiagnosticCode = "evenodd-fill-rule" | "stroke-only" | "unsupported-element" | "use-reference";
|
|
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.mjs';
|
|
2
|
+
import { GlyphInput } from './GlyphInput.mjs';
|
|
3
|
+
import { GlyphTransformFn } from './GlyphTransformFn.mjs';
|
|
4
|
+
import { MetadataProvider } from './MetadataProvider.mjs';
|
|
5
|
+
import { OptionsBase } from './OptionsBase.mjs';
|
|
6
|
+
export type WebfontFromGlyphsOptions = OptionsBase & {
|
|
7
|
+
glyphs: GlyphInput[];
|
|
8
|
+
glyphContentTransformFn?: GlyphContentTransformFn;
|
|
9
|
+
glyphTransformFn?: GlyphTransformFn;
|
|
10
|
+
metadataProvider?: MetadataProvider;
|
|
11
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Config as SvgoConfig } from 'svgo';
|
|
2
|
+
import { TemplateOption } from '../lib/parseTemplateOption.mjs';
|
|
3
|
+
import { Formats, FormatsOptions } from './Format.mjs';
|
|
4
|
+
import { GlyphContentTransformFn } from './GlyphContentTransformFn.mjs';
|
|
5
|
+
import { GlyphTransformFn } from './GlyphTransformFn.mjs';
|
|
6
|
+
import { InitialOptions } from './InitialOptions.mjs';
|
|
7
|
+
import { MetadataProvider } from './MetadataProvider.mjs';
|
|
8
|
+
import { SvgToolsOptions } from './SvgToolsOptions.mjs';
|
|
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;
|
|
19
|
+
formatsOptions: FormatsOptions;
|
|
20
|
+
glyphTransformFn?: GlyphTransformFn;
|
|
21
|
+
glyphContentTransformFn?: GlyphContentTransformFn;
|
|
22
|
+
ligatures: boolean;
|
|
23
|
+
maxConcurrency: number;
|
|
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;
|
|
43
|
+
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { Config as SvgoConfig } from 'svgo';
|
|
2
|
+
import { TemplateOption } from '../lib/parseTemplateOption';
|
|
1
3
|
import { Formats, FormatsOptions } from './Format';
|
|
4
|
+
import { GlyphContentTransformFn } from './GlyphContentTransformFn';
|
|
2
5
|
import { GlyphTransformFn } from './GlyphTransformFn';
|
|
3
6
|
import { InitialOptions } from './InitialOptions';
|
|
4
7
|
import { MetadataProvider } from './MetadataProvider';
|
|
8
|
+
import { SvgToolsOptions } from './SvgToolsOptions';
|
|
5
9
|
export interface WebfontOptions extends InitialOptions {
|
|
6
10
|
centerHorizontally: boolean;
|
|
7
11
|
descent: number;
|
|
@@ -14,20 +18,26 @@ export interface WebfontOptions extends InitialOptions {
|
|
|
14
18
|
formats: Formats;
|
|
15
19
|
formatsOptions: FormatsOptions;
|
|
16
20
|
glyphTransformFn?: GlyphTransformFn;
|
|
21
|
+
glyphContentTransformFn?: GlyphContentTransformFn;
|
|
17
22
|
ligatures: boolean;
|
|
18
23
|
maxConcurrency: number;
|
|
19
24
|
metadata: unknown;
|
|
20
25
|
metadataProvider?: MetadataProvider;
|
|
21
26
|
normalize: boolean;
|
|
22
27
|
prependUnicode: boolean;
|
|
23
|
-
round: number;
|
|
28
|
+
round: string | number;
|
|
24
29
|
sort: boolean;
|
|
25
30
|
startUnicode: number;
|
|
26
|
-
template?:
|
|
31
|
+
template?: TemplateOption;
|
|
27
32
|
templateCacheString?: unknown;
|
|
28
33
|
templateClassName?: unknown;
|
|
29
34
|
templateFontName?: unknown;
|
|
30
35
|
templateFontPath: string;
|
|
31
36
|
verbose: boolean;
|
|
32
37
|
addHashInFontUrl?: boolean;
|
|
38
|
+
unicodeRange?: boolean | string;
|
|
39
|
+
optimizeSvg?: boolean;
|
|
40
|
+
svgoConfig?: SvgoConfig;
|
|
41
|
+
templateFontLigatures?: boolean;
|
|
42
|
+
svgTools?: SvgToolsOptions;
|
|
33
43
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { Format, FormatsOptions } from '../types/Format.mjs';
|
|
2
|
+
export type { GlyphContentTransformFn } from './GlyphContentTransformFn.mjs';
|
|
3
|
+
export type { GlyphData } from './GlyphData.mjs';
|
|
4
|
+
export type { GlyphMetadata } from './GlyphMetadata.mjs';
|
|
5
|
+
export type { GlyphTransformFn } from './GlyphTransformFn.mjs';
|
|
6
|
+
export type { InitialOptions } from './InitialOptions.mjs';
|
|
7
|
+
export type { MetadataProvider } from './MetadataProvider.mjs';
|
|
8
|
+
export type { WebfontOptions } from './WebfontOptions.mjs';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export type { Format } from '../types/Format';
|
|
1
|
+
export type { Format, FormatsOptions } from '../types/Format';
|
|
2
|
+
export type { GlyphContentTransformFn } from './GlyphContentTransformFn';
|
|
2
3
|
export type { GlyphData } from './GlyphData';
|
|
3
4
|
export type { GlyphMetadata } from './GlyphMetadata';
|
|
4
5
|
export type { GlyphTransformFn } from './GlyphTransformFn';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const getTemplateDirectory: () => string;
|
|
2
|
+
export declare const getTemplateFilePath: (template: string) => string;
|
|
3
|
+
export declare const getBuiltInTemplates: () => {
|
|
4
|
+
css: {
|
|
5
|
+
path: string;
|
|
6
|
+
};
|
|
7
|
+
html: {
|
|
8
|
+
path: string;
|
|
9
|
+
};
|
|
10
|
+
json: {
|
|
11
|
+
path: string;
|
|
12
|
+
};
|
|
13
|
+
scss: {
|
|
14
|
+
path: string;
|
|
15
|
+
};
|
|
16
|
+
styl: {
|
|
17
|
+
path: string;
|
|
18
|
+
};
|
|
19
|
+
};
|