fontaine 1.0.2 → 1.0.3
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/capsize-font-metrics.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{metrics-Dru3RLLL.mjs → metrics-CiOgR8am.mjs} +1 -1
- package/dist/{metrics-CioeRv3e.cjs → metrics-Lob9PLg0.cjs} +1 -1
- package/dist/postcss.cjs +1 -1
- package/dist/postcss.mjs +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
23
|
//#endregion
|
|
24
|
-
const require_metrics = require("./metrics-
|
|
24
|
+
const require_metrics = require("./metrics-Lob9PLg0.cjs");
|
|
25
25
|
let css_tree = require("css-tree");
|
|
26
26
|
let node_path = require("node:path");
|
|
27
27
|
let node_url = require("node:url");
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as resolveCategoryFallbacks, c as generateFontFace, d as withoutQueryOrFragment, f as withoutQuotes, i as DEFAULT_CATEGORY_FALLBACKS, l as genericCSSFamilies, n as readMetrics, o as cssWideKeywords, r as readMetricsForSource, s as generateFallbackName, t as getMetricsForFamily, u as parseFontFace } from "./metrics-
|
|
1
|
+
import { a as resolveCategoryFallbacks, c as generateFontFace, d as withoutQueryOrFragment, f as withoutQuotes, i as DEFAULT_CATEGORY_FALLBACKS, l as genericCSSFamilies, n as readMetrics, o as cssWideKeywords, r as readMetricsForSource, s as generateFallbackName, t as getMetricsForFamily, u as parseFontFace } from "./metrics-CiOgR8am.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { parse, walk } from "css-tree";
|
|
4
4
|
import { isAbsolute } from "node:path";
|
|
@@ -181,7 +181,7 @@ function generateFontFace(metrics, fallback) {
|
|
|
181
181
|
const { name: fallbackName, font: fallbackFontName, metrics: fallbackMetrics, ...properties } = fallback;
|
|
182
182
|
const preferredFontXAvgRatio = metrics.xWidthAvg / metrics.unitsPerEm;
|
|
183
183
|
const fallbackFontXAvgRatio = fallbackMetrics ? fallbackMetrics.xWidthAvg / fallbackMetrics.unitsPerEm : 1;
|
|
184
|
-
const sizeAdjust = fallbackMetrics && preferredFontXAvgRatio && fallbackFontXAvgRatio ? preferredFontXAvgRatio / fallbackFontXAvgRatio : 1;
|
|
184
|
+
const sizeAdjust = fallbackMetrics && preferredFontXAvgRatio && fallbackFontXAvgRatio && !/emoji/i.test(fallbackFontName) ? preferredFontXAvgRatio / fallbackFontXAvgRatio : 1;
|
|
185
185
|
const adjustedEmSquare = metrics.unitsPerEm * sizeAdjust;
|
|
186
186
|
const ascentOverride = metrics.ascent / adjustedEmSquare;
|
|
187
187
|
const descentOverride = Math.abs(metrics.descent) / adjustedEmSquare;
|
|
@@ -181,7 +181,7 @@ function generateFontFace(metrics, fallback) {
|
|
|
181
181
|
const { name: fallbackName, font: fallbackFontName, metrics: fallbackMetrics, ...properties } = fallback;
|
|
182
182
|
const preferredFontXAvgRatio = metrics.xWidthAvg / metrics.unitsPerEm;
|
|
183
183
|
const fallbackFontXAvgRatio = fallbackMetrics ? fallbackMetrics.xWidthAvg / fallbackMetrics.unitsPerEm : 1;
|
|
184
|
-
const sizeAdjust = fallbackMetrics && preferredFontXAvgRatio && fallbackFontXAvgRatio ? preferredFontXAvgRatio / fallbackFontXAvgRatio : 1;
|
|
184
|
+
const sizeAdjust = fallbackMetrics && preferredFontXAvgRatio && fallbackFontXAvgRatio && !/emoji/i.test(fallbackFontName) ? preferredFontXAvgRatio / fallbackFontXAvgRatio : 1;
|
|
185
185
|
const adjustedEmSquare = metrics.unitsPerEm * sizeAdjust;
|
|
186
186
|
const ascentOverride = metrics.ascent / adjustedEmSquare;
|
|
187
187
|
const descentOverride = Math.abs(metrics.descent) / adjustedEmSquare;
|
package/dist/postcss.cjs
CHANGED
package/dist/postcss.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as resolveCategoryFallbacks, c as generateFontFace, d as withoutQueryOrFragment, f as withoutQuotes, l as genericCSSFamilies, o as cssWideKeywords, r as readMetricsForSource, s as generateFallbackName, t as getMetricsForFamily, u as parseFontFace } from "./metrics-
|
|
1
|
+
import { a as resolveCategoryFallbacks, c as generateFontFace, d as withoutQueryOrFragment, f as withoutQuotes, l as genericCSSFamilies, o as cssWideKeywords, r as readMetricsForSource, s as generateFallbackName, t as getMetricsForFamily, u as parseFontFace } from "./metrics-CiOgR8am.mjs";
|
|
2
2
|
import { parse } from "css-tree";
|
|
3
3
|
//#region src/postcss.ts
|
|
4
4
|
const supportedExtensions = [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fontaine",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"description": "Automatic font fallback based on font metrics",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Daniel Roe",
|
|
@@ -64,17 +64,17 @@
|
|
|
64
64
|
"unplugin": "^3.0.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@capsizecss/metrics": "4.
|
|
67
|
+
"@capsizecss/metrics": "4.4.0",
|
|
68
68
|
"@types/css-tree": "3.2.0",
|
|
69
|
-
"@types/node": "24.19.
|
|
69
|
+
"@types/node": "24.19.2",
|
|
70
70
|
"@types/serve-handler": "6.1.4",
|
|
71
71
|
"@vitest/coverage-v8": "5.0.5",
|
|
72
72
|
"eslint": "10.13.0",
|
|
73
73
|
"get-port-please": "3.2.0",
|
|
74
74
|
"magic-regexp": "0.11.2",
|
|
75
|
-
"postcss": "8.5.
|
|
75
|
+
"postcss": "8.5.31",
|
|
76
76
|
"serve-handler": "6.1.7",
|
|
77
|
-
"tsdown": "0.23.
|
|
77
|
+
"tsdown": "0.23.1",
|
|
78
78
|
"typescript": "6.0.3",
|
|
79
79
|
"vite": "8.3.4",
|
|
80
80
|
"vitest": "5.0.5"
|