@richardmcquiston01/unofficial-xcs-writer 0.3.0 → 0.3.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/CHANGELOG.md +10 -0
- package/README.md +135 -123
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/donate.svg +2 -0
- package/package.json +53 -53
- package/third_party/arimo/LICENSE +200 -200
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.1] - 2026-08-17
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Replaced the ad-hoc PayPal "Support" section in the README with the standard
|
|
13
|
+
"Buy Me a Coffee" donation block (Stripe link plus a scannable QR code at
|
|
14
|
+
`donate.svg`), now the last section of the README.
|
|
15
|
+
- `donate.svg` is included in the published tarball so the README's QR image
|
|
16
|
+
resolves for consumers reading it from the package.
|
|
17
|
+
|
|
8
18
|
## [0.3.0] - 2026-07-14
|
|
9
19
|
|
|
10
20
|
### Added
|
package/README.md
CHANGED
|
@@ -1,123 +1,135 @@
|
|
|
1
|
-
# unofficial-xcs-writer
|
|
2
|
-
|
|
3
|
-
A framework-agnostic TypeScript library for reading, writing, and applying variable substitution to `.xcs` files produced by [xTool Creative Space](https://www.xtool.com/pages/software). Not affiliated with xTool.
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
//
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
### `
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
### `
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
### `
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
[
|
|
1
|
+
# unofficial-xcs-writer
|
|
2
|
+
|
|
3
|
+
A framework-agnostic TypeScript library for reading, writing, and applying variable substitution to `.xcs` files produced by [xTool Creative Space](https://www.xtool.com/pages/software). Not affiliated with xTool.
|
|
4
|
+
|
|
5
|
+
## What is an XCS file?
|
|
6
|
+
|
|
7
|
+
An `.xcs` file is a plain UTF-8 JSON document exported by xTool Creative Space. It describes a laser project — canvas dimensions, design objects (shapes, text, images), layer assignments, and device parameters. This library lets you:
|
|
8
|
+
|
|
9
|
+
- **Read** an XCS file and inspect its contents
|
|
10
|
+
- **Extract** `{{token}}` template placeholders from text objects
|
|
11
|
+
- **Render** a filled-in copy by substituting values for those placeholders
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @richardmcquiston01/unofficial-xcs-writer
|
|
17
|
+
# or
|
|
18
|
+
pnpm add @richardmcquiston01/unofficial-xcs-writer
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { assertXcsFormat, extractXcsTokens, renderXcsFile } from '@richardmcquiston01/unofficial-xcs-writer';
|
|
25
|
+
import type { XcsVariable } from '@richardmcquiston01/unofficial-xcs-writer';
|
|
26
|
+
|
|
27
|
+
// Load an .xcs file as an ArrayBuffer (browser or Node.js)
|
|
28
|
+
const buffer = await fetch('/templates/name-tag.xcs').then(r => r.arrayBuffer());
|
|
29
|
+
|
|
30
|
+
// Validate it's a real XCS file
|
|
31
|
+
assertXcsFormat(buffer); // throws if invalid
|
|
32
|
+
|
|
33
|
+
// Discover which {{token}} placeholders are in the file
|
|
34
|
+
const tokens = extractXcsTokens(buffer);
|
|
35
|
+
// e.g. ['FirstName', 'LastName']
|
|
36
|
+
|
|
37
|
+
// Define variables and supply values
|
|
38
|
+
const variables: XcsVariable[] = [
|
|
39
|
+
{ token: 'FirstName', defaultValue: 'Guest' },
|
|
40
|
+
{ token: 'LastName' },
|
|
41
|
+
];
|
|
42
|
+
const values = { FirstName: 'Jane', LastName: 'Smith' };
|
|
43
|
+
|
|
44
|
+
// Produce a filled-in .xcs file ready for download
|
|
45
|
+
const output: Uint8Array = renderXcsFile(buffer, variables, values);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## API
|
|
49
|
+
|
|
50
|
+
### `assertXcsFormat(buffer: ArrayBuffer): void`
|
|
51
|
+
|
|
52
|
+
Validates that `buffer` is a parseable XCS JSON file containing a `canvas` array. Throws a descriptive error if the file is invalid or unrecognized.
|
|
53
|
+
|
|
54
|
+
### `readXcsFile(buffer: ArrayBuffer): string`
|
|
55
|
+
|
|
56
|
+
Decodes the buffer and returns the raw JSON string. Useful for inspection or pass-through scenarios.
|
|
57
|
+
|
|
58
|
+
### `extractXcsTokens(buffer: ArrayBuffer): string[]`
|
|
59
|
+
|
|
60
|
+
Scans all `TEXT` display objects across all canvases and returns the unique token names found (without braces). For example, `{{LastName}}` in the file → `"LastName"` in the returned array.
|
|
61
|
+
|
|
62
|
+
### `renderXcsFile(buffer, variables, values, fonts?): Uint8Array`
|
|
63
|
+
|
|
64
|
+
Applies substitution to every `TEXT` display object and returns the modified file encoded as a UTF-8 `Uint8Array`. Tokens with no matching entry in `values` fall back to `variable.defaultValue`, or an empty string if no default is set.
|
|
65
|
+
|
|
66
|
+
Whenever a display's text actually changes, its glyph outline data (`charJSONs` / `fontData.glyphData`) is regenerated from a real font so xTool Studio renders the new text correctly — xTool Studio only trusts a TEXT display's stored glyph shapes; it does not re-shape text on its own unless you manually reselect the font inside the app. Displays whose text doesn't change are left completely untouched.
|
|
67
|
+
|
|
68
|
+
Pass `fonts` to supply real font file bytes (TTF/OTF/WOFF) keyed by a display's `style.fontFamily`:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
const arialBuffer = await fetch('/fonts/arial.ttf').then(r => r.arrayBuffer());
|
|
72
|
+
renderXcsFile(buffer, variables, values, { Arial: arialBuffer });
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Any `fontFamily` not present in `fonts` falls back to a bundled default (Arimo, Apache-2.0, metric-compatible with Arial) — so the fix works out of the box with no font files required, just with shapes drawn from Arimo rather than the exact requested typeface.
|
|
76
|
+
|
|
77
|
+
**Known limitation:** only straight horizontal-baseline layout is reproduced. xTool Studio's `style.curveX`/`curveY` curved-text layout formula is undocumented and isn't replicated — substituted text on a curved TEXT display gets correctly-shaped glyphs laid out on a straight line instead of the original curve.
|
|
78
|
+
|
|
79
|
+
### `XcsVariable`
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
interface XcsVariable {
|
|
83
|
+
token: string; // token name without braces, e.g. "LastName"
|
|
84
|
+
defaultValue?: string;
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### `loadFont(buffer: ArrayBuffer)` / `loadDefaultFont()` / `layoutText(font, text, originX, originY)`
|
|
89
|
+
|
|
90
|
+
Lower-level glyph-extraction primitives `renderXcsFile` is built on, exported for direct use (e.g. building a `TEXT` display from scratch). See `src/glyphs.ts` for the exact xTool JSON conventions these were reverse-engineered against.
|
|
91
|
+
|
|
92
|
+
## Development
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
pnpm install # install dev dependencies
|
|
96
|
+
pnpm build # compile → dist/ (ESM + CJS + .d.ts)
|
|
97
|
+
pnpm dev # watch mode — rebuilds on save
|
|
98
|
+
pnpm test # run tests with vitest
|
|
99
|
+
npx tsc --noEmit # type-check without emitting
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Output files after `pnpm build`:
|
|
103
|
+
|
|
104
|
+
| File | Format |
|
|
105
|
+
|------|--------|
|
|
106
|
+
| `dist/index.js` | ESM |
|
|
107
|
+
| `dist/index.cjs` | CommonJS |
|
|
108
|
+
| `dist/index.d.ts` | TypeScript declarations |
|
|
109
|
+
|
|
110
|
+
### Releasing
|
|
111
|
+
|
|
112
|
+
Publishing to npm is automated. Bump the version in `package.json`, add a
|
|
113
|
+
`CHANGELOG.md` entry, then create a GitHub release tagged `vX.Y.Z` — the
|
|
114
|
+
[publish workflow](.github/workflows/publish.yml) checks the tag against
|
|
115
|
+
`package.json`, rebuilds, runs the tests, and publishes with provenance.
|
|
116
|
+
It needs an `NPM_TOKEN` repository secret with publish rights.
|
|
117
|
+
|
|
118
|
+
## Notes
|
|
119
|
+
|
|
120
|
+
- All inputs and outputs use plain browser-compatible types (`ArrayBuffer`, `Uint8Array`, `string`) — no Node.js APIs, no DOM, no framework required. (`atob`/`crypto.randomUUID` are used for the bundled font and glyph IDs; both are available in browsers and Node ≥ 19.)
|
|
121
|
+
- Only `TEXT` display objects are modified during substitution. Geometry, bitmaps, device configuration, and all other fields pass through unchanged.
|
|
122
|
+
- This library targets the current xTool Creative Space JSON format. Older versions of the software may export a different structure.
|
|
123
|
+
- Glyph outline extraction is powered by [opentype.js](https://github.com/opentypejs/opentype.js). The bundled fallback font is [Arimo](https://fonts.google.com/specimen/Arimo) v5.2.8 via [`@fontsource/arimo`](https://www.npmjs.com/package/@fontsource/arimo) (Apache License 2.0, see `third_party/arimo/LICENSE`).
|
|
124
|
+
|
|
125
|
+
## License
|
|
126
|
+
|
|
127
|
+
[MIT](LICENSE). The bundled Arimo fallback font is separately licensed under Apache-2.0 (`third_party/arimo/LICENSE`).
|
|
128
|
+
|
|
129
|
+
## Buy Me a Coffee
|
|
130
|
+
|
|
131
|
+
If this app, code, or repository has helped you or someone you know, please consider donating. I appreciate any help to offset the costs of development and/or AI Credits.
|
|
132
|
+
|
|
133
|
+
[**Donate via Stripe**](https://donate.stripe.com/00w5kD3Gj1Xo9v7gVOcs800), or scan:
|
|
134
|
+
|
|
135
|
+
[](https://donate.stripe.com/00w5kD3Gj1Xo9v7gVOcs800)
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/glyphs.ts","../src/assets/arimo-regular.ts","../src/xcs.ts"],"sourcesContent":["export type { XcsVariable, XcsProject, XcsCanvas, XcsDisplay } from './types.js';\r\nexport { assertXcsFormat, readXcsFile, extractXcsTokens, renderXcsFile } from './xcs.js';\r\nexport type {\r\n GlyphBBox,\r\n GlyphData,\r\n FontInfo,\r\n FontData,\r\n CharJson,\r\n TextLayoutResult,\r\n} from './glyphs.js';\r\nexport { loadFont, loadDefaultFont, layoutText } from './glyphs.js';\r\n","// opentype.js is a CJS-only UMD build with no \"exports\" map, so under\r\n// native ESM only the default import is reliably populated -- a\r\n// namespace import (`import * as opentype`) leaves named properties\r\n// like `.parse` undefined at runtime in built ESM output.\r\nimport opentype from 'opentype.js';\r\nimport { ARIMO_REGULAR_WOFF_BASE64 } from './assets/arimo-regular.js';\r\n\r\n/**\r\n * Real glyph outline extraction for XCS TEXT displays, replacing the\r\n * placeholder-square glyphs that a naive generator (or an .xcs file\r\n * whose TEXT display has an empty `charJSONs`) would otherwise produce.\r\n *\r\n * xTool Studio's on-disk format was reverse-engineered by diffing a\r\n * generated .xcs file against the same file re-saved by xTool Studio,\r\n * both unchanged and after manually re-selecting the font (see this\r\n * repo's CLAUDE.md \"Open Issues\" for the full writeup). Key findings\r\n * baked into the math below:\r\n *\r\n * - `charJSONs` (not `fontData.glyphData`) is what actually renders on\r\n * canvas -- one PATH-shaped entry per non-whitespace character.\r\n * - Font design coordinates are always scaled so that 1 em == 25.4mm\r\n * (1 inch), independent of the `style.fontSize` value written\r\n * alongside it (empirically confirmed against real Arial metrics).\r\n * - `fontData.glyphData[char].bbox` / `advanceWidth` / `leftBearing`\r\n * use the font's native Y-up convention. `charJSONs[i].dPath` uses a\r\n * Y-down convention (flip Y) and is expressed in glyph-local\r\n * coordinates relative to that character's own pen/baseline origin\r\n * (`graphicX`/`graphicY`), i.e. dPath is NOT pre-translated to the\r\n * character's absolute canvas position.\r\n * - `charJSONs[i].x/y` is the character's ink bounding-box top-left in\r\n * absolute canvas coordinates: x = graphicX + bbox.minX,\r\n * y = graphicY - bbox.maxY. width/height are the ink bbox extents.\r\n * - A TEXT display's own `x`/`y` equals the FIRST character's box\r\n * top-left (x[0]/y[0]) -- i.e. it is not a separate anchor to\r\n * recompute, it doubles as charJSONs[0]'s position.\r\n *\r\n * Known limitation: this only replicates STRAIGHT horizontal-baseline\r\n * layout (constant graphicY, cumulative graphicX via advance widths).\r\n * xTool Studio's `style.curveX`/`curveY` curved-text layout formula is\r\n * undocumented and was not reverse-engineerable with confidence from\r\n * available samples, so curved text is not reproduced -- substituted\r\n * text on a curved TEXT display will render with real glyph shapes,\r\n * correctly shaped, but laid out on a straight baseline instead of\r\n * the original curve.\r\n */\r\n\r\nconst MM_PER_EM = 25.4;\r\n\r\nexport interface GlyphBBox {\r\n minX: number;\r\n minY: number;\r\n maxX: number;\r\n maxY: number;\r\n}\r\n\r\nexport interface GlyphData {\r\n dPath: string;\r\n advanceWidth: number;\r\n advanceHeight: number;\r\n leftBearing: number;\r\n topBearing: number;\r\n bbox: GlyphBBox;\r\n}\r\n\r\nexport interface FontInfo {\r\n unitsPerEm: number;\r\n lineHeight: number;\r\n ascent: number;\r\n descent: number;\r\n capHeight: number;\r\n xHeight: number;\r\n lineGap: number;\r\n}\r\n\r\nexport interface FontData {\r\n fontInfo: FontInfo;\r\n glyphData: Record<string, GlyphData>;\r\n}\r\n\r\nexport interface CharJson {\r\n id: string;\r\n type: 'PATH';\r\n x: number;\r\n y: number;\r\n width: number;\r\n height: number;\r\n offsetX: number;\r\n offsetY: number;\r\n graphicX: number;\r\n graphicY: number;\r\n dPath: string;\r\n fillRule: 'nonzero';\r\n isFill: boolean;\r\n}\r\n\r\nexport interface TextLayoutResult {\r\n fontData: FontData;\r\n charJSONs: CharJson[];\r\n /** New display x/y (== charJSONs[0]'s box top-left), only present if text is non-empty. */\r\n x: number | null;\r\n y: number | null;\r\n width: number;\r\n height: number;\r\n}\r\n\r\nlet cachedDefaultFont: opentype.Font | null = null;\r\n\r\nfunction base64ToArrayBuffer(base64: string): ArrayBuffer {\r\n const binary = atob(base64);\r\n const bytes = new Uint8Array(binary.length);\r\n for (let i = 0; i < binary.length; i++) {\r\n bytes[i] = binary.charCodeAt(i);\r\n }\r\n return bytes.buffer;\r\n}\r\n\r\n/** Loads and parses a font file (TTF/OTF/WOFF) for glyph extraction. */\r\nexport function loadFont(buffer: ArrayBuffer): opentype.Font {\r\n return opentype.parse(buffer);\r\n}\r\n\r\n/** The bundled fallback font (Arimo, metric-compatible with Arial, Apache-2.0). */\r\nexport function loadDefaultFont(): opentype.Font {\r\n if (!cachedDefaultFont) {\r\n cachedDefaultFont = loadFont(base64ToArrayBuffer(ARIMO_REGULAR_WOFF_BASE64));\r\n }\r\n return cachedDefaultFont;\r\n}\r\n\r\nfunction scaleFor(font: opentype.Font): number {\r\n return MM_PER_EM / font.unitsPerEm;\r\n}\r\n\r\nfunction fontInfoFor(font: opentype.Font): FontInfo {\r\n const scale = scaleFor(font);\r\n const os2 = font.tables['os2'] as { sCapHeight?: number; sxHeight?: number } | undefined;\r\n const capHeight = os2?.sCapHeight ?? Math.round(font.unitsPerEm * 0.7);\r\n const xHeight = os2?.sxHeight ?? Math.round(font.unitsPerEm * 0.5);\r\n return {\r\n unitsPerEm: font.unitsPerEm,\r\n lineHeight: (font.ascender - font.descender) * scale,\r\n ascent: font.ascender * scale,\r\n descent: font.descender * scale,\r\n capHeight: capHeight * scale,\r\n xHeight: xHeight * scale,\r\n lineGap: 0,\r\n };\r\n}\r\n\r\n/** A glyph with no visible ink (whitespace, or a font with no outline for this character). */\r\nfunction isEmptyGlyph(glyph: opentype.Glyph): boolean {\r\n const path = glyph.path;\r\n return !path || path.commands.length === 0;\r\n}\r\n\r\nfunction pathToDString(path: opentype.Path, scale: number): string {\r\n const fmt = (n: number): string => {\r\n const rounded = Math.round(n * 100) / 100;\r\n return Number.isInteger(rounded) ? String(rounded) : rounded.toFixed(2);\r\n };\r\n // xTool's dPath uses a Y-down convention; opentype.js paths are Y-up\r\n // (baseline at 0, ascenders positive), so Y is negated here.\r\n const parts: string[] = [];\r\n for (const cmd of path.commands) {\r\n switch (cmd.type) {\r\n case 'M':\r\n parts.push(`M${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`);\r\n break;\r\n case 'L':\r\n parts.push(`L${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`);\r\n break;\r\n case 'Q':\r\n parts.push(\r\n `Q${fmt(cmd.x1 * scale)} ${fmt(-cmd.y1 * scale)} ${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`\r\n );\r\n break;\r\n case 'C':\r\n parts.push(\r\n `C${fmt(cmd.x1 * scale)} ${fmt(-cmd.y1 * scale)} ${fmt(cmd.x2 * scale)} ${fmt(-cmd.y2 * scale)} ${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`\r\n );\r\n break;\r\n case 'Z':\r\n parts.push('Z');\r\n break;\r\n }\r\n }\r\n return parts.join('');\r\n}\r\n\r\nfunction bboxFor(path: opentype.Path, scale: number): GlyphBBox {\r\n const box = path.getBoundingBox();\r\n return {\r\n minX: box.x1 * scale,\r\n minY: box.y1 * scale,\r\n maxX: box.x2 * scale,\r\n maxY: box.y2 * scale,\r\n };\r\n}\r\n\r\nfunction generateUuid(): string {\r\n if (typeof crypto !== 'undefined' && crypto.randomUUID) {\r\n return crypto.randomUUID();\r\n }\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\r\n const r = (Math.random() * 16) | 0;\r\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\r\n return v.toString(16);\r\n });\r\n}\r\n\r\n/**\r\n * Builds glyphData + charJSONs for `text` laid out on a straight\r\n * horizontal baseline, anchored so the first character's ink\r\n * bounding-box top-left lands at (originX, originY) -- matching how\r\n * an xTool Studio TEXT display's own x/y equals charJSONs[0]'s x/y.\r\n */\r\nexport function layoutText(\r\n font: opentype.Font,\r\n text: string,\r\n originX: number,\r\n originY: number\r\n): TextLayoutResult {\r\n const scale = scaleFor(font);\r\n const fontInfo = fontInfoFor(font);\r\n const glyphData: Record<string, GlyphData> = {};\r\n const charJSONs: CharJson[] = [];\r\n\r\n let graphicX: number | null = null;\r\n let graphicY = originY;\r\n let firstBox: GlyphBBox | null = null;\r\n let minX = Infinity;\r\n let minY = Infinity;\r\n let maxX = -Infinity;\r\n let maxY = -Infinity;\r\n\r\n for (const char of text) {\r\n const glyph = font.charToGlyph(char);\r\n const advanceWidth = (glyph.advanceWidth ?? 0) * scale;\r\n\r\n if (!glyphData[char]) {\r\n // Raw, unscaled path in the font's native Y-up convention\r\n // (baseline at 0, ascenders positive) -- NOT glyph.getPath(x, y,\r\n // fontSize), which opentype.js Y-flips for canvas rendering when\r\n // given explicit coordinates, and would double-flip against our\r\n // own conversion below.\r\n const path = glyph.path;\r\n if (isEmptyGlyph(glyph)) {\r\n glyphData[char] = {\r\n dPath: '',\r\n advanceWidth,\r\n advanceHeight: fontInfo.lineHeight,\r\n leftBearing: 0,\r\n topBearing: 0,\r\n bbox: { minX: 0, minY: 0, maxX: 0, maxY: 0 },\r\n };\r\n } else {\r\n const bbox = bboxFor(path, scale);\r\n glyphData[char] = {\r\n dPath: pathToDString(path, scale),\r\n advanceWidth,\r\n advanceHeight: fontInfo.lineHeight,\r\n leftBearing: (glyph.leftSideBearing ?? 0) * scale,\r\n topBearing: fontInfo.ascent - bbox.maxY,\r\n bbox,\r\n };\r\n }\r\n }\r\n\r\n const data = glyphData[char];\r\n const hasInk = data.dPath !== '';\r\n\r\n if (graphicX === null) {\r\n // Anchor the first character (visible or not) at (originX, originY).\r\n graphicX = hasInk ? originX - data.bbox.minX : originX;\r\n if (hasInk) graphicY = originY + data.bbox.maxY;\r\n }\r\n\r\n if (hasInk) {\r\n const x = graphicX + data.bbox.minX;\r\n const y = graphicY - data.bbox.maxY;\r\n const width = data.bbox.maxX - data.bbox.minX;\r\n const height = data.bbox.maxY - data.bbox.minY;\r\n\r\n // dPath is glyph-local (relative to the pen origin graphicX/Y),\r\n // matching the observed xTool convention -- same shape as\r\n // fontData.glyphData[char].dPath, computed once and cached above.\r\n charJSONs.push({\r\n id: generateUuid(),\r\n type: 'PATH',\r\n x,\r\n y,\r\n width,\r\n height,\r\n offsetX: x,\r\n offsetY: y,\r\n graphicX,\r\n graphicY,\r\n dPath: data.dPath,\r\n fillRule: 'nonzero',\r\n isFill: true,\r\n });\r\n\r\n if (!firstBox) firstBox = { minX: x, minY: y, maxX: x + width, maxY: y + height };\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x + width);\r\n maxY = Math.max(maxY, y + height);\r\n }\r\n\r\n graphicX += advanceWidth;\r\n }\r\n\r\n return {\r\n fontData: { fontInfo, glyphData },\r\n charJSONs,\r\n x: firstBox ? firstBox.minX : null,\r\n y: firstBox ? firstBox.minY : null,\r\n width: Number.isFinite(maxX - minX) ? maxX - minX : 0,\r\n height: Number.isFinite(maxY - minY) ? maxY - minY : 0,\r\n };\r\n}\r\n","// Arimo Regular (WOFF), subset: Latin.\r\n// Source: @fontsource/arimo v5.2.8 (https://www.npmjs.com/package/@fontsource/arimo)\r\n// License: Apache License 2.0 -- see third_party/arimo/LICENSE\r\n// Used as the default fallback font for real glyph outline extraction\r\n// when the caller doesn't supply a font file for a TEXT display's\r\n// fontFamily. Arimo is metric-compatible with Arial.\r\nexport const ARIMO_REGULAR_WOFF_BASE64 = 'd09GRgABAAAAADnwAA8AAAAAVRwAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABWAAAADMAAABEAvIETUdQT1MAAAGMAAAEngAACH7MJbNcR1NVQgAABiwAAACAAAAAviy6M+pPUy8yAAAGrAAAAFoAAABgePIqZFNUQVQAAAcIAAAAPAAAAEjnbMwYY21hcAAAB0QAAAFtAAACEKO9RodnYXNwAAAItAAAAAgAAAAIAAAAEGdseWYAAAi8AAApswAAPGblIOkQaGVhZAAAMnAAAAA2AAAANicFebdoaGVhAAAyqAAAAB8AAAAkGgkQbWhtdHgAADLIAAACFAAAA8jIW0CT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qqZ55n5gZ5lzJTylvhm9ApDT/8H8WM';\r\n","import type { XcsProject, XcsVariable } from './types.js';\r\nimport { loadDefaultFont, loadFont, layoutText } from './glyphs.js';\r\nimport type * as opentype from 'opentype.js';\r\n\r\nconst TOKEN_RE = /\\{\\{([^}]+)\\}\\}/g;\r\n\r\nexport function assertXcsFormat(buffer: ArrayBuffer): void {\r\n let project: unknown;\r\n try {\r\n project = JSON.parse(new TextDecoder().decode(buffer));\r\n } catch (err) {\r\n throw new Error(`Not a valid .xcs file: ${(err as Error).message}`);\r\n }\r\n if (\r\n typeof project !== 'object' ||\r\n project === null ||\r\n !Array.isArray((project as Record<string, unknown>).canvas)\r\n ) {\r\n throw new Error('Not a valid .xcs file: missing canvas array.');\r\n }\r\n}\r\n\r\nexport function readXcsFile(buffer: ArrayBuffer): string {\r\n return new TextDecoder().decode(buffer);\r\n}\r\n\r\nexport function extractXcsTokens(buffer: ArrayBuffer): string[] {\r\n const project = JSON.parse(readXcsFile(buffer)) as XcsProject;\r\n const seen = new Set<string>();\r\n\r\n for (const canvas of project.canvas) {\r\n for (const display of canvas.displays) {\r\n if (display.type === 'TEXT' && typeof display.text === 'string') {\r\n for (const match of display.text.matchAll(TOKEN_RE)) {\r\n seen.add(match[1]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return Array.from(seen);\r\n}\r\n\r\nfunction resolveFont(\r\n fontFamily: string | undefined,\r\n fonts: Record<string, ArrayBuffer> | undefined,\r\n cache: Map<string, opentype.Font>,\r\n): opentype.Font {\r\n const key = fontFamily ?? '';\r\n const cached = cache.get(key);\r\n if (cached) return cached;\r\n\r\n const suppliedBuffer = fontFamily ? fonts?.[fontFamily] : undefined;\r\n const font = suppliedBuffer ? loadFont(suppliedBuffer) : loadDefaultFont();\r\n cache.set(key, font);\r\n return font;\r\n}\r\n\r\n/**\r\n * Substitutes `{{token}}` placeholders in TEXT display `text` fields.\r\n *\r\n * Whenever a display's text actually changes, its glyph outline data\r\n * (`charJSONs` / `fontData.glyphData`) is regenerated from a real font\r\n * so xTool Studio renders the new text correctly instead of showing\r\n * stale or placeholder glyph shapes (see src/glyphs.ts for the format\r\n * this was reverse-engineered from, and its documented limitations --\r\n * notably, curved-text layout is not reproduced).\r\n *\r\n * Pass `fonts` to supply real font file bytes keyed by the TEXT\r\n * display's `style.fontFamily`; displays whose font isn't supplied\r\n * fall back to a bundled metric-compatible default (Arimo, standing in\r\n * for Arial). Displays whose text doesn't change are left untouched.\r\n */\r\nexport function renderXcsFile(\r\n buffer: ArrayBuffer,\r\n variables: XcsVariable[],\r\n values: Record<string, string>,\r\n fonts?: Record<string, ArrayBuffer>,\r\n): Uint8Array {\r\n const project = JSON.parse(readXcsFile(buffer)) as XcsProject;\r\n const fontCache = new Map<string, opentype.Font>();\r\n\r\n for (const canvas of project.canvas) {\r\n for (const display of canvas.displays) {\r\n if (display.type === 'TEXT' && typeof display.text === 'string') {\r\n const originalText = display.text;\r\n let text = originalText;\r\n for (const variable of variables) {\r\n const replacement = values[variable.token] ?? variable.defaultValue ?? '';\r\n text = text.replaceAll(`{{${variable.token}}}`, replacement);\r\n }\r\n display.text = text;\r\n\r\n if (text === originalText) continue;\r\n\r\n const style = display.style as { fontFamily?: string } | undefined;\r\n const font = resolveFont(style?.fontFamily, fonts, fontCache);\r\n const originX = typeof display.x === 'number' ? display.x : 0;\r\n const originY = typeof display.y === 'number' ? display.y : 0;\r\n\r\n const layout = layoutText(font, text, originX, originY);\r\n display.fontData = layout.fontData;\r\n display.charJSONs = layout.charJSONs;\r\n if (layout.x !== null && layout.y !== null) {\r\n display.x = layout.x;\r\n display.y = layout.y;\r\n display.offsetX = layout.x;\r\n display.offsetY = layout.y;\r\n display.width = layout.width;\r\n display.height = layout.height;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return new TextEncoder().encode(JSON.stringify(project));\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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SAAS,UAAU,OAAO,QAAQ,SAAS,UAAU;AAC/D,cAAM,eAAe,QAAQ;AAC7B,YAAI,OAAO;AACX,mBAAW,YAAY,WAAW;AAChC,gBAAM,cAAc,OAAO,SAAS,KAAK,KAAK,SAAS,gBAAgB;AACvE,iBAAO,KAAK,WAAW,KAAK,SAAS,KAAK,MAAM,WAAW;AAAA,QAC7D;AACA,gBAAQ,OAAO;AAEf,YAAI,SAAS,aAAc;AAE3B,cAAM,QAAQ,QAAQ;AACtB,cAAM,OAAO,YAAY,OAAO,YAAY,OAAO,SAAS;AAC5D,cAAM,UAAU,OAAO,QAAQ,MAAM,WAAW,QAAQ,IAAI;AAC5D,cAAM,UAAU,OAAO,QAAQ,MAAM,WAAW,QAAQ,IAAI;AAE5D,cAAM,SAAS,WAAW,MAAM,MAAM,SAAS,OAAO;AACtD,gBAAQ,WAAW,OAAO;AAC1B,gBAAQ,YAAY,OAAO;AAC3B,YAAI,OAAO,MAAM,QAAQ,OAAO,MAAM,MAAM;AAC1C,kBAAQ,IAAI,OAAO;AACnB,kBAAQ,IAAI,OAAO;AACnB,kBAAQ,UAAU,OAAO;AACzB,kBAAQ,UAAU,OAAO;AACzB,kBAAQ,QAAQ,OAAO;AACvB,kBAAQ,SAAS,OAAO;AAAA,QAC1B;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO,IAAI,YAAY,EAAE,OAAO,KAAK,UAAU,OAAO,CAAC;AACzD;","names":["opentype"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/glyphs.ts","../src/assets/arimo-regular.ts","../src/xcs.ts"],"sourcesContent":["export type { XcsVariable, XcsProject, XcsCanvas, XcsDisplay } from './types.js';\nexport { assertXcsFormat, readXcsFile, extractXcsTokens, renderXcsFile } from './xcs.js';\nexport type {\n GlyphBBox,\n GlyphData,\n FontInfo,\n FontData,\n CharJson,\n TextLayoutResult,\n} from './glyphs.js';\nexport { loadFont, loadDefaultFont, layoutText } from './glyphs.js';\n","// opentype.js is a CJS-only UMD build with no \"exports\" map, so under\n// native ESM only the default import is reliably populated -- a\n// namespace import (`import * as opentype`) leaves named properties\n// like `.parse` undefined at runtime in built ESM output.\nimport opentype from 'opentype.js';\nimport { ARIMO_REGULAR_WOFF_BASE64 } from './assets/arimo-regular.js';\n\n/**\n * Real glyph outline extraction for XCS TEXT displays, replacing the\n * placeholder-square glyphs that a naive generator (or an .xcs file\n * whose TEXT display has an empty `charJSONs`) would otherwise produce.\n *\n * xTool Studio's on-disk format was reverse-engineered by diffing a\n * generated .xcs file against the same file re-saved by xTool Studio,\n * both unchanged and after manually re-selecting the font (see this\n * repo's CLAUDE.md \"Open Issues\" for the full writeup). Key findings\n * baked into the math below:\n *\n * - `charJSONs` (not `fontData.glyphData`) is what actually renders on\n * canvas -- one PATH-shaped entry per non-whitespace character.\n * - Font design coordinates are always scaled so that 1 em == 25.4mm\n * (1 inch), independent of the `style.fontSize` value written\n * alongside it (empirically confirmed against real Arial metrics).\n * - `fontData.glyphData[char].bbox` / `advanceWidth` / `leftBearing`\n * use the font's native Y-up convention. `charJSONs[i].dPath` uses a\n * Y-down convention (flip Y) and is expressed in glyph-local\n * coordinates relative to that character's own pen/baseline origin\n * (`graphicX`/`graphicY`), i.e. dPath is NOT pre-translated to the\n * character's absolute canvas position.\n * - `charJSONs[i].x/y` is the character's ink bounding-box top-left in\n * absolute canvas coordinates: x = graphicX + bbox.minX,\n * y = graphicY - bbox.maxY. width/height are the ink bbox extents.\n * - A TEXT display's own `x`/`y` equals the FIRST character's box\n * top-left (x[0]/y[0]) -- i.e. it is not a separate anchor to\n * recompute, it doubles as charJSONs[0]'s position.\n *\n * Known limitation: this only replicates STRAIGHT horizontal-baseline\n * layout (constant graphicY, cumulative graphicX via advance widths).\n * xTool Studio's `style.curveX`/`curveY` curved-text layout formula is\n * undocumented and was not reverse-engineerable with confidence from\n * available samples, so curved text is not reproduced -- substituted\n * text on a curved TEXT display will render with real glyph shapes,\n * correctly shaped, but laid out on a straight baseline instead of\n * the original curve.\n */\n\nconst MM_PER_EM = 25.4;\n\nexport interface GlyphBBox {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n}\n\nexport interface GlyphData {\n dPath: string;\n advanceWidth: number;\n advanceHeight: number;\n leftBearing: number;\n topBearing: number;\n bbox: GlyphBBox;\n}\n\nexport interface FontInfo {\n unitsPerEm: number;\n lineHeight: number;\n ascent: number;\n descent: number;\n capHeight: number;\n xHeight: number;\n lineGap: number;\n}\n\nexport interface FontData {\n fontInfo: FontInfo;\n glyphData: Record<string, GlyphData>;\n}\n\nexport interface CharJson {\n id: string;\n type: 'PATH';\n x: number;\n y: number;\n width: number;\n height: number;\n offsetX: number;\n offsetY: number;\n graphicX: number;\n graphicY: number;\n dPath: string;\n fillRule: 'nonzero';\n isFill: boolean;\n}\n\nexport interface TextLayoutResult {\n fontData: FontData;\n charJSONs: CharJson[];\n /** New display x/y (== charJSONs[0]'s box top-left), only present if text is non-empty. */\n x: number | null;\n y: number | null;\n width: number;\n height: number;\n}\n\nlet cachedDefaultFont: opentype.Font | null = null;\n\nfunction base64ToArrayBuffer(base64: string): ArrayBuffer {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes.buffer;\n}\n\n/** Loads and parses a font file (TTF/OTF/WOFF) for glyph extraction. */\nexport function loadFont(buffer: ArrayBuffer): opentype.Font {\n return opentype.parse(buffer);\n}\n\n/** The bundled fallback font (Arimo, metric-compatible with Arial, Apache-2.0). */\nexport function loadDefaultFont(): opentype.Font {\n if (!cachedDefaultFont) {\n cachedDefaultFont = loadFont(base64ToArrayBuffer(ARIMO_REGULAR_WOFF_BASE64));\n }\n return cachedDefaultFont;\n}\n\nfunction scaleFor(font: opentype.Font): number {\n return MM_PER_EM / font.unitsPerEm;\n}\n\nfunction fontInfoFor(font: opentype.Font): FontInfo {\n const scale = scaleFor(font);\n const os2 = font.tables['os2'] as { sCapHeight?: number; sxHeight?: number } | undefined;\n const capHeight = os2?.sCapHeight ?? Math.round(font.unitsPerEm * 0.7);\n const xHeight = os2?.sxHeight ?? Math.round(font.unitsPerEm * 0.5);\n return {\n unitsPerEm: font.unitsPerEm,\n lineHeight: (font.ascender - font.descender) * scale,\n ascent: font.ascender * scale,\n descent: font.descender * scale,\n capHeight: capHeight * scale,\n xHeight: xHeight * scale,\n lineGap: 0,\n };\n}\n\n/** A glyph with no visible ink (whitespace, or a font with no outline for this character). */\nfunction isEmptyGlyph(glyph: opentype.Glyph): boolean {\n const path = glyph.path;\n return !path || path.commands.length === 0;\n}\n\nfunction pathToDString(path: opentype.Path, scale: number): string {\n const fmt = (n: number): string => {\n const rounded = Math.round(n * 100) / 100;\n return Number.isInteger(rounded) ? String(rounded) : rounded.toFixed(2);\n };\n // xTool's dPath uses a Y-down convention; opentype.js paths are Y-up\n // (baseline at 0, ascenders positive), so Y is negated here.\n const parts: string[] = [];\n for (const cmd of path.commands) {\n switch (cmd.type) {\n case 'M':\n parts.push(`M${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`);\n break;\n case 'L':\n parts.push(`L${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`);\n break;\n case 'Q':\n parts.push(\n `Q${fmt(cmd.x1 * scale)} ${fmt(-cmd.y1 * scale)} ${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`\n );\n break;\n case 'C':\n parts.push(\n `C${fmt(cmd.x1 * scale)} ${fmt(-cmd.y1 * scale)} ${fmt(cmd.x2 * scale)} ${fmt(-cmd.y2 * scale)} ${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`\n );\n break;\n case 'Z':\n parts.push('Z');\n break;\n }\n }\n return parts.join('');\n}\n\nfunction bboxFor(path: opentype.Path, scale: number): GlyphBBox {\n const box = path.getBoundingBox();\n return {\n minX: box.x1 * scale,\n minY: box.y1 * scale,\n maxX: box.x2 * scale,\n maxY: box.y2 * scale,\n };\n}\n\nfunction generateUuid(): string {\n if (typeof crypto !== 'undefined' && crypto.randomUUID) {\n return crypto.randomUUID();\n }\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n\n/**\n * Builds glyphData + charJSONs for `text` laid out on a straight\n * horizontal baseline, anchored so the first character's ink\n * bounding-box top-left lands at (originX, originY) -- matching how\n * an xTool Studio TEXT display's own x/y equals charJSONs[0]'s x/y.\n */\nexport function layoutText(\n font: opentype.Font,\n text: string,\n originX: number,\n originY: number\n): TextLayoutResult {\n const scale = scaleFor(font);\n const fontInfo = fontInfoFor(font);\n const glyphData: Record<string, GlyphData> = {};\n const charJSONs: CharJson[] = [];\n\n let graphicX: number | null = null;\n let graphicY = originY;\n let firstBox: GlyphBBox | null = null;\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n for (const char of text) {\n const glyph = font.charToGlyph(char);\n const advanceWidth = (glyph.advanceWidth ?? 0) * scale;\n\n if (!glyphData[char]) {\n // Raw, unscaled path in the font's native Y-up convention\n // (baseline at 0, ascenders positive) -- NOT glyph.getPath(x, y,\n // fontSize), which opentype.js Y-flips for canvas rendering when\n // given explicit coordinates, and would double-flip against our\n // own conversion below.\n const path = glyph.path;\n if (isEmptyGlyph(glyph)) {\n glyphData[char] = {\n dPath: '',\n advanceWidth,\n advanceHeight: fontInfo.lineHeight,\n leftBearing: 0,\n topBearing: 0,\n bbox: { minX: 0, minY: 0, maxX: 0, maxY: 0 },\n };\n } else {\n const bbox = bboxFor(path, scale);\n glyphData[char] = {\n dPath: pathToDString(path, scale),\n advanceWidth,\n advanceHeight: fontInfo.lineHeight,\n leftBearing: (glyph.leftSideBearing ?? 0) * scale,\n topBearing: fontInfo.ascent - bbox.maxY,\n bbox,\n };\n }\n }\n\n const data = glyphData[char];\n const hasInk = data.dPath !== '';\n\n if (graphicX === null) {\n // Anchor the first character (visible or not) at (originX, originY).\n graphicX = hasInk ? originX - data.bbox.minX : originX;\n if (hasInk) graphicY = originY + data.bbox.maxY;\n }\n\n if (hasInk) {\n const x = graphicX + data.bbox.minX;\n const y = graphicY - data.bbox.maxY;\n const width = data.bbox.maxX - data.bbox.minX;\n const height = data.bbox.maxY - data.bbox.minY;\n\n // dPath is glyph-local (relative to the pen origin graphicX/Y),\n // matching the observed xTool convention -- same shape as\n // fontData.glyphData[char].dPath, computed once and cached above.\n charJSONs.push({\n id: generateUuid(),\n type: 'PATH',\n x,\n y,\n width,\n height,\n offsetX: x,\n offsetY: y,\n graphicX,\n graphicY,\n dPath: data.dPath,\n fillRule: 'nonzero',\n isFill: true,\n });\n\n if (!firstBox) firstBox = { minX: x, minY: y, maxX: x + width, maxY: y + height };\n minX = Math.min(minX, x);\n minY = Math.min(minY, y);\n maxX = Math.max(maxX, x + width);\n maxY = Math.max(maxY, y + height);\n }\n\n graphicX += advanceWidth;\n }\n\n return {\n fontData: { fontInfo, glyphData },\n charJSONs,\n x: firstBox ? firstBox.minX : null,\n y: firstBox ? firstBox.minY : null,\n width: Number.isFinite(maxX - minX) ? maxX - minX : 0,\n height: Number.isFinite(maxY - minY) ? maxY - minY : 0,\n };\n}\n","// Arimo Regular (WOFF), subset: Latin.\n// Source: @fontsource/arimo v5.2.8 (https://www.npmjs.com/package/@fontsource/arimo)\n// License: Apache License 2.0 -- see third_party/arimo/LICENSE\n// Used as the default fallback font for real glyph outline extraction\n// when the caller doesn't supply a font file for a TEXT display's\n// fontFamily. Arimo is metric-compatible with Arial.\nexport const ARIMO_REGULAR_WOFF_BASE64 = 'd09GRgABAAAAADnwAA8AAAAAVRwAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABWAAAADMAAABEAvIETUdQT1MAAAGMAAAEngAACH7MJbNcR1NVQgAABiwAAACAAAAAviy6M+pPUy8yAAAGrAAAAFoAAABgePIqZFNUQVQAAAcIAAAA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BPVDQSLBqrTEYC0WEA3ci0+Dgx4XnCKsAGr3ZPpApcAdkkdZPUj2UrNdKc0xipy1pbh8OvuO0MRYIgg0pEq0zOfJC/KgGe9DYNiLZWe3G7w04HErl4l6k6imRurPa/hNpKNjbqr5cZl4zD9Vx5mlifRbvcjxzEEJy6qqqZ55n5gZ5lzJTylvhm9ApDT/8H8WM';\n","import type { XcsProject, XcsVariable } from './types.js';\nimport { loadDefaultFont, loadFont, layoutText } from './glyphs.js';\nimport type * as opentype from 'opentype.js';\n\nconst TOKEN_RE = /\\{\\{([^}]+)\\}\\}/g;\n\nexport function assertXcsFormat(buffer: ArrayBuffer): void {\n let project: unknown;\n try {\n project = JSON.parse(new TextDecoder().decode(buffer));\n } catch (err) {\n throw new Error(`Not a valid .xcs file: ${(err as Error).message}`);\n }\n if (\n typeof project !== 'object' ||\n project === null ||\n !Array.isArray((project as Record<string, unknown>).canvas)\n ) {\n throw new Error('Not a valid .xcs file: missing canvas array.');\n }\n}\n\nexport function readXcsFile(buffer: ArrayBuffer): string {\n return new TextDecoder().decode(buffer);\n}\n\nexport function extractXcsTokens(buffer: ArrayBuffer): string[] {\n const project = JSON.parse(readXcsFile(buffer)) as XcsProject;\n const seen = new Set<string>();\n\n for (const canvas of project.canvas) {\n for (const display of canvas.displays) {\n if (display.type === 'TEXT' && typeof display.text === 'string') {\n for (const match of display.text.matchAll(TOKEN_RE)) {\n seen.add(match[1]);\n }\n }\n }\n }\n\n return Array.from(seen);\n}\n\nfunction resolveFont(\n fontFamily: string | undefined,\n fonts: Record<string, ArrayBuffer> | undefined,\n cache: Map<string, opentype.Font>,\n): opentype.Font {\n const key = fontFamily ?? '';\n const cached = cache.get(key);\n if (cached) return cached;\n\n const suppliedBuffer = fontFamily ? fonts?.[fontFamily] : undefined;\n const font = suppliedBuffer ? loadFont(suppliedBuffer) : loadDefaultFont();\n cache.set(key, font);\n return font;\n}\n\n/**\n * Substitutes `{{token}}` placeholders in TEXT display `text` fields.\n *\n * Whenever a display's text actually changes, its glyph outline data\n * (`charJSONs` / `fontData.glyphData`) is regenerated from a real font\n * so xTool Studio renders the new text correctly instead of showing\n * stale or placeholder glyph shapes (see src/glyphs.ts for the format\n * this was reverse-engineered from, and its documented limitations --\n * notably, curved-text layout is not reproduced).\n *\n * Pass `fonts` to supply real font file bytes keyed by the TEXT\n * display's `style.fontFamily`; displays whose font isn't supplied\n * fall back to a bundled metric-compatible default (Arimo, standing in\n * for Arial). Displays whose text doesn't change are left untouched.\n */\nexport function renderXcsFile(\n buffer: ArrayBuffer,\n variables: XcsVariable[],\n values: Record<string, string>,\n fonts?: Record<string, ArrayBuffer>,\n): Uint8Array {\n const project = JSON.parse(readXcsFile(buffer)) as XcsProject;\n const fontCache = new Map<string, opentype.Font>();\n\n for (const canvas of project.canvas) {\n for (const display of canvas.displays) {\n if (display.type === 'TEXT' && typeof display.text === 'string') {\n const originalText = display.text;\n let text = originalText;\n for (const variable of variables) {\n const replacement = values[variable.token] ?? variable.defaultValue ?? '';\n text = text.replaceAll(`{{${variable.token}}}`, replacement);\n }\n display.text = text;\n\n if (text === originalText) continue;\n\n const style = display.style as { fontFamily?: string } | undefined;\n const font = resolveFont(style?.fontFamily, fonts, fontCache);\n const originX = typeof display.x === 'number' ? display.x : 0;\n const originY = typeof display.y === 'number' ? display.y : 0;\n\n const layout = layoutText(font, text, originX, originY);\n display.fontData = layout.fontData;\n display.charJSONs = layout.charJSONs;\n if (layout.x !== null && layout.y !== null) {\n display.x = layout.x;\n display.y = layout.y;\n display.offsetX = layout.x;\n display.offsetY = layout.y;\n display.width = layout.width;\n display.height = layout.height;\n }\n }\n }\n }\n\n return new TextEncoder().encode(JSON.stringify(project));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIA,sBAAqB;;;ACEd,IAAM,4BAA4B;;;ADwCzC,IAAM,YAAY;AA2DlB,IA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W,YAAY,WAAW;AAChC,gBAAM,cAAc,OAAO,SAAS,KAAK,KAAK,SAAS,gBAAgB;AACvE,iBAAO,KAAK,WAAW,KAAK,SAAS,KAAK,MAAM,WAAW;AAAA,QAC7D;AACA,gBAAQ,OAAO;AAEf,YAAI,SAAS,aAAc;AAE3B,cAAM,QAAQ,QAAQ;AACtB,cAAM,OAAO,YAAY,OAAO,YAAY,OAAO,SAAS;AAC5D,cAAM,UAAU,OAAO,QAAQ,MAAM,WAAW,QAAQ,IAAI;AAC5D,cAAM,UAAU,OAAO,QAAQ,MAAM,WAAW,QAAQ,IAAI;AAE5D,cAAM,SAAS,WAAW,MAAM,MAAM,SAAS,OAAO;AACtD,gBAAQ,WAAW,OAAO;AAC1B,gBAAQ,YAAY,OAAO;AAC3B,YAAI,OAAO,MAAM,QAAQ,OAAO,MAAM,MAAM;AAC1C,kBAAQ,IAAI,OAAO;AACnB,kBAAQ,IAAI,OAAO;AACnB,kBAAQ,UAAU,OAAO;AACzB,kBAAQ,UAAU,OAAO;AACzB,kBAAQ,QAAQ,OAAO;AACvB,kBAAQ,SAAS,OAAO;AAAA,QAC1B;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO,IAAI,YAAY,EAAE,OAAO,KAAK,UAAU,OAAO,CAAC;AACzD;","names":["opentype"]}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/glyphs.ts","../src/assets/arimo-regular.ts","../src/xcs.ts"],"sourcesContent":["// opentype.js is a CJS-only UMD build with no \"exports\" map, so under\r\n// native ESM only the default import is reliably populated -- a\r\n// namespace import (`import * as opentype`) leaves named properties\r\n// like `.parse` undefined at runtime in built ESM output.\r\nimport opentype from 'opentype.js';\r\nimport { ARIMO_REGULAR_WOFF_BASE64 } from './assets/arimo-regular.js';\r\n\r\n/**\r\n * Real glyph outline extraction for XCS TEXT displays, replacing the\r\n * placeholder-square glyphs that a naive generator (or an .xcs file\r\n * whose TEXT display has an empty `charJSONs`) would otherwise produce.\r\n *\r\n * xTool Studio's on-disk format was reverse-engineered by diffing a\r\n * generated .xcs file against the same file re-saved by xTool Studio,\r\n * both unchanged and after manually re-selecting the font (see this\r\n * repo's CLAUDE.md \"Open Issues\" for the full writeup). Key findings\r\n * baked into the math below:\r\n *\r\n * - `charJSONs` (not `fontData.glyphData`) is what actually renders on\r\n * canvas -- one PATH-shaped entry per non-whitespace character.\r\n * - Font design coordinates are always scaled so that 1 em == 25.4mm\r\n * (1 inch), independent of the `style.fontSize` value written\r\n * alongside it (empirically confirmed against real Arial metrics).\r\n * - `fontData.glyphData[char].bbox` / `advanceWidth` / `leftBearing`\r\n * use the font's native Y-up convention. `charJSONs[i].dPath` uses a\r\n * Y-down convention (flip Y) and is expressed in glyph-local\r\n * coordinates relative to that character's own pen/baseline origin\r\n * (`graphicX`/`graphicY`), i.e. dPath is NOT pre-translated to the\r\n * character's absolute canvas position.\r\n * - `charJSONs[i].x/y` is the character's ink bounding-box top-left in\r\n * absolute canvas coordinates: x = graphicX + bbox.minX,\r\n * y = graphicY - bbox.maxY. width/height are the ink bbox extents.\r\n * - A TEXT display's own `x`/`y` equals the FIRST character's box\r\n * top-left (x[0]/y[0]) -- i.e. it is not a separate anchor to\r\n * recompute, it doubles as charJSONs[0]'s position.\r\n *\r\n * Known limitation: this only replicates STRAIGHT horizontal-baseline\r\n * layout (constant graphicY, cumulative graphicX via advance widths).\r\n * xTool Studio's `style.curveX`/`curveY` curved-text layout formula is\r\n * undocumented and was not reverse-engineerable with confidence from\r\n * available samples, so curved text is not reproduced -- substituted\r\n * text on a curved TEXT display will render with real glyph shapes,\r\n * correctly shaped, but laid out on a straight baseline instead of\r\n * the original curve.\r\n */\r\n\r\nconst MM_PER_EM = 25.4;\r\n\r\nexport interface GlyphBBox {\r\n minX: number;\r\n minY: number;\r\n maxX: number;\r\n maxY: number;\r\n}\r\n\r\nexport interface GlyphData {\r\n dPath: string;\r\n advanceWidth: number;\r\n advanceHeight: number;\r\n leftBearing: number;\r\n topBearing: number;\r\n bbox: GlyphBBox;\r\n}\r\n\r\nexport interface FontInfo {\r\n unitsPerEm: number;\r\n lineHeight: number;\r\n ascent: number;\r\n descent: number;\r\n capHeight: number;\r\n xHeight: number;\r\n lineGap: number;\r\n}\r\n\r\nexport interface FontData {\r\n fontInfo: FontInfo;\r\n glyphData: Record<string, GlyphData>;\r\n}\r\n\r\nexport interface CharJson {\r\n id: string;\r\n type: 'PATH';\r\n x: number;\r\n y: number;\r\n width: number;\r\n height: number;\r\n offsetX: number;\r\n offsetY: number;\r\n graphicX: number;\r\n graphicY: number;\r\n dPath: string;\r\n fillRule: 'nonzero';\r\n isFill: boolean;\r\n}\r\n\r\nexport interface TextLayoutResult {\r\n fontData: FontData;\r\n charJSONs: CharJson[];\r\n /** New display x/y (== charJSONs[0]'s box top-left), only present if text is non-empty. */\r\n x: number | null;\r\n y: number | null;\r\n width: number;\r\n height: number;\r\n}\r\n\r\nlet cachedDefaultFont: opentype.Font | null = null;\r\n\r\nfunction base64ToArrayBuffer(base64: string): ArrayBuffer {\r\n const binary = atob(base64);\r\n const bytes = new Uint8Array(binary.length);\r\n for (let i = 0; i < binary.length; i++) {\r\n bytes[i] = binary.charCodeAt(i);\r\n }\r\n return bytes.buffer;\r\n}\r\n\r\n/** Loads and parses a font file (TTF/OTF/WOFF) for glyph extraction. */\r\nexport function loadFont(buffer: ArrayBuffer): opentype.Font {\r\n return opentype.parse(buffer);\r\n}\r\n\r\n/** The bundled fallback font (Arimo, metric-compatible with Arial, Apache-2.0). */\r\nexport function loadDefaultFont(): opentype.Font {\r\n if (!cachedDefaultFont) {\r\n cachedDefaultFont = loadFont(base64ToArrayBuffer(ARIMO_REGULAR_WOFF_BASE64));\r\n }\r\n return cachedDefaultFont;\r\n}\r\n\r\nfunction scaleFor(font: opentype.Font): number {\r\n return MM_PER_EM / font.unitsPerEm;\r\n}\r\n\r\nfunction fontInfoFor(font: opentype.Font): FontInfo {\r\n const scale = scaleFor(font);\r\n const os2 = font.tables['os2'] as { sCapHeight?: number; sxHeight?: number } | undefined;\r\n const capHeight = os2?.sCapHeight ?? Math.round(font.unitsPerEm * 0.7);\r\n const xHeight = os2?.sxHeight ?? Math.round(font.unitsPerEm * 0.5);\r\n return {\r\n unitsPerEm: font.unitsPerEm,\r\n lineHeight: (font.ascender - font.descender) * scale,\r\n ascent: font.ascender * scale,\r\n descent: font.descender * scale,\r\n capHeight: capHeight * scale,\r\n xHeight: xHeight * scale,\r\n lineGap: 0,\r\n };\r\n}\r\n\r\n/** A glyph with no visible ink (whitespace, or a font with no outline for this character). */\r\nfunction isEmptyGlyph(glyph: opentype.Glyph): boolean {\r\n const path = glyph.path;\r\n return !path || path.commands.length === 0;\r\n}\r\n\r\nfunction pathToDString(path: opentype.Path, scale: number): string {\r\n const fmt = (n: number): string => {\r\n const rounded = Math.round(n * 100) / 100;\r\n return Number.isInteger(rounded) ? String(rounded) : rounded.toFixed(2);\r\n };\r\n // xTool's dPath uses a Y-down convention; opentype.js paths are Y-up\r\n // (baseline at 0, ascenders positive), so Y is negated here.\r\n const parts: string[] = [];\r\n for (const cmd of path.commands) {\r\n switch (cmd.type) {\r\n case 'M':\r\n parts.push(`M${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`);\r\n break;\r\n case 'L':\r\n parts.push(`L${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`);\r\n break;\r\n case 'Q':\r\n parts.push(\r\n `Q${fmt(cmd.x1 * scale)} ${fmt(-cmd.y1 * scale)} ${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`\r\n );\r\n break;\r\n case 'C':\r\n parts.push(\r\n `C${fmt(cmd.x1 * scale)} ${fmt(-cmd.y1 * scale)} ${fmt(cmd.x2 * scale)} ${fmt(-cmd.y2 * scale)} ${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`\r\n );\r\n break;\r\n case 'Z':\r\n parts.push('Z');\r\n break;\r\n }\r\n }\r\n return parts.join('');\r\n}\r\n\r\nfunction bboxFor(path: opentype.Path, scale: number): GlyphBBox {\r\n const box = path.getBoundingBox();\r\n return {\r\n minX: box.x1 * scale,\r\n minY: box.y1 * scale,\r\n maxX: box.x2 * scale,\r\n maxY: box.y2 * scale,\r\n };\r\n}\r\n\r\nfunction generateUuid(): string {\r\n if (typeof crypto !== 'undefined' && crypto.randomUUID) {\r\n return crypto.randomUUID();\r\n }\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\r\n const r = (Math.random() * 16) | 0;\r\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\r\n return v.toString(16);\r\n });\r\n}\r\n\r\n/**\r\n * Builds glyphData + charJSONs for `text` laid out on a straight\r\n * horizontal baseline, anchored so the first character's ink\r\n * bounding-box top-left lands at (originX, originY) -- matching how\r\n * an xTool Studio TEXT display's own x/y equals charJSONs[0]'s x/y.\r\n */\r\nexport function layoutText(\r\n font: opentype.Font,\r\n text: string,\r\n originX: number,\r\n originY: number\r\n): TextLayoutResult {\r\n const scale = scaleFor(font);\r\n const fontInfo = fontInfoFor(font);\r\n const glyphData: Record<string, GlyphData> = {};\r\n const charJSONs: CharJson[] = [];\r\n\r\n let graphicX: number | null = null;\r\n let graphicY = originY;\r\n let firstBox: GlyphBBox | null = null;\r\n let minX = Infinity;\r\n let minY = Infinity;\r\n let maxX = -Infinity;\r\n let maxY = -Infinity;\r\n\r\n for (const char of text) {\r\n const glyph = font.charToGlyph(char);\r\n const advanceWidth = (glyph.advanceWidth ?? 0) * scale;\r\n\r\n if (!glyphData[char]) {\r\n // Raw, unscaled path in the font's native Y-up convention\r\n // (baseline at 0, ascenders positive) -- NOT glyph.getPath(x, y,\r\n // fontSize), which opentype.js Y-flips for canvas rendering when\r\n // given explicit coordinates, and would double-flip against our\r\n // own conversion below.\r\n const path = glyph.path;\r\n if (isEmptyGlyph(glyph)) {\r\n glyphData[char] = {\r\n dPath: '',\r\n advanceWidth,\r\n advanceHeight: fontInfo.lineHeight,\r\n leftBearing: 0,\r\n topBearing: 0,\r\n bbox: { minX: 0, minY: 0, maxX: 0, maxY: 0 },\r\n };\r\n } else {\r\n const bbox = bboxFor(path, scale);\r\n glyphData[char] = {\r\n dPath: pathToDString(path, scale),\r\n advanceWidth,\r\n advanceHeight: fontInfo.lineHeight,\r\n leftBearing: (glyph.leftSideBearing ?? 0) * scale,\r\n topBearing: fontInfo.ascent - bbox.maxY,\r\n bbox,\r\n };\r\n }\r\n }\r\n\r\n const data = glyphData[char];\r\n const hasInk = data.dPath !== '';\r\n\r\n if (graphicX === null) {\r\n // Anchor the first character (visible or not) at (originX, originY).\r\n graphicX = hasInk ? originX - data.bbox.minX : originX;\r\n if (hasInk) graphicY = originY + data.bbox.maxY;\r\n }\r\n\r\n if (hasInk) {\r\n const x = graphicX + data.bbox.minX;\r\n const y = graphicY - data.bbox.maxY;\r\n const width = data.bbox.maxX - data.bbox.minX;\r\n const height = data.bbox.maxY - data.bbox.minY;\r\n\r\n // dPath is glyph-local (relative to the pen origin graphicX/Y),\r\n // matching the observed xTool convention -- same shape as\r\n // fontData.glyphData[char].dPath, computed once and cached above.\r\n charJSONs.push({\r\n id: generateUuid(),\r\n type: 'PATH',\r\n x,\r\n y,\r\n width,\r\n height,\r\n offsetX: x,\r\n offsetY: y,\r\n graphicX,\r\n graphicY,\r\n dPath: data.dPath,\r\n fillRule: 'nonzero',\r\n isFill: true,\r\n });\r\n\r\n if (!firstBox) firstBox = { minX: x, minY: y, maxX: x + width, maxY: y + height };\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x + width);\r\n maxY = Math.max(maxY, y + height);\r\n }\r\n\r\n graphicX += advanceWidth;\r\n }\r\n\r\n return {\r\n fontData: { fontInfo, glyphData },\r\n charJSONs,\r\n x: firstBox ? firstBox.minX : null,\r\n y: firstBox ? firstBox.minY : null,\r\n width: Number.isFinite(maxX - minX) ? maxX - minX : 0,\r\n height: Number.isFinite(maxY - minY) ? maxY - minY : 0,\r\n };\r\n}\r\n","// Arimo Regular (WOFF), subset: Latin.\r\n// Source: @fontsource/arimo v5.2.8 (https://www.npmjs.com/package/@fontsource/arimo)\r\n// License: Apache License 2.0 -- see third_party/arimo/LICENSE\r\n// Used as the default fallback font for real glyph outline extraction\r\n// when the caller doesn't supply a font file for a TEXT display's\r\n// fontFamily. Arimo is metric-compatible with Arial.\r\nexport const ARIMO_REGULAR_WOFF_BASE64 = 'd09GRgABAAAAADnwAA8AAAAAVRwAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABWAAAADMAAABEAvIETUdQT1MAAAGMAAAEngAACH7MJbNcR1NVQgAABiwAAACAAAAAviy6M+pPUy8yAAAGrAAAAFoAAABgePIqZFNUQVQAAAcIAAAAPAAAAEjnbMwYY21hcAAAB0QAAAFtAAACEKO9RodnYXNwAAAItAAAAAgAAAAIAAAAEGdseWYAAAi8AAApswAAPGblIOkQaGVhZAAAMnAAAAA2AAAANicFebdoaGVhAAAyqAAAAB8AAAAkGgkQbWhtdHgAADLIAAACFAAAA8jIW0CTbG9jYQAANNwAAAHUAAAB5ut+3ENtYXhwAAA2sAAAABwAAAAgAVABtG5hbWUAADbMAAABDQAAAhwtCFW8cG9zdAAAN9wAAAIUAAADK2Zjocp42j3KxQGEQBAEwFr53QVC2kSGaxI4jLYJKMBfUPuJItdNfCjKKK9MI+kMktkq7YPLB0AAeNplVAOUJEsQjKrs6d2zbdv2Ys727L6z8W3btm3bNs62bVv9I3P5/r1+ERkVlaiuARyAgrgIsyATr73sAvSYetnkmWh7wfgrLkJplIXrn9qrOjMQRRAAHrFs7RAgJJCzJkLWuKFD0nIqPGD5qhx3k2ZOvuwiDDMecOH4y2aih3FKNs+8cCZaGze2Wd5mBhZNw/EBtUUDV8ZB7BnMQhonh6I7yUR9Pg5VURieCKlx9gTc2aHnRtFBrC1RG456K3Yh9Dl1l/BxaG81dVEdFfleRfmwPgzgouJJT8Cdm6Xs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amnr6OrpGxgaGZuYmplbWFpZ29ja2Ts4Ojm7uLq5e3h6/QiCB8MGAAAAYDlsq23btt3nm/jzLyAoJCwiKiYuISklLSMrJ6+gqKSsoqqmrqGppa2jq6dvYGhkbGJqZm5haWVtY2tn7+Do5Ozi6ubu4enl7ePrRxA8bEUAAAAAnK3PzrZxyrZtmy/zXGufd6ZQkWIlSpWpUKlKtRq16tRr0KhJs1ZtOnQH8vTqM2DQkGEjJk2ZNmvOvAWLlixbsWrNug1bdgL59uw7cerchUtXrt24defeg0dPnr149ebdhx+//vwLCgmLiIqJS0hKScvI5giCCxqGAQAAYG/yMTOTfw3zttZfIBSJJb9XKpMrlCq1RqvTG4wms8VqszucLrfnq2kMlhCEYSB60BE76q8wiB70qtr/KG3UammYtAE/X1rw9DabzWbR8n55Z0KBPVDQSLBqrTEYC0WEA3ci0+Dgx4XnCKsAGr3ZPpApcAdkkdZPUj2UrNdKc0xipy1pbh8OvuO0MRYIgg0pEq0zOfJC/KgGe9DYNiLZWe3G7w04HErl4l6k6imRurPa/hNpKNjbqr5cZl4zD9Vx5mlifRbvcjxzEEJy6qqqZ55n5gZ5lzJTylvhm9ApDT/8H8WM';\r\n","import type { XcsProject, XcsVariable } from './types.js';\r\nimport { loadDefaultFont, loadFont, layoutText } from './glyphs.js';\r\nimport type * as opentype from 'opentype.js';\r\n\r\nconst TOKEN_RE = /\\{\\{([^}]+)\\}\\}/g;\r\n\r\nexport function assertXcsFormat(buffer: ArrayBuffer): void {\r\n let project: unknown;\r\n try {\r\n project = JSON.parse(new TextDecoder().decode(buffer));\r\n } catch (err) {\r\n throw new Error(`Not a valid .xcs file: ${(err as Error).message}`);\r\n }\r\n if (\r\n typeof project !== 'object' ||\r\n project === null ||\r\n !Array.isArray((project as Record<string, unknown>).canvas)\r\n ) {\r\n throw new Error('Not a valid .xcs file: missing canvas array.');\r\n }\r\n}\r\n\r\nexport function readXcsFile(buffer: ArrayBuffer): string {\r\n return new TextDecoder().decode(buffer);\r\n}\r\n\r\nexport function extractXcsTokens(buffer: ArrayBuffer): string[] {\r\n const project = JSON.parse(readXcsFile(buffer)) as XcsProject;\r\n const seen = new Set<string>();\r\n\r\n for (const canvas of project.canvas) {\r\n for (const display of canvas.displays) {\r\n if (display.type === 'TEXT' && typeof display.text === 'string') {\r\n for (const match of display.text.matchAll(TOKEN_RE)) {\r\n seen.add(match[1]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return Array.from(seen);\r\n}\r\n\r\nfunction resolveFont(\r\n fontFamily: string | undefined,\r\n fonts: Record<string, ArrayBuffer> | undefined,\r\n cache: Map<string, opentype.Font>,\r\n): opentype.Font {\r\n const key = fontFamily ?? '';\r\n const cached = cache.get(key);\r\n if (cached) return cached;\r\n\r\n const suppliedBuffer = fontFamily ? fonts?.[fontFamily] : undefined;\r\n const font = suppliedBuffer ? loadFont(suppliedBuffer) : loadDefaultFont();\r\n cache.set(key, font);\r\n return font;\r\n}\r\n\r\n/**\r\n * Substitutes `{{token}}` placeholders in TEXT display `text` fields.\r\n *\r\n * Whenever a display's text actually changes, its glyph outline data\r\n * (`charJSONs` / `fontData.glyphData`) is regenerated from a real font\r\n * so xTool Studio renders the new text correctly instead of showing\r\n * stale or placeholder glyph shapes (see src/glyphs.ts for the format\r\n * this was reverse-engineered from, and its documented limitations --\r\n * notably, curved-text layout is not reproduced).\r\n *\r\n * Pass `fonts` to supply real font file bytes keyed by the TEXT\r\n * display's `style.fontFamily`; displays whose font isn't supplied\r\n * fall back to a bundled metric-compatible default (Arimo, standing in\r\n * for Arial). Displays whose text doesn't change are left untouched.\r\n */\r\nexport function renderXcsFile(\r\n buffer: ArrayBuffer,\r\n variables: XcsVariable[],\r\n values: Record<string, string>,\r\n fonts?: Record<string, ArrayBuffer>,\r\n): Uint8Array {\r\n const project = JSON.parse(readXcsFile(buffer)) as XcsProject;\r\n const fontCache = new Map<string, opentype.Font>();\r\n\r\n for (const canvas of project.canvas) {\r\n for (const display of canvas.displays) {\r\n if (display.type === 'TEXT' && typeof display.text === 'string') {\r\n const originalText = display.text;\r\n let text = originalText;\r\n for (const variable of variables) {\r\n const replacement = values[variable.token] ?? variable.defaultValue ?? '';\r\n text = text.replaceAll(`{{${variable.token}}}`, replacement);\r\n }\r\n display.text = text;\r\n\r\n if (text === originalText) continue;\r\n\r\n const style = display.style as { fontFamily?: string } | undefined;\r\n const font = resolveFont(style?.fontFamily, fonts, fontCache);\r\n const originX = typeof display.x === 'number' ? display.x : 0;\r\n const originY = typeof display.y === 'number' ? display.y : 0;\r\n\r\n const layout = layoutText(font, text, originX, originY);\r\n display.fontData = layout.fontData;\r\n display.charJSONs = layout.charJSONs;\r\n if (layout.x !== null && layout.y !== null) {\r\n display.x = layout.x;\r\n display.y = layout.y;\r\n display.offsetX = layout.x;\r\n display.offsetY = layout.y;\r\n display.width = layout.width;\r\n display.height = layout.height;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return new TextEncoder().encode(JSON.stringify(project));\r\n}\r\n"],"mappings":";AAIA,OAAO,cAAc;;;ACEd,IAAM,4BAA4B;;;ADwCzC,IAAM,YAAY;AA2DlB,IAAI,oBAA0C;AAE9C,SAAS,oBAAoB,QAA6B;AACxD,QAAM,SAAS,KAAK,MAAM;AAC1B,QAAM,QAAQ,IAAI,WAAW,OAAO,MAAM;AAC1C,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,UAAM,CAAC,IAAI,OAAO,WAAW,CAAC;AAAA,EAChC;AACA,SAAO,MAAM;AACf;AAGO,SAAS,SAAS,QAAoC;AAC3D,SAAO,SAAS,MAAM,MAAM;AAC9B;AAGO,SAAS,kBAAiC;AAC/C,MAAI,CAAC,mBAAmB;AACtB,wBAAoB,SAAS,oBAAoB,yBAAyB,CAAC;AAAA,EAC7E;AACA,SAAO;AACT;AAEA,SAAS,SAAS,MAA6B;AAC7C,SAAO,YAAY,KAAK;AAC1B;AAEA,SAAS,YAAY,MAA+B;AAClD,QAAM,QAAQ,SAAS,IAAI;AAC3B,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;AACnB,kBAAQ,IAAI,OAAO;AACnB,kBAAQ,UAAU,OAAO;AACzB,kBAAQ,UAAU,OAAO;AACzB,kBAAQ,QAAQ,OAAO;AACvB,kBAAQ,SAAS,OAAO;AAAA,QAC1B;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO,IAAI,YAAY,EAAE,OAAO,KAAK,UAAU,OAAO,CAAC;AACzD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/glyphs.ts","../src/assets/arimo-regular.ts","../src/xcs.ts"],"sourcesContent":["// opentype.js is a CJS-only UMD build with no \"exports\" map, so under\n// native ESM only the default import is reliably populated -- a\n// namespace import (`import * as opentype`) leaves named properties\n// like `.parse` undefined at runtime in built ESM output.\nimport opentype from 'opentype.js';\nimport { ARIMO_REGULAR_WOFF_BASE64 } from './assets/arimo-regular.js';\n\n/**\n * Real glyph outline extraction for XCS TEXT displays, replacing the\n * placeholder-square glyphs that a naive generator (or an .xcs file\n * whose TEXT display has an empty `charJSONs`) would otherwise produce.\n *\n * xTool Studio's on-disk format was reverse-engineered by diffing a\n * generated .xcs file against the same file re-saved by xTool Studio,\n * both unchanged and after manually re-selecting the font (see this\n * repo's CLAUDE.md \"Open Issues\" for the full writeup). Key findings\n * baked into the math below:\n *\n * - `charJSONs` (not `fontData.glyphData`) is what actually renders on\n * canvas -- one PATH-shaped entry per non-whitespace character.\n * - Font design coordinates are always scaled so that 1 em == 25.4mm\n * (1 inch), independent of the `style.fontSize` value written\n * alongside it (empirically confirmed against real Arial metrics).\n * - `fontData.glyphData[char].bbox` / `advanceWidth` / `leftBearing`\n * use the font's native Y-up convention. `charJSONs[i].dPath` uses a\n * Y-down convention (flip Y) and is expressed in glyph-local\n * coordinates relative to that character's own pen/baseline origin\n * (`graphicX`/`graphicY`), i.e. dPath is NOT pre-translated to the\n * character's absolute canvas position.\n * - `charJSONs[i].x/y` is the character's ink bounding-box top-left in\n * absolute canvas coordinates: x = graphicX + bbox.minX,\n * y = graphicY - bbox.maxY. width/height are the ink bbox extents.\n * - A TEXT display's own `x`/`y` equals the FIRST character's box\n * top-left (x[0]/y[0]) -- i.e. it is not a separate anchor to\n * recompute, it doubles as charJSONs[0]'s position.\n *\n * Known limitation: this only replicates STRAIGHT horizontal-baseline\n * layout (constant graphicY, cumulative graphicX via advance widths).\n * xTool Studio's `style.curveX`/`curveY` curved-text layout formula is\n * undocumented and was not reverse-engineerable with confidence from\n * available samples, so curved text is not reproduced -- substituted\n * text on a curved TEXT display will render with real glyph shapes,\n * correctly shaped, but laid out on a straight baseline instead of\n * the original curve.\n */\n\nconst MM_PER_EM = 25.4;\n\nexport interface GlyphBBox {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n}\n\nexport interface GlyphData {\n dPath: string;\n advanceWidth: number;\n advanceHeight: number;\n leftBearing: number;\n topBearing: number;\n bbox: GlyphBBox;\n}\n\nexport interface FontInfo {\n unitsPerEm: number;\n lineHeight: number;\n ascent: number;\n descent: number;\n capHeight: number;\n xHeight: number;\n lineGap: number;\n}\n\nexport interface FontData {\n fontInfo: FontInfo;\n glyphData: Record<string, GlyphData>;\n}\n\nexport interface CharJson {\n id: string;\n type: 'PATH';\n x: number;\n y: number;\n width: number;\n height: number;\n offsetX: number;\n offsetY: number;\n graphicX: number;\n graphicY: number;\n dPath: string;\n fillRule: 'nonzero';\n isFill: boolean;\n}\n\nexport interface TextLayoutResult {\n fontData: FontData;\n charJSONs: CharJson[];\n /** New display x/y (== charJSONs[0]'s box top-left), only present if text is non-empty. */\n x: number | null;\n y: number | null;\n width: number;\n height: number;\n}\n\nlet cachedDefaultFont: opentype.Font | null = null;\n\nfunction base64ToArrayBuffer(base64: string): ArrayBuffer {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes.buffer;\n}\n\n/** Loads and parses a font file (TTF/OTF/WOFF) for glyph extraction. */\nexport function loadFont(buffer: ArrayBuffer): opentype.Font {\n return opentype.parse(buffer);\n}\n\n/** The bundled fallback font (Arimo, metric-compatible with Arial, Apache-2.0). */\nexport function loadDefaultFont(): opentype.Font {\n if (!cachedDefaultFont) {\n cachedDefaultFont = loadFont(base64ToArrayBuffer(ARIMO_REGULAR_WOFF_BASE64));\n }\n return cachedDefaultFont;\n}\n\nfunction scaleFor(font: opentype.Font): number {\n return MM_PER_EM / font.unitsPerEm;\n}\n\nfunction fontInfoFor(font: opentype.Font): FontInfo {\n const scale = scaleFor(font);\n const os2 = font.tables['os2'] as { sCapHeight?: number; sxHeight?: number } | undefined;\n const capHeight = os2?.sCapHeight ?? Math.round(font.unitsPerEm * 0.7);\n const xHeight = os2?.sxHeight ?? Math.round(font.unitsPerEm * 0.5);\n return {\n unitsPerEm: font.unitsPerEm,\n lineHeight: (font.ascender - font.descender) * scale,\n ascent: font.ascender * scale,\n descent: font.descender * scale,\n capHeight: capHeight * scale,\n xHeight: xHeight * scale,\n lineGap: 0,\n };\n}\n\n/** A glyph with no visible ink (whitespace, or a font with no outline for this character). */\nfunction isEmptyGlyph(glyph: opentype.Glyph): boolean {\n const path = glyph.path;\n return !path || path.commands.length === 0;\n}\n\nfunction pathToDString(path: opentype.Path, scale: number): string {\n const fmt = (n: number): string => {\n const rounded = Math.round(n * 100) / 100;\n return Number.isInteger(rounded) ? String(rounded) : rounded.toFixed(2);\n };\n // xTool's dPath uses a Y-down convention; opentype.js paths are Y-up\n // (baseline at 0, ascenders positive), so Y is negated here.\n const parts: string[] = [];\n for (const cmd of path.commands) {\n switch (cmd.type) {\n case 'M':\n parts.push(`M${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`);\n break;\n case 'L':\n parts.push(`L${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`);\n break;\n case 'Q':\n parts.push(\n `Q${fmt(cmd.x1 * scale)} ${fmt(-cmd.y1 * scale)} ${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`\n );\n break;\n case 'C':\n parts.push(\n `C${fmt(cmd.x1 * scale)} ${fmt(-cmd.y1 * scale)} ${fmt(cmd.x2 * scale)} ${fmt(-cmd.y2 * scale)} ${fmt(cmd.x * scale)} ${fmt(-cmd.y * scale)}`\n );\n break;\n case 'Z':\n parts.push('Z');\n break;\n }\n }\n return parts.join('');\n}\n\nfunction bboxFor(path: opentype.Path, scale: number): GlyphBBox {\n const box = path.getBoundingBox();\n return {\n minX: box.x1 * scale,\n minY: box.y1 * scale,\n maxX: box.x2 * scale,\n maxY: box.y2 * scale,\n };\n}\n\nfunction generateUuid(): string {\n if (typeof crypto !== 'undefined' && crypto.randomUUID) {\n return crypto.randomUUID();\n }\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n\n/**\n * Builds glyphData + charJSONs for `text` laid out on a straight\n * horizontal baseline, anchored so the first character's ink\n * bounding-box top-left lands at (originX, originY) -- matching how\n * an xTool Studio TEXT display's own x/y equals charJSONs[0]'s x/y.\n */\nexport function layoutText(\n font: opentype.Font,\n text: string,\n originX: number,\n originY: number\n): TextLayoutResult {\n const scale = scaleFor(font);\n const fontInfo = fontInfoFor(font);\n const glyphData: Record<string, GlyphData> = {};\n const charJSONs: CharJson[] = [];\n\n let graphicX: number | null = null;\n let graphicY = originY;\n let firstBox: GlyphBBox | null = null;\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n for (const char of text) {\n const glyph = font.charToGlyph(char);\n const advanceWidth = (glyph.advanceWidth ?? 0) * scale;\n\n if (!glyphData[char]) {\n // Raw, unscaled path in the font's native Y-up convention\n // (baseline at 0, ascenders positive) -- NOT glyph.getPath(x, y,\n // fontSize), which opentype.js Y-flips for canvas rendering when\n // given explicit coordinates, and would double-flip against our\n // own conversion below.\n const path = glyph.path;\n if (isEmptyGlyph(glyph)) {\n glyphData[char] = {\n dPath: '',\n advanceWidth,\n advanceHeight: fontInfo.lineHeight,\n leftBearing: 0,\n topBearing: 0,\n bbox: { minX: 0, minY: 0, maxX: 0, maxY: 0 },\n };\n } else {\n const bbox = bboxFor(path, scale);\n glyphData[char] = {\n dPath: pathToDString(path, scale),\n advanceWidth,\n advanceHeight: fontInfo.lineHeight,\n leftBearing: (glyph.leftSideBearing ?? 0) * scale,\n topBearing: fontInfo.ascent - bbox.maxY,\n bbox,\n };\n }\n }\n\n const data = glyphData[char];\n const hasInk = data.dPath !== '';\n\n if (graphicX === null) {\n // Anchor the first character (visible or not) at (originX, originY).\n graphicX = hasInk ? originX - data.bbox.minX : originX;\n if (hasInk) graphicY = originY + data.bbox.maxY;\n }\n\n if (hasInk) {\n const x = graphicX + data.bbox.minX;\n const y = graphicY - data.bbox.maxY;\n const width = data.bbox.maxX - data.bbox.minX;\n const height = data.bbox.maxY - data.bbox.minY;\n\n // dPath is glyph-local (relative to the pen origin graphicX/Y),\n // matching the observed xTool convention -- same shape as\n // fontData.glyphData[char].dPath, computed once and cached above.\n charJSONs.push({\n id: generateUuid(),\n type: 'PATH',\n x,\n y,\n width,\n height,\n offsetX: x,\n offsetY: y,\n graphicX,\n graphicY,\n dPath: data.dPath,\n fillRule: 'nonzero',\n isFill: true,\n });\n\n if (!firstBox) firstBox = { minX: x, minY: y, maxX: x + width, maxY: y + height };\n minX = Math.min(minX, x);\n minY = Math.min(minY, y);\n maxX = Math.max(maxX, x + width);\n maxY = Math.max(maxY, y + height);\n }\n\n graphicX += advanceWidth;\n }\n\n return {\n fontData: { fontInfo, glyphData },\n charJSONs,\n x: firstBox ? firstBox.minX : null,\n y: firstBox ? firstBox.minY : null,\n width: Number.isFinite(maxX - minX) ? maxX - minX : 0,\n height: Number.isFinite(maxY - minY) ? maxY - minY : 0,\n };\n}\n","// Arimo Regular (WOFF), subset: Latin.\n// Source: @fontsource/arimo v5.2.8 (https://www.npmjs.com/package/@fontsource/arimo)\n// License: Apache License 2.0 -- see third_party/arimo/LICENSE\n// Used as the default fallback font for real glyph outline extraction\n// when the caller doesn't supply a font file for a TEXT display's\n// fontFamily. Arimo is metric-compatible with Arial.\nexport const ARIMO_REGULAR_WOFF_BASE64 = 'd09GRgABAAAAADnwAA8AAAAAVRwAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABWAAAADMAAABEAvIETUdQT1MAAAGMAAAEngAACH7MJbNcR1NVQgAABiwAAACAAAAAviy6M+pPUy8yAAAGrAAAAFoAAABgePIqZFNUQVQAAAcIAAAAPAAAAEjnbMwYY21hcAAAB0QAAAFtAAACEKO9RodnYXNwAAAItAAAAAgAAAAIAAAAEGdseWYAAAi8AAApswAAPGblIOkQaGVhZAAAMnAAAAA2AAAANicFebdoaGVhAAAyqAAAAB8AAAAkGgkQbWhtdHgAADLIAAACFAAAA8jIW0CTbG9jYQAANNwAAAHUAAAB5ut+3ENtYXhwAAA2sAAAABwAAAAgAVABtG5hbWUAADbMAAABDQAAAhwtCFW8cG9zdAAAN9wAAAIUAAADK2Zjocp42j3KxQGEQBAEwFr53QVC2kSGaxI4jLYJKMBfUPuJItdNfCjKKK9MI+kMktkq7YPLB0AAeNplVAOUJEsQjKrs6d2zbdv2Ys727L6z8W3btm3bNs62bVv9I3P5/r1+ERkVlaiuARyAgrgIsyATr73sAvSYetnkmWh7wfgrLkJplIXrn9qrOjMQRRAAHrFs7RAgJJCzJkLWuKFD0nIqPGD5qhx3k2ZOvuwiDDMecOH4y2aih3FKNs+8cCZaGze2Wd5mBhZNw/EBtUUDV8ZB7BnMQhonh6I7yUR9Pg5VURieCKlx9gTc2aHnRtFBrC1RG456K3Yh9Dl1l/BxaG81dVEdFfleRfmwPgzgouJJT8Cdm6XsUsIU6nXUIYCWRGOiLlGdqGhgXfAJs/bGDpCXK7s+wQtaF/vJbmYDNmIztmAHdtqd2jmCz4KK8ME4nuOqIDnwckaOyQHZZXGLrDNvhSySOfKX/CLfyRfykXnvyGvygjxlvu4/Ivc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7+Do5Ozi6ubu4enl7ePrRxA8bEUAAAAAnK3PzrZxyrZtmy/zXGufd6ZQkWIlSpWpUKlKtRq16tRr0KhJs1ZtOnQH8vTqM2DQkGEjJk2ZNmvOvAWLlixbsWrNug1bdgL59uw7cerchUtXrt24defeg0dPnr149ebdhx+//vwLCgmLiIqJS0hKScvI5giCCxqGAQAAYG/yMTOTfw3zttZfIBSJJb9XKpMrlCq1RqvTG4wms8VqszucLrfnq2kMlhCEYSB60BE76q8wiB70qtr/KG3UammYtAE/X1rw9DabzWbR8n55Z0KBPVDQSLBqrTEYC0WEA3ci0+Dgx4XnCKsAGr3ZPpApcAdkkdZPUj2UrNdKc0xipy1pbh8OvuO0MRYIgg0pEq0zOfJC/KgGe9DYNiLZWe3G7w04HErl4l6k6imRurPa/hNpKNjbqr5cZl4zD9Vx5mlifRbvcjxzEEJy6qqqZ55n5gZ5lzJTylvhm9ApDT/8H8WM';\n","import type { XcsProject, XcsVariable } from './types.js';\nimport { loadDefaultFont, loadFont, layoutText } from './glyphs.js';\nimport type * as opentype from 'opentype.js';\n\nconst TOKEN_RE = /\\{\\{([^}]+)\\}\\}/g;\n\nexport function assertXcsFormat(buffer: ArrayBuffer): void {\n let project: unknown;\n try {\n project = JSON.parse(new TextDecoder().decode(buffer));\n } catch (err) {\n throw new Error(`Not a valid .xcs file: ${(err as Error).message}`);\n }\n if (\n typeof project !== 'object' ||\n project === null ||\n !Array.isArray((project as Record<string, unknown>).canvas)\n ) {\n throw new Error('Not a valid .xcs file: missing canvas array.');\n }\n}\n\nexport function readXcsFile(buffer: ArrayBuffer): string {\n return new TextDecoder().decode(buffer);\n}\n\nexport function extractXcsTokens(buffer: ArrayBuffer): string[] {\n const project = JSON.parse(readXcsFile(buffer)) as XcsProject;\n const seen = new Set<string>();\n\n for (const canvas of project.canvas) {\n for (const display of canvas.displays) {\n if (display.type === 'TEXT' && typeof display.text === 'string') {\n for (const match of display.text.matchAll(TOKEN_RE)) {\n seen.add(match[1]);\n }\n }\n }\n }\n\n return Array.from(seen);\n}\n\nfunction resolveFont(\n fontFamily: string | undefined,\n fonts: Record<string, ArrayBuffer> | undefined,\n cache: Map<string, opentype.Font>,\n): opentype.Font {\n const key = fontFamily ?? '';\n const cached = cache.get(key);\n if (cached) return cached;\n\n const suppliedBuffer = fontFamily ? fonts?.[fontFamily] : undefined;\n const font = suppliedBuffer ? loadFont(suppliedBuffer) : loadDefaultFont();\n cache.set(key, font);\n return font;\n}\n\n/**\n * Substitutes `{{token}}` placeholders in TEXT display `text` fields.\n *\n * Whenever a display's text actually changes, its glyph outline data\n * (`charJSONs` / `fontData.glyphData`) is regenerated from a real font\n * so xTool Studio renders the new text correctly instead of showing\n * stale or placeholder glyph shapes (see src/glyphs.ts for the format\n * this was reverse-engineered from, and its documented limitations --\n * notably, curved-text layout is not reproduced).\n *\n * Pass `fonts` to supply real font file bytes keyed by the TEXT\n * display's `style.fontFamily`; displays whose font isn't supplied\n * fall back to a bundled metric-compatible default (Arimo, standing in\n * for Arial). Displays whose text doesn't change are left untouched.\n */\nexport function renderXcsFile(\n buffer: ArrayBuffer,\n variables: XcsVariable[],\n values: Record<string, string>,\n fonts?: Record<string, ArrayBuffer>,\n): Uint8Array {\n const project = JSON.parse(readXcsFile(buffer)) as XcsProject;\n const fontCache = new Map<string, opentype.Font>();\n\n for (const canvas of project.canvas) {\n for (const display of canvas.displays) {\n if (display.type === 'TEXT' && typeof display.text === 'string') {\n const originalText = display.text;\n let text = originalText;\n for (const variable of variables) {\n const replacement = values[variable.token] ?? variable.defaultValue ?? '';\n text = text.replaceAll(`{{${variable.token}}}`, replacement);\n }\n display.text = text;\n\n if (text === originalText) continue;\n\n const style = display.style as { fontFamily?: string } | undefined;\n const font = resolveFont(style?.fontFamily, fonts, fontCache);\n const originX = typeof display.x === 'number' ? display.x : 0;\n const originY = typeof display.y === 'number' ? display.y : 0;\n\n const layout = layoutText(font, text, originX, originY);\n display.fontData = layout.fontData;\n display.charJSONs = layout.charJSONs;\n if (layout.x !== null && layout.y !== null) {\n display.x = layout.x;\n display.y = layout.y;\n display.offsetX = layout.x;\n display.offsetY = layout.y;\n display.width = layout.width;\n display.height = layout.height;\n }\n }\n }\n }\n\n return new TextEncoder().encode(JSON.stringify(project));\n}\n"],"mappings":";AAIA,OAAO,cAAc;;;ACEd,IAAM,4BAA4B;;;ADwCzC,IAAM,YAAY;AA2DlB,IAAI,oBAA0C;AAE9C,SAAS,oBAAoB,QAA6B;AACxD,QAAM,SAAS,KAAK,MAAM;AAC1B,QAAM,QAAQ,IAAI,WAAW,OAAO,MAAM;AAC1C,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,UAAM,CAAC,IAAI,OAAO,WAAW,CAAC;AAAA,EAChC;AACA,SAAO,MAAM;AACf;AAGO,SAAS,SAAS,QAAoC;AAC3D,SAAO,SAAS,MAAM,MAAM;AAC9B;AAGO,SAAS,kBAAiC;AAC/C,MAAI,CAAC,mBAAmB;AACtB,wBAAoB,SAAS,oBAAoB,yBAAyB,CAAC;AAAA,EAC7E;AACA,SAAO;AACT;AAEA,SAAS,SAAS,MAA6B;AAC7C,SAAO,YAAY,KAAK;AAC1B;AAEA,SAAS,YAAY,MAA+B;AAClD,QAAM,QAAQ,SAAS,IAAI;AAC3B,QAAM,MAAM,KAAK,OAAO,KAAK;AAC7B,QAAM,YAAY,KAAK,cAAc,KAAK,MAAM,KAAK,aAAa,GAAG;AACrE,QAAM,UAAU,KAAK,YAAY,KAAK,MAAM,KAAK,aAAa,GAAG;AACjE,SAAO;AAAA,IACL,YAAY,KAAK;AAAA,IACjB,aAAa,KAAK,WAAW,KAAK,aAAa;AAAA,IAC/C,QAAQ,KAAK,WAAW;AAAA,IACxB,SAAS,KAAK,YAAY;AAAA,IAC1B,WAAW,YAAY;AAAA,IACvB,SAAS,UAAU;AAAA,IACnB,SAAS;AAAA,EACX;AACF;AAGA,SAAS,aAAa,OAAgC;AACpD,QAAM,OAAO,MAAM;AACnB,SAAO,CAAC,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,MAAM,YAAY,MAAM,CAAC;AAC9C,QAAM,YAAY,oBAAI,IAA2B;AAEjD,aAAW,UAAU,QAAQ,QAAQ;AACnC,eAAW,WAAW,OAAO,UAAU;AACrC,UAAI,QAAQ,SAAS,UAAU,OAAO,QAAQ,SAAS,UAAU;AAC/D,cAAM,eAAe,QAAQ;AAC7B,YAAI,OAAO;AACX,mBAAW,YAAY,WAAW;AAChC,gBAAM,cAAc,OAAO,SAAS,KAAK,KAAK,SAAS,gBAAgB;AACvE,iBAAO,KAAK,WAAW,KAAK,SAAS,KAAK,MAAM,WAAW;AAAA,QAC7D;AACA,gBAAQ,OAAO;AAEf,YAAI,SAAS,aAAc;AAE3B,cAAM,QAAQ,QAAQ;AACtB,cAAM,OAAO,YAAY,OAAO,YAAY,OAAO,SAAS;AAC5D,cAAM,UAAU,OAAO,QAAQ,MAAM,WAAW,QAAQ,IAAI;AAC5D,cAAM,UAAU,OAAO,QAAQ,MAAM,WAAW,QAAQ,IAAI;AAE5D,cAAM,SAAS,WAAW,MAAM,MAAM,SAAS,OAAO;AACtD,gBAAQ,WAAW,OAAO;AAC1B,gBAAQ,YAAY,OAAO;AAC3B,YAAI,OAAO,MAAM,QAAQ,OAAO,MAAM,MAAM;AAC1C,kBAAQ,IAAI,OAAO;AACnB,kBAAQ,IAAI,OAAO;AACnB,kBAAQ,UAAU,OAAO;AACzB,kBAAQ,UAAU,OAAO;AACzB,kBAAQ,QAAQ,OAAO;AACvB,kBAAQ,SAAS,OAAO;AAAA,QAC1B;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO,IAAI,YAAY,EAAE,OAAO,KAAK,UAAU,OAAO,CAAC;AACzD;","names":[]}
|
package/donate.svg
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="296" height="296" class="segno"><g transform="scale(8)"><path fill="#fff" d="M0 0h37v37h-37z"/><path class="qr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0h1m-27 1h1m4 0h1m1 0h1m1 0h3m1 0h2m2 0h1m1 0h1m2 0h5m-31 1h1m5 0h3m1 0h1m2 0h1m1 0h2m2 0h1m3 0h1m3 0h3m1 0h1m-32 1h2m5 0h1m2 0h2m3 0h1m1 0h2m2 0h2m2 0h2m5 0h1m-33 1h1m2 0h2m1 0h2m1 0h3m1 0h1m1 0h3m7 0h1m1 0h1m3 0h1m-32 1h1m2 0h1m3 0h1m1 0h1m1 0h1m1 0h3m5 0h3m3 0h2m1 0h2m-32 1h1m2 0h1m2 0h4m1 0h2m2 0h3m4 0h1m1 0h6m-22 1h1m1 0h1m2 0h2m3 0h5m1 0h1m3 0h1m1 0h1m-31 1h7m3 0h3m1 0h3m1 0h1m2 0h1m1 0h2m1 0h1m1 0h1m1 0h2m-32 1h1m5 0h1m1 0h3m1 0h1m1 0h1m1 0h1m2 0h1m1 0h1m1 0h2m3 0h5m-33 1h1m1 0h3m1 0h1m1 0h3m7 0h1m5 0h6m2 0h1m-33 1h1m1 0h3m1 0h1m1 0h1m3 0h6m3 0h3m1 0h1m2 0h1m1 0h3m-33 1h1m1 0h3m1 0h1m1 0h3m1 0h1m1 0h1m6 0h3m2 0h2m1 0h2m-31 1h1m5 0h1m2 0h1m2 0h1m1 0h1m1 0h1m4 0h1m3 0h1m2 0h3m-31 1h7m1 0h1m2 0h2m1 0h1m2 0h2m1 0h1m1 0h6m1 0h3"/></g></svg>
|
package/package.json
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@richardmcquiston01/unofficial-xcs-writer",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Read, write, and apply variable substitution to xTool Creative Space .xcs files, with real glyph outline extraction for substituted text",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "Richard McQuiston <richard.mcquiston01@gmail.com>",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/RichardMcQuiston01/unofficial-xcs-writer.git"
|
|
10
|
-
},
|
|
11
|
-
"homepage": "https://github.com/RichardMcQuiston01/unofficial-xcs-writer#readme",
|
|
12
|
-
"bugs": "https://github.com/RichardMcQuiston01/unofficial-xcs-writer/issues",
|
|
13
|
-
"keywords": [
|
|
14
|
-
"xtool",
|
|
15
|
-
"xcs",
|
|
16
|
-
"laser",
|
|
17
|
-
"template",
|
|
18
|
-
"variable-substitution"
|
|
19
|
-
],
|
|
20
|
-
"type": "module",
|
|
21
|
-
"exports": {
|
|
22
|
-
".": {
|
|
23
|
-
"types": "./dist/index.d.ts",
|
|
24
|
-
"import": "./dist/index.js",
|
|
25
|
-
"require": "./dist/index.cjs"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"main": "./dist/index.cjs",
|
|
29
|
-
"module": "./dist/index.js",
|
|
30
|
-
"types": "./dist/index.d.ts",
|
|
31
|
-
"files": [
|
|
32
|
-
"dist",
|
|
33
|
-
"third_party",
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@richardmcquiston01/unofficial-xcs-writer",
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "Read, write, and apply variable substitution to xTool Creative Space .xcs files, with real glyph outline extraction for substituted text",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Richard McQuiston <richard.mcquiston01@gmail.com>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/RichardMcQuiston01/unofficial-xcs-writer.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/RichardMcQuiston01/unofficial-xcs-writer#readme",
|
|
12
|
+
"bugs": "https://github.com/RichardMcQuiston01/unofficial-xcs-writer/issues",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"xtool",
|
|
15
|
+
"xcs",
|
|
16
|
+
"laser",
|
|
17
|
+
"template",
|
|
18
|
+
"variable-substitution"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"require": "./dist/index.cjs"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"main": "./dist/index.cjs",
|
|
29
|
+
"module": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"third_party",
|
|
34
|
+
"donate.svg",
|
|
35
|
+
"CHANGELOG.md"
|
|
36
|
+
],
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/opentype.js": "^1.3.10",
|
|
39
|
+
"tsup": "^8.0.0",
|
|
40
|
+
"typescript": "^5.4.0",
|
|
41
|
+
"vitest": "^1.6.0"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"opentype.js": "^2.0.0"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsup",
|
|
48
|
+
"dev": "tsup --watch",
|
|
49
|
+
"typecheck": "tsc --noEmit",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"test:watch": "vitest"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1,201 +1,201 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright 2020 The Arimo Project Authors (https://github.com/googlefonts/arimo) Arimo-Italic[wght].ttf: Copyright 2020 The Arimo Project Authors (https://github.com/googlefonts/arimo)
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2020 The Arimo Project Authors (https://github.com/googlefonts/arimo) Arimo-Italic[wght].ttf: Copyright 2020 The Arimo Project Authors (https://github.com/googlefonts/arimo)
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
201
|
limitations under the License.
|