fontaine 0.4.0 → 0.4.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/dist/index.d.cts +32 -0
- package/dist/index.d.mts +32 -0
- package/dist/index.d.ts +1 -1
- package/package.json +14 -14
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as unplugin from 'unplugin';
|
|
2
|
+
import { Font } from '@capsizecss/unpack';
|
|
3
|
+
|
|
4
|
+
interface FontaineTransformOptions {
|
|
5
|
+
css?: {
|
|
6
|
+
value?: string;
|
|
7
|
+
};
|
|
8
|
+
fallbacks: string[];
|
|
9
|
+
resolvePath?: (path: string) => string | URL;
|
|
10
|
+
skipFontFaceGeneration?: (fallbackName: string) => boolean;
|
|
11
|
+
/** this should produce an unquoted font family name */
|
|
12
|
+
fallbackName?: (name: string) => string;
|
|
13
|
+
/** @deprecated use fallbackName */
|
|
14
|
+
overrideName?: (name: string) => string;
|
|
15
|
+
sourcemap?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const FontaineTransform: unplugin.UnpluginInstance<FontaineTransformOptions, boolean>;
|
|
18
|
+
|
|
19
|
+
declare const generateFallbackName: (name: string) => string;
|
|
20
|
+
interface FallbackOptions {
|
|
21
|
+
name: string;
|
|
22
|
+
font: string;
|
|
23
|
+
metrics?: FontFaceMetrics;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}
|
|
26
|
+
type FontFaceMetrics = Pick<Font, 'ascent' | 'descent' | 'lineGap' | 'unitsPerEm' | 'xWidthAvg'>;
|
|
27
|
+
declare const generateFontFace: (metrics: FontFaceMetrics, fallback: FallbackOptions) => string;
|
|
28
|
+
|
|
29
|
+
declare function getMetricsForFamily(family: string): Promise<FontFaceMetrics | null>;
|
|
30
|
+
declare function readMetrics(_source: URL | string): Promise<FontFaceMetrics | null>;
|
|
31
|
+
|
|
32
|
+
export { FontaineTransform, type FontaineTransformOptions, generateFallbackName, generateFontFace, getMetricsForFamily, readMetrics };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as unplugin from 'unplugin';
|
|
2
|
+
import { Font } from '@capsizecss/unpack';
|
|
3
|
+
|
|
4
|
+
interface FontaineTransformOptions {
|
|
5
|
+
css?: {
|
|
6
|
+
value?: string;
|
|
7
|
+
};
|
|
8
|
+
fallbacks: string[];
|
|
9
|
+
resolvePath?: (path: string) => string | URL;
|
|
10
|
+
skipFontFaceGeneration?: (fallbackName: string) => boolean;
|
|
11
|
+
/** this should produce an unquoted font family name */
|
|
12
|
+
fallbackName?: (name: string) => string;
|
|
13
|
+
/** @deprecated use fallbackName */
|
|
14
|
+
overrideName?: (name: string) => string;
|
|
15
|
+
sourcemap?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const FontaineTransform: unplugin.UnpluginInstance<FontaineTransformOptions, boolean>;
|
|
18
|
+
|
|
19
|
+
declare const generateFallbackName: (name: string) => string;
|
|
20
|
+
interface FallbackOptions {
|
|
21
|
+
name: string;
|
|
22
|
+
font: string;
|
|
23
|
+
metrics?: FontFaceMetrics;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}
|
|
26
|
+
type FontFaceMetrics = Pick<Font, 'ascent' | 'descent' | 'lineGap' | 'unitsPerEm' | 'xWidthAvg'>;
|
|
27
|
+
declare const generateFontFace: (metrics: FontFaceMetrics, fallback: FallbackOptions) => string;
|
|
28
|
+
|
|
29
|
+
declare function getMetricsForFamily(family: string): Promise<FontFaceMetrics | null>;
|
|
30
|
+
declare function readMetrics(_source: URL | string): Promise<FontFaceMetrics | null>;
|
|
31
|
+
|
|
32
|
+
export { FontaineTransform, type FontaineTransformOptions, generateFallbackName, generateFontFace, getMetricsForFamily, readMetrics };
|
package/dist/index.d.ts
CHANGED
|
@@ -29,4 +29,4 @@ declare const generateFontFace: (metrics: FontFaceMetrics, fallback: FallbackOpt
|
|
|
29
29
|
declare function getMetricsForFamily(family: string): Promise<FontFaceMetrics | null>;
|
|
30
30
|
declare function readMetrics(_source: URL | string): Promise<FontFaceMetrics | null>;
|
|
31
31
|
|
|
32
|
-
export { FontaineTransform, FontaineTransformOptions, generateFallbackName, generateFontFace, getMetricsForFamily, readMetrics };
|
|
32
|
+
export { FontaineTransform, type FontaineTransformOptions, generateFallbackName, generateFontFace, getMetricsForFamily, readMetrics };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fontaine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Automatic font fallback based on font metrics",
|
|
5
5
|
"repository": "unjs/fontaine",
|
|
6
6
|
"keywords": [
|
|
@@ -54,28 +54,28 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@nuxtjs/eslint-config-typescript": "latest",
|
|
57
|
-
"@types/node": "18.
|
|
57
|
+
"@types/node": "18.17.15",
|
|
58
58
|
"@types/serve-handler": "6.1.1",
|
|
59
|
-
"@typescript-eslint/eslint-plugin": "
|
|
60
|
-
"@typescript-eslint/parser": "
|
|
61
|
-
"@vitest/coverage-v8": "0.
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "6.4.1",
|
|
60
|
+
"@typescript-eslint/parser": "6.4.1",
|
|
61
|
+
"@vitest/coverage-v8": "0.34.2",
|
|
62
62
|
"bumpp": "9.1.1",
|
|
63
|
-
"eslint": "8.
|
|
64
|
-
"eslint-config-prettier": "
|
|
63
|
+
"eslint": "8.48.0",
|
|
64
|
+
"eslint-config-prettier": "9.0.0",
|
|
65
65
|
"eslint-plugin-prettier": "latest",
|
|
66
|
-
"execa": "
|
|
67
|
-
"get-port-please": "3.
|
|
66
|
+
"execa": "8.0.1",
|
|
67
|
+
"get-port-please": "3.1.1",
|
|
68
68
|
"husky": "latest",
|
|
69
|
-
"lint-staged": "
|
|
69
|
+
"lint-staged": "14.0.1",
|
|
70
70
|
"prettier": "latest",
|
|
71
71
|
"serve-handler": "6.1.5",
|
|
72
|
-
"typescript": "5.1.
|
|
72
|
+
"typescript": "5.1.6",
|
|
73
73
|
"unbuild": "latest",
|
|
74
|
-
"vite": "4.
|
|
75
|
-
"vitest": "0.
|
|
74
|
+
"vite": "4.4.9",
|
|
75
|
+
"vitest": "0.34.2"
|
|
76
76
|
},
|
|
77
77
|
"resolutions": {
|
|
78
78
|
"fontaine": "link:."
|
|
79
79
|
},
|
|
80
|
-
"packageManager": "pnpm@8.6.
|
|
80
|
+
"packageManager": "pnpm@8.6.12"
|
|
81
81
|
}
|