fontmin-rs 0.1.0 → 0.2.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/README.md +1 -4
- package/bin/fontmin-rs.mjs +2 -1828
- package/dist/cli.mjs +784 -0
- package/dist/compat.mjs +51 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +2 -1
- package/dist/{compat-BxDug9v3.mjs → optimize-pipeline-4Thm4vQb.mjs} +398 -408
- package/package.json +4 -4
package/dist/compat.mjs
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import "./plugins.mjs";
|
|
1
|
+
import { t as optimize, y as defineConfig } from "./optimize-pipeline-4Thm4vQb.mjs";
|
|
2
|
+
import { css, deliverySlices, glyph, otf2ttf, svg2ttf, svgs2ttf, ttf2eot, ttf2svg, ttf2woff, ttf2woff2 } from "./plugins.mjs";
|
|
3
|
+
//#region src/compat.ts
|
|
4
|
+
var FontminCompat = class {
|
|
5
|
+
static glyph = glyph;
|
|
6
|
+
static deliverySlices = deliverySlices;
|
|
7
|
+
static ttf2eot = ttf2eot;
|
|
8
|
+
static ttf2svg = ttf2svg;
|
|
9
|
+
static ttf2woff = ttf2woff;
|
|
10
|
+
static ttf2woff2 = ttf2woff2;
|
|
11
|
+
static otf2ttf = otf2ttf;
|
|
12
|
+
static svg2ttf = svg2ttf;
|
|
13
|
+
static svgs2ttf = svgs2ttf;
|
|
14
|
+
static css = css;
|
|
15
|
+
input = [];
|
|
16
|
+
outputDir;
|
|
17
|
+
plugins = [];
|
|
18
|
+
src(file) {
|
|
19
|
+
this.input = Array.isArray(file) ? file : [file];
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
dest(dir) {
|
|
23
|
+
this.outputDir = dir;
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
use(plugin) {
|
|
27
|
+
this.plugins.push(plugin);
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
config() {
|
|
31
|
+
const config = {
|
|
32
|
+
input: this.input,
|
|
33
|
+
plugins: this.plugins
|
|
34
|
+
};
|
|
35
|
+
if (this.outputDir !== void 0) config.outDir = this.outputDir;
|
|
36
|
+
return defineConfig(config);
|
|
37
|
+
}
|
|
38
|
+
runAsync() {
|
|
39
|
+
return optimize(this.config());
|
|
40
|
+
}
|
|
41
|
+
run(callback) {
|
|
42
|
+
const handleSuccess = (files) => {
|
|
43
|
+
callback(null, files);
|
|
44
|
+
};
|
|
45
|
+
const handleError = (error) => {
|
|
46
|
+
callback(error);
|
|
47
|
+
};
|
|
48
|
+
this.runAsync().then(handleSuccess).catch(handleError);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
3
52
|
export { FontminCompat as default };
|
package/dist/index.d.mts
CHANGED
|
@@ -31,7 +31,7 @@ declare function svgFontToTtf(input: string, options?: Svg2TtfOptions): Buffer;
|
|
|
31
31
|
declare function svgsToTtf(inputs: SvgIcon[], options?: Svgs2TtfOptions): Buffer;
|
|
32
32
|
declare function generateFontFaceCss(sources: CssFontSource[], options?: CssOptions): string;
|
|
33
33
|
//#endregion
|
|
34
|
-
//#region src/optimize.d.ts
|
|
34
|
+
//#region src/optimize-pipeline.d.ts
|
|
35
35
|
declare function optimize(unresolvedConfig: FontminConfig): Promise<FontAsset[]>;
|
|
36
36
|
//#endregion
|
|
37
37
|
export { type AssetFormat, type CacheOptions, type ConfigOutput, type CoverageOptions, type CoverageReport, type CssFontFamily, type CssFontSource, type CssGlyph, type CssOptions, type DeliverySlice, type FontAsset, type FontFormat, type FontInfo, type FontMetadata, type FontminCompatPresetOptions, type FontminConfig, type FontminDiagnosticCode, FontminDiagnosticError, type FontminPlugin, type LayoutSubsetMode, type MaybePromise, type MissingGlyphPolicy, type ModernWebOptions, type Otf2TtfOptions, type OutputConfig, type OutputFormat, type PluginContext, type PluginDiagnostic, type RuntimeMode, type SubsetOptions, type Svg2TtfOptions, type SvgIcon, type Svgs2TtfOptions, type Ttf2EotOptions, type Ttf2SvgOptions, type Ttf2Woff2Options, type Ttf2WoffOptions, type WoffOptions, analyzeCoverage, css, FontminCompat as default, defineConfig, definePlugin, deliverySlices, eotToTtf, fontminCompatPreset, generateFontFaceCss, glyph, inspect, loadConfig, modernWeb, optimize, otf2ttf, otfToTtf, subsetTtf, svg2ttf, svgFontToTtf, svgs2ttf, svgsToTtf, ttf2eot, ttf2svg, ttf2woff, ttf2woff2, ttfToEot, ttfToSvg, ttfToWoff, ttfToWoff2, ttfToWoff2Async, validateWoff2, woff2ToTtf, woffToTtf };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as woffToTtf, a as inspect, c as svgFontToTtf, d as ttfToSvg, f as ttfToWoff, g as woff2ToTtf, h as validateWoff2, i as generateFontFaceCss, l as svgsToTtf, m as ttfToWoff2Async, n as analyzeCoverage, o as otfToTtf, p as ttfToWoff2, r as eotToTtf, s as subsetTtf, t as optimize, u as ttfToEot, v as FontminDiagnosticError, x as loadConfig, y as defineConfig } from "./optimize-pipeline-4Thm4vQb.mjs";
|
|
2
2
|
import { css, definePlugin, deliverySlices, glyph, modernWeb, otf2ttf, svg2ttf, svgs2ttf, ttf2eot, ttf2svg, ttf2woff, ttf2woff2 } from "./plugins.mjs";
|
|
3
|
+
import FontminCompat from "./compat.mjs";
|
|
3
4
|
import { fontminCompatPreset } from "./presets.mjs";
|
|
4
5
|
export { FontminDiagnosticError, analyzeCoverage, css, FontminCompat as default, defineConfig, definePlugin, deliverySlices, eotToTtf, fontminCompatPreset, generateFontFaceCss, glyph, inspect, loadConfig, modernWeb, optimize, otf2ttf, otfToTtf, subsetTtf, svg2ttf, svgFontToTtf, svgs2ttf, svgsToTtf, ttf2eot, ttf2svg, ttf2woff, ttf2woff2, ttfToEot, ttfToSvg, ttfToWoff, ttfToWoff2, ttfToWoff2Async, validateWoff2, woff2ToTtf, woffToTtf };
|