@pygmalionjs/pygmalion 0.15.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -0
- package/dist-lib/{CameraLayer-CWrlA9D-.js → CameraLayer-Clqgdcjb.js} +1 -1
- package/dist-lib/pygmalion.js +11793 -11370
- package/dist-lib/{runtime-7no5RTHJ.js → runtime-B8Qu1ung.js} +4 -2
- package/dist-lib/style.css +1 -1
- package/dist-lib/testing.js +2 -2
- package/dist-lib/types/document/exportSettings.d.ts +4 -1
- package/dist-lib/types/document/richText.d.ts +10 -0
- package/dist-lib/types/document/textFontPreparation.d.ts +36 -0
- package/dist-lib/types/lib.d.ts +9 -1
- package/dist-lib/types/workspace/configuration.d.ts +6 -0
- package/dist-lib/types/workspace/edit/AssetsPanel.d.ts +3 -1
- package/dist-lib/types/workspace/edit/NodeExportPanel.d.ts +3 -1
- package/dist-lib/types/workspace/edit/TextEditor.d.ts +7 -1
- package/dist-lib/types/workspace/edit/TextStyleCatalog.d.ts +6 -0
- package/dist-lib/types/workspace/edit/rasterCanvas.d.ts +6 -0
- package/dist-lib/types/workspace/edit/rasterExport.d.ts +9 -1
- package/dist-lib/types/workspace/edit/staticTextRaster.d.ts +50 -0
- package/dist-lib/types/workspace/edit/textFontOccurrences.d.ts +34 -0
- package/dist-lib/types/workspace/edit/textFontRuntime.d.ts +15 -0
- package/dist-lib/types/workspace/edit/useTextFontPreparation.d.ts +12 -0
- package/dist-lib/types/workspace/view/prototypeMotionInterruption.d.ts +13 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -476,6 +476,59 @@ Process-group cleanup supports macOS and Linux. Catalog generation callbacks
|
|
|
476
476
|
receive an isolated archive for the exact requested commit; cancelling one
|
|
477
477
|
catalog request does not cancel generation shared with another caller.
|
|
478
478
|
|
|
479
|
+
### Prepare declared text faces
|
|
480
|
+
|
|
481
|
+
An optional `WorkspaceTargetConfiguration.textFontPreparation` capability can
|
|
482
|
+
prepare fonts for the visible page and selected text layer. Create it with
|
|
483
|
+
`createTextFontPreparationRuntime(resolver)` and reuse it for the lifetime of
|
|
484
|
+
the declared font environment. The resolver receives the original family
|
|
485
|
+
expression, numeric weight, normal/italic style, exact text sample and an abort
|
|
486
|
+
signal. A ready result identifies the actual face and attests to that sample's
|
|
487
|
+
coverage; otherwise it returns a named unavailable or failed result.
|
|
488
|
+
|
|
489
|
+
The SDK shares identical pending requests, cancels abandoned readers, caches
|
|
490
|
+
successful results and offers retry without editing the document. Page changes
|
|
491
|
+
exclude hidden pages, and resolved component overrides retain their own font
|
|
492
|
+
requirements. Connected or source-rendered text needs an explicit rendered
|
|
493
|
+
sample; the SDK does not guess that sample from a canonical placeholder.
|
|
494
|
+
|
|
495
|
+
The existing family/weight `TextFontLoader` API remains available. Browser
|
|
496
|
+
`document.fonts.check()` success alone does not establish an exact face or glyph
|
|
497
|
+
coverage. The preparation capability does not download fonts implicitly or change
|
|
498
|
+
text geometry. Dispose the runtime when its font environment is no longer used.
|
|
499
|
+
|
|
500
|
+
### Export authored text and inspect file styles
|
|
501
|
+
|
|
502
|
+
The browser `createDesignRasterRenderer({ textFontPreparation, resolvePreparedFace })`
|
|
503
|
+
factory reuses that explicit preparation runtime for a selected static text
|
|
504
|
+
layer. The face resolver maps the prepared environment and face identity to its
|
|
505
|
+
exact registered `FontFace` object. Missing, replaced or ambiguous registrations
|
|
506
|
+
are refused. Workspace connects `textFontPreparation` and
|
|
507
|
+
`textRasterFaceResolver` to its inspector and asset export controls. Text
|
|
508
|
+
requires a fixed positive box, one unwrapped paragraph, explicit family, size,
|
|
509
|
+
weight, line height and zero letter spacing, one solid color, and a registered
|
|
510
|
+
browser face matching the declared style and weight. The provider attests exact
|
|
511
|
+
face identity and sample coverage; browser fallback or synthesized styling is
|
|
512
|
+
not accepted as that evidence.
|
|
513
|
+
|
|
514
|
+
PNG, JPG and WebP retain the layer box and existing output size limits. Text
|
|
515
|
+
with mixed runs, automatic sizing, layout-dependent placement, source/bound
|
|
516
|
+
content, decorations, effects or unresolved colors is refused. SVG text and
|
|
517
|
+
frames containing text remain unsupported by the built-in exporter. The
|
|
518
|
+
existing `renderDesignRaster` geometry renderer remains available without a
|
|
519
|
+
font provider. Raster success never enables a source writer.
|
|
520
|
+
|
|
521
|
+
`exportDesignNode` accepts an optional fifth `{ signal }` argument. Workspace
|
|
522
|
+
cancels pending output when the layer, document, target, page or mode changes,
|
|
523
|
+
including a rapid departure and return before a render. Export never adds a
|
|
524
|
+
history entry or applies implementation source.
|
|
525
|
+
|
|
526
|
+
With no layer selected, the properties sidebar lists the file's authored text
|
|
527
|
+
styles, grouped by their slash-separated names. Expanding a style displays its
|
|
528
|
+
stored typography and library origin. This metadata browser neither discovers
|
|
529
|
+
installed fonts nor downloads faces; selecting a layer retains the existing
|
|
530
|
+
style application and editing controls.
|
|
531
|
+
|
|
479
532
|
## Local development
|
|
480
533
|
|
|
481
534
|
```bash
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import { n as C, R as g, aM as P, ck as R, cl as k, Y as E, cm as I, a7 as m, a4 as b } from "./runtime-
|
|
2
|
+
import { n as C, R as g, aM as P, ck as R, cl as k, Y as E, cm as I, a7 as m, a4 as b } from "./runtime-B8Qu1ung.js";
|
|
3
3
|
import { useRef as L, useLayoutEffect as h } from "react";
|
|
4
4
|
function v(n) {
|
|
5
5
|
return `translate(${n.panX}px, ${n.panY}px) scale(${n.zoom})`;
|