@unmade/text-renderer 1.1.1 → 1.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 +184 -0
- package/dist/{__vite-browser-external-CijFC1_R.js → __vite-browser-external-oLchLuMx.js} +1 -1
- package/dist/baselines/index.d.ts +19 -0
- package/dist/ce-adapter/index.cjs +1 -1
- package/dist/ce-adapter/index.js +1 -1
- package/dist/fitting/index.d.ts +86 -0
- package/dist/helpers/bbox.d.ts +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1004 -327
- package/dist/node/baselines/index.d.ts +19 -0
- package/dist/node/fitting/index.d.ts +86 -0
- package/dist/node/helpers/bbox.d.ts +2 -1
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +239 -123
- package/dist/node/rendering/index.d.ts +2 -2
- package/dist/node/types.d.ts +3 -0
- package/dist/rendering/index.d.ts +2 -2
- package/dist/{chunk-3b4jIN3o.js → rolldown-runtime-DtPi1Y-2.js} +2 -2
- package/dist/types.d.ts +3 -0
- package/dist/worker/baselines/index.d.ts +19 -0
- package/dist/worker/fitting/index.d.ts +86 -0
- package/dist/worker/helpers/bbox.d.ts +2 -1
- package/dist/worker/index.d.ts +1 -0
- package/dist/worker/index.js +2665 -2323
- package/dist/worker/rendering/index.d.ts +2 -2
- package/dist/worker/types.d.ts +3 -0
- package/package.json +12 -5
- package/dist/helpers/matrix.d.ts +0 -8
- package/dist/node/helpers/matrix.d.ts +0 -8
- package/dist/worker/helpers/matrix.d.ts +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LoadedFont } from '../loading';
|
|
2
|
-
import { ColourMap, GlyphFill, HorizontalTextAlignmentValues, TextSpacing } from '../types';
|
|
2
|
+
import { ColourMap, GlyphFill, HorizontalTextAlignmentValues, PlatformMatrix, TextSpacing } from '../types';
|
|
3
3
|
export interface SvgGlyphEntry {
|
|
4
4
|
content: string;
|
|
5
5
|
viewBox: string;
|
|
@@ -16,7 +16,7 @@ export interface PathEntry {
|
|
|
16
16
|
transform: string;
|
|
17
17
|
};
|
|
18
18
|
path: unknown;
|
|
19
|
-
matrix:
|
|
19
|
+
matrix: PlatformMatrix;
|
|
20
20
|
glyphData: {
|
|
21
21
|
index: number;
|
|
22
22
|
bbox: {
|
package/dist/worker/types.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { DOMMatrix } from '@unmade/platform';
|
|
1
2
|
import { LoadedFont } from './loading';
|
|
3
|
+
/** The platform's matrix, which is not the same shape as the DOM's DOMMatrix. */
|
|
4
|
+
export type PlatformMatrix = InstanceType<typeof DOMMatrix>;
|
|
2
5
|
export type MeasurementUnits = 'mm' | 'in';
|
|
3
6
|
export type BoxDimensions = {
|
|
4
7
|
width: number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unmade/text-renderer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Pure function text renderer for SVG output",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/unmadeworks/config-engine-packages.git",
|
|
8
|
+
"directory": "packages/text-renderer"
|
|
9
|
+
},
|
|
5
10
|
"type": "module",
|
|
6
11
|
"main": "./dist/index.js",
|
|
7
12
|
"module": "./dist/index.js",
|
|
@@ -63,16 +68,17 @@
|
|
|
63
68
|
"build:ce-adapter": "vite build --config vite.config.ce-adapter.ts",
|
|
64
69
|
"build:types": "cp dist/index.d.ts dist/node/index.d.ts && cp dist/index.d.ts dist/worker/index.d.ts",
|
|
65
70
|
"test": "vitest run",
|
|
66
|
-
"test:unit": "vitest run --exclude '**/__tests__/regression.test.ts'",
|
|
71
|
+
"test:unit": "vitest run --exclude '**/__tests__/regression.test.ts' --exclude '**/__tests__/platform/**'",
|
|
67
72
|
"test:regression": "vitest run __tests__/regression.test.ts",
|
|
73
|
+
"test:platform": "npm run build && vitest run --config vitest.config.platform.ts",
|
|
68
74
|
"test:watch": "vitest",
|
|
69
75
|
"benchmark": "vitest bench __tests__/benchmark.bench.ts",
|
|
70
76
|
"typecheck": "tsc --noEmit"
|
|
71
77
|
},
|
|
72
78
|
"dependencies": {
|
|
73
|
-
"@unmade/platform": "^0.1.
|
|
79
|
+
"@unmade/platform": "^0.1.5",
|
|
74
80
|
"@unmade/svg-helpers": "^0.1.3",
|
|
75
|
-
"harfbuzzjs": "^1.
|
|
81
|
+
"harfbuzzjs": "^1.6.0"
|
|
76
82
|
},
|
|
77
83
|
"peerDependencies": {
|
|
78
84
|
"svg-path-properties": "^2.0.2"
|
|
@@ -82,10 +88,11 @@
|
|
|
82
88
|
"@types/pngjs": "^6.0.5",
|
|
83
89
|
"@typescript/typescript6": "^6.0.2",
|
|
84
90
|
"pixelmatch": "^7.2.0",
|
|
91
|
+
"playwright": "^1.62.1",
|
|
85
92
|
"pngjs": "^7.0.0",
|
|
86
93
|
"svg-path-properties": "^2.0.2",
|
|
87
94
|
"typescript": "^7.0.2",
|
|
88
|
-
"vite": "^8.
|
|
95
|
+
"vite": "^8.2.1",
|
|
89
96
|
"vite-plugin-dts": "^5.0.3",
|
|
90
97
|
"vitest": "^4.1.10"
|
|
91
98
|
},
|
package/dist/helpers/matrix.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create a matrix with optional initial values
|
|
3
|
-
* Detects what style of matrix is supported by the browser
|
|
4
|
-
*
|
|
5
|
-
* @param {Array} initialValues - the initial values for the matrix
|
|
6
|
-
* @returns {DOMMatrix} the new matrix
|
|
7
|
-
*/
|
|
8
|
-
export declare const createMatrix: (initialValues?: number[]) => DOMMatrix;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create a matrix with optional initial values
|
|
3
|
-
* Detects what style of matrix is supported by the browser
|
|
4
|
-
*
|
|
5
|
-
* @param {Array} initialValues - the initial values for the matrix
|
|
6
|
-
* @returns {DOMMatrix} the new matrix
|
|
7
|
-
*/
|
|
8
|
-
export declare const createMatrix: (initialValues?: number[]) => DOMMatrix;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create a matrix with optional initial values
|
|
3
|
-
* Detects what style of matrix is supported by the browser
|
|
4
|
-
*
|
|
5
|
-
* @param {Array} initialValues - the initial values for the matrix
|
|
6
|
-
* @returns {DOMMatrix} the new matrix
|
|
7
|
-
*/
|
|
8
|
-
export declare const createMatrix: (initialValues?: number[]) => DOMMatrix;
|