@glissade/cli 0.51.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/export.js +17 -0
- package/dist/parity.js +10 -1
- package/package.json +10 -10
package/dist/export.js
CHANGED
|
@@ -17,10 +17,12 @@ async function exportCommand(opts) {
|
|
|
17
17
|
const width = opts.width ?? scene.size.w;
|
|
18
18
|
const height = opts.height ?? scene.size.h;
|
|
19
19
|
const warnings = [];
|
|
20
|
+
const measurer = await buildSceneMeasurer(mod, opts.input);
|
|
20
21
|
const doc = exportLottie(mod, {
|
|
21
22
|
width,
|
|
22
23
|
height,
|
|
23
24
|
...opts.fps !== void 0 ? { fps: opts.fps } : {},
|
|
25
|
+
measurer,
|
|
24
26
|
onWarn: (w) => warnings.push(w)
|
|
25
27
|
});
|
|
26
28
|
const outAbs = resolve(opts.out);
|
|
@@ -31,5 +33,20 @@ async function exportCommand(opts) {
|
|
|
31
33
|
warnings
|
|
32
34
|
};
|
|
33
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* A Skia measurer registered with the scene's declared font faces (the same
|
|
38
|
+
* pattern narrationLintCommand uses) so `exportLottie` bakes width-wrapped Text
|
|
39
|
+
* with the rasterizer's real metrics. Scenes referencing only system families
|
|
40
|
+
* still measure faithfully (createMeasurer's SkiaBackend resolves them).
|
|
41
|
+
*/
|
|
42
|
+
async function buildSceneMeasurer(mod, input) {
|
|
43
|
+
const { resolveAssetPath } = await import("./audioMix.js").then((n) => n.i);
|
|
44
|
+
const { buildFontRegistry } = await import("@glissade/core");
|
|
45
|
+
const { createMeasurer } = await import("@glissade/backend-skia");
|
|
46
|
+
const fontRegistry = buildFontRegistry(mod.timeline.assets);
|
|
47
|
+
const fonts = {};
|
|
48
|
+
for (const face of fontRegistry.faces()) fonts[face.family] = resolveAssetPath(face.url, input);
|
|
49
|
+
return createMeasurer({ fonts });
|
|
50
|
+
}
|
|
34
51
|
//#endregion
|
|
35
52
|
export { export_exports as n, exportCommand as t };
|
package/dist/parity.js
CHANGED
|
@@ -207,10 +207,19 @@ async function skiaSource(mod, w, h, modulePath) {
|
|
|
207
207
|
* Lottie bijection per frame — e.g. the dropped `fontAxes` surfaces as a real SSIM drop.
|
|
208
208
|
*/
|
|
209
209
|
async function lottieSource(mod, w, h, fps, modulePath) {
|
|
210
|
+
const measureScene = mod.createScene();
|
|
211
|
+
const measurer = new SkiaBackend(w, h);
|
|
212
|
+
await prepareSkiaRenderEnv({
|
|
213
|
+
scene: measureScene,
|
|
214
|
+
doc: mod.timeline,
|
|
215
|
+
backend: measurer,
|
|
216
|
+
modulePath
|
|
217
|
+
});
|
|
210
218
|
return skiaSource(importLottie(exportLottie(mod, {
|
|
211
219
|
width: w,
|
|
212
220
|
height: h,
|
|
213
|
-
fps
|
|
221
|
+
fps,
|
|
222
|
+
measurer
|
|
214
223
|
})).toSceneModule(), w, h, modulePath);
|
|
215
224
|
}
|
|
216
225
|
function makeSource(backend, mod, w, h, fps, modulePath) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glissade/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"description": "glissade CLI: headless rendering via backend-skia (+ FFmpeg mux).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"engines": {
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"@napi-rs/canvas": "^0.1.65",
|
|
29
29
|
"esbuild": "0.28.0",
|
|
30
30
|
"jiti": "^2.4.2",
|
|
31
|
-
"@glissade/backend-skia": "0.
|
|
32
|
-
"@glissade/core": "0.
|
|
33
|
-
"@glissade/interact": "0.
|
|
34
|
-
"@glissade/lottie": "0.
|
|
35
|
-
"@glissade/narrate": "0.
|
|
36
|
-
"@glissade/player": "0.
|
|
37
|
-
"@glissade/scene": "0.
|
|
38
|
-
"@glissade/sfx": "0.
|
|
39
|
-
"@glissade/svg": "0.
|
|
31
|
+
"@glissade/backend-skia": "0.52.0",
|
|
32
|
+
"@glissade/core": "0.52.0",
|
|
33
|
+
"@glissade/interact": "0.52.0",
|
|
34
|
+
"@glissade/lottie": "0.52.0",
|
|
35
|
+
"@glissade/narrate": "0.52.0",
|
|
36
|
+
"@glissade/player": "0.52.0",
|
|
37
|
+
"@glissade/scene": "0.52.0",
|
|
38
|
+
"@glissade/sfx": "0.52.0",
|
|
39
|
+
"@glissade/svg": "0.52.0"
|
|
40
40
|
},
|
|
41
41
|
"repository": {
|
|
42
42
|
"type": "git",
|