alpha2 0.1.0 → 0.2.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/dist/assets.d.ts +1 -1
- package/dist/text.d.ts +13 -10
- package/dist/text.js +5 -4
- package/package.json +1 -1
- package/wasm/alpha2_audio_worklet.wasm +0 -0
- package/wasm/alpha2_extensions_bg.wasm +0 -0
- package/wasm/alpha2_wasm.d.ts +2 -2
- package/wasm/alpha2_wasm.js +20 -20
- package/wasm/alpha2_wasm_bg.wasm +0 -0
- /package/wasm/snippets/{alpha2-wasm-1112c60b377beee2 → alpha2-wasm-6cb97e5ef34d0f09}/inline0.js +0 -0
- /package/wasm/snippets/{alpha2-wasm-1112c60b377beee2 → alpha2-wasm-6cb97e5ef34d0f09}/inline1.js +0 -0
- /package/wasm/snippets/{alpha2-wasm-1112c60b377beee2 → alpha2-wasm-6cb97e5ef34d0f09}/inline2.js +0 -0
package/dist/assets.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ColorPipeline, MediaFingerprint, Project } from "./generated/project-schema.js";
|
|
2
2
|
/** What media is read for. */
|
|
3
|
-
export type MediaPurpose = "preview" | "thumbnail" | "remote_edit" | "export_original" | "export_proxy";
|
|
3
|
+
export type MediaPurpose = "preview" | "preview_proxy" | "thumbnail" | "remote_edit" | "export_original" | "export_proxy";
|
|
4
4
|
/** Whether a source's original media can be read. */
|
|
5
5
|
export type OriginalState = {
|
|
6
6
|
readonly state: "online";
|
package/dist/text.d.ts
CHANGED
|
@@ -55,12 +55,12 @@ export interface BrowserTextRequest {
|
|
|
55
55
|
/** A CSS color (default opaque white). */
|
|
56
56
|
readonly color?: string;
|
|
57
57
|
/**
|
|
58
|
-
* How emoji are drawn (default `
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
58
|
+
* How emoji are drawn (default `color`): in the platform's color font, as text presentation
|
|
59
|
+
* where there is one (`monochrome`), or as one U+FFFD per grapheme shown as an emoji
|
|
60
|
+
* (`replace`), as the portable host replaces them. Symbols shown as text by default, such as
|
|
61
|
+
* (c), stay.
|
|
62
62
|
*/
|
|
63
|
-
readonly emojiPolicy?: "
|
|
63
|
+
readonly emojiPolicy?: "color" | "monochrome" | "replace";
|
|
64
64
|
}
|
|
65
65
|
/** The `WasmTextRasterizer` class that `alpha2/wasm` exports. */
|
|
66
66
|
export interface WasmTextRasterizerHandle {
|
|
@@ -93,20 +93,23 @@ export interface WasmTextRequest {
|
|
|
93
93
|
/** Straight (not premultiplied), sRGB-encoded RGBA, each in `0..=255`. */
|
|
94
94
|
readonly color: readonly [number, number, number, number];
|
|
95
95
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
96
|
+
* How emoji are drawn (default `color`): a font's color glyphs (COLR, CBDT, sbix) in their own
|
|
97
|
+
* colors, an emoji trying the color fonts first; `monochrome` draws every glyph as an outline in
|
|
98
|
+
* `color`, an emoji trying the other fonts first; `replace` draws each emoji grapheme as one
|
|
99
|
+
* U+FFFD.
|
|
98
100
|
*/
|
|
99
|
-
readonly emojiPolicy?: "monochrome" | "replace";
|
|
101
|
+
readonly emojiPolicy?: "color" | "monochrome" | "replace";
|
|
100
102
|
}
|
|
101
103
|
/**
|
|
102
104
|
* The engine's portable text host (`alpha2-text`: Unicode bidirectional
|
|
103
105
|
* layout and line breaking, rustybuzz shaping, `ab_glyph_rasterizer`
|
|
104
|
-
* outlines) running in wasm.
|
|
106
|
+
* outlines, COLR paintings and CBDT or sbix bitmaps) running in wasm.
|
|
105
107
|
*
|
|
106
108
|
* It is the same code a native host rasterizes with, so with the same font bytes a browser preview
|
|
107
109
|
* and a native export draw identical text; the platform's own rasterizer, {@link
|
|
108
110
|
* OffscreenTextRasterizer}, does not. Fonts are caller-supplied bytes in fallback order; system
|
|
109
|
-
* fonts are not reachable. Color emoji are drawn as outlines or
|
|
111
|
+
* fonts are not reachable. Color emoji are drawn in color from the fonts given, as outlines, or
|
|
112
|
+
* replaced (`emojiPolicy`).
|
|
110
113
|
*/
|
|
111
114
|
export declare class WasmTextRasterizer {
|
|
112
115
|
#private;
|
package/dist/text.js
CHANGED
|
@@ -35,12 +35,13 @@ const TEXT_ALIGNS = new Set(["start", "end", "left", "right", "center"]);
|
|
|
35
35
|
/**
|
|
36
36
|
* The engine's portable text host (`alpha2-text`: Unicode bidirectional
|
|
37
37
|
* layout and line breaking, rustybuzz shaping, `ab_glyph_rasterizer`
|
|
38
|
-
* outlines) running in wasm.
|
|
38
|
+
* outlines, COLR paintings and CBDT or sbix bitmaps) running in wasm.
|
|
39
39
|
*
|
|
40
40
|
* It is the same code a native host rasterizes with, so with the same font bytes a browser preview
|
|
41
41
|
* and a native export draw identical text; the platform's own rasterizer, {@link
|
|
42
42
|
* OffscreenTextRasterizer}, does not. Fonts are caller-supplied bytes in fallback order; system
|
|
43
|
-
* fonts are not reachable. Color emoji are drawn as outlines or
|
|
43
|
+
* fonts are not reachable. Color emoji are drawn in color from the fonts given, as outlines, or
|
|
44
|
+
* replaced (`emojiPolicy`).
|
|
44
45
|
*/
|
|
45
46
|
export class WasmTextRasterizer {
|
|
46
47
|
#handle;
|
|
@@ -163,7 +164,7 @@ export class OffscreenTextRasterizer {
|
|
|
163
164
|
throw new Error("OffscreenCanvas 2D context is unavailable");
|
|
164
165
|
probe.font = `${fontSize}px ${family}`;
|
|
165
166
|
probe.textBaseline = "alphabetic";
|
|
166
|
-
const normalizedText = normalizeEmoji(request.text, request.emojiPolicy ?? "
|
|
167
|
+
const normalizedText = normalizeEmoji(request.text, request.emojiPolicy ?? "color");
|
|
167
168
|
const lines = wrapLines(probe, normalizedText, request.maxWidth ?? 0);
|
|
168
169
|
probe.textAlign = request.align ?? "start";
|
|
169
170
|
const measured = lines.map((line) => probe.measureText(line));
|
|
@@ -389,7 +390,7 @@ function isEmoji(grapheme) {
|
|
|
389
390
|
/** A lone pictograph, with or without a presentation selector: what U+FE0E can make text. */
|
|
390
391
|
const LONE_PICTOGRAPH = /^(\p{Extended_Pictographic})\ufe0f?$/u;
|
|
391
392
|
function normalizeEmoji(text, policy) {
|
|
392
|
-
if (policy === "
|
|
393
|
+
if (policy === "color")
|
|
393
394
|
return text;
|
|
394
395
|
let normalized = "";
|
|
395
396
|
for (const segment of graphemes(text)) {
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
package/wasm/alpha2_wasm.d.ts
CHANGED
|
@@ -935,8 +935,8 @@ export function compareFingerprints(recorded: string, found: string): string;
|
|
|
935
935
|
|
|
936
936
|
/**
|
|
937
937
|
* Whether `project`'s media, as `catalog` describes it, is ready for
|
|
938
|
-
* `purpose` (`preview`, `
|
|
939
|
-
* `export_proxy`), as a JSON `ConformReport`.
|
|
938
|
+
* `purpose` (`preview`, `preview_proxy`, `thumbnail`, `remote_edit`,
|
|
939
|
+
* `export_original`, or `export_proxy`), as a JSON `ConformReport`.
|
|
940
940
|
*
|
|
941
941
|
* # Errors
|
|
942
942
|
* Rejects an invalid project, catalog (one whose fingerprints are not well
|
package/wasm/alpha2_wasm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* @ts-self-types="./alpha2_wasm.d.ts" */
|
|
2
|
-
import { alpha2BitmapUploadsPremultiplied, alpha2FrameBitmap } from './snippets/alpha2-wasm-
|
|
3
|
-
import { alpha2CopyExternalImage } from './snippets/alpha2-wasm-
|
|
4
|
-
import * as import1 from "./snippets/alpha2-wasm-
|
|
5
|
-
import * as import2 from "./snippets/alpha2-wasm-
|
|
2
|
+
import { alpha2BitmapUploadsPremultiplied, alpha2FrameBitmap } from './snippets/alpha2-wasm-6cb97e5ef34d0f09/inline1.js';
|
|
3
|
+
import { alpha2CopyExternalImage } from './snippets/alpha2-wasm-6cb97e5ef34d0f09/inline2.js';
|
|
4
|
+
import * as import1 from "./snippets/alpha2-wasm-6cb97e5ef34d0f09/inline0.js"
|
|
5
|
+
import * as import2 from "./snippets/alpha2-wasm-6cb97e5ef34d0f09/inline0.js"
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -2060,8 +2060,8 @@ export function compareFingerprints(recorded, found) {
|
|
|
2060
2060
|
|
|
2061
2061
|
/**
|
|
2062
2062
|
* Whether `project`'s media, as `catalog` describes it, is ready for
|
|
2063
|
-
* `purpose` (`preview`, `
|
|
2064
|
-
* `export_proxy`), as a JSON `ConformReport`.
|
|
2063
|
+
* `purpose` (`preview`, `preview_proxy`, `thumbnail`, `remote_edit`,
|
|
2064
|
+
* `export_original`, or `export_proxy`), as a JSON `ConformReport`.
|
|
2065
2065
|
*
|
|
2066
2066
|
* # Errors
|
|
2067
2067
|
* Rejects an invalid project, catalog (one whose fingerprints are not well
|
|
@@ -2416,14 +2416,14 @@ function __wbg_get_imports() {
|
|
|
2416
2416
|
__wbg_addEventListener_9534e2dc12044ee4: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2417
2417
|
arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3);
|
|
2418
2418
|
}, arguments); },
|
|
2419
|
-
|
|
2419
|
+
__wbg_alpha2BitmapUploadsPremultiplied_362906fc8fe45d51: function() { return handleError(function () {
|
|
2420
2420
|
const ret = alpha2BitmapUploadsPremultiplied();
|
|
2421
2421
|
return ret;
|
|
2422
2422
|
}, arguments); },
|
|
2423
|
-
|
|
2423
|
+
__wbg_alpha2CopyExternalImage_2e2c5492e1e63dc9: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
2424
2424
|
alpha2CopyExternalImage(arg0, arg1, arg2, arg3 >>> 0, arg4 >>> 0);
|
|
2425
2425
|
}, arguments); },
|
|
2426
|
-
|
|
2426
|
+
__wbg_alpha2FrameBitmap_3a8e8476c127792e: function() { return handleError(function (arg0, arg1, arg2) {
|
|
2427
2427
|
const ret = alpha2FrameBitmap(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
2428
2428
|
return ret;
|
|
2429
2429
|
}, arguments); },
|
|
@@ -4604,47 +4604,47 @@ function __wbg_get_imports() {
|
|
|
4604
4604
|
arg0.writeTexture(arg1, getArrayU8FromWasm0(arg2, arg3), arg4, arg5);
|
|
4605
4605
|
}, arguments); },
|
|
4606
4606
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
4607
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
4607
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 3238, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
4608
4608
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true_);
|
|
4609
4609
|
return ret;
|
|
4610
4610
|
},
|
|
4611
4611
|
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
4612
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx:
|
|
4612
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 69, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
4613
4613
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___web_sys_9e2ae0ace5131457___features__gen_Event__Event______true_);
|
|
4614
4614
|
return ret;
|
|
4615
4615
|
},
|
|
4616
4616
|
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
4617
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUCompilationInfo")], shim_idx:
|
|
4617
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUCompilationInfo")], shim_idx: 1019, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
4618
4618
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___sys__JsNullable_wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true_);
|
|
4619
4619
|
return ret;
|
|
4620
4620
|
},
|
|
4621
4621
|
__wbindgen_generic_0000000000000004: function(arg0, arg1) {
|
|
4622
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx:
|
|
4622
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 1019, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
4623
4623
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___sys__JsNullable_wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true__125);
|
|
4624
4624
|
return ret;
|
|
4625
4625
|
},
|
|
4626
4626
|
__wbindgen_generic_0000000000000005: function(arg0, arg1) {
|
|
4627
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx:
|
|
4627
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx: 1022, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
4628
4628
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true_);
|
|
4629
4629
|
return ret;
|
|
4630
4630
|
},
|
|
4631
4631
|
__wbindgen_generic_0000000000000006: function(arg0, arg1) {
|
|
4632
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx:
|
|
4632
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 1022, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
4633
4633
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__127);
|
|
4634
4634
|
return ret;
|
|
4635
4635
|
},
|
|
4636
4636
|
__wbindgen_generic_0000000000000007: function(arg0, arg1) {
|
|
4637
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx:
|
|
4637
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 1019, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
4638
4638
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___sys__JsNullable_wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true__128);
|
|
4639
4639
|
return ret;
|
|
4640
4640
|
},
|
|
4641
4641
|
__wbindgen_generic_0000000000000008: function(arg0, arg1) {
|
|
4642
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx:
|
|
4642
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 1019, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
4643
4643
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___sys__JsNullable_wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true__129);
|
|
4644
4644
|
return ret;
|
|
4645
4645
|
},
|
|
4646
4646
|
__wbindgen_generic_0000000000000009: function(arg0, arg1) {
|
|
4647
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
4647
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 71, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
4648
4648
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke_______true_);
|
|
4649
4649
|
return ret;
|
|
4650
4650
|
},
|
|
@@ -4711,8 +4711,8 @@ function __wbg_get_imports() {
|
|
|
4711
4711
|
return {
|
|
4712
4712
|
__proto__: null,
|
|
4713
4713
|
"./alpha2_wasm_bg.js": import0,
|
|
4714
|
-
"./snippets/alpha2-wasm-
|
|
4715
|
-
"./snippets/alpha2-wasm-
|
|
4714
|
+
"./snippets/alpha2-wasm-6cb97e5ef34d0f09/inline0.js": import1,
|
|
4715
|
+
"./snippets/alpha2-wasm-6cb97e5ef34d0f09/inline0.js": import2,
|
|
4716
4716
|
};
|
|
4717
4717
|
}
|
|
4718
4718
|
|
package/wasm/alpha2_wasm_bg.wasm
CHANGED
|
Binary file
|
/package/wasm/snippets/{alpha2-wasm-1112c60b377beee2 → alpha2-wasm-6cb97e5ef34d0f09}/inline0.js
RENAMED
|
File without changes
|
/package/wasm/snippets/{alpha2-wasm-1112c60b377beee2 → alpha2-wasm-6cb97e5ef34d0f09}/inline1.js
RENAMED
|
File without changes
|
/package/wasm/snippets/{alpha2-wasm-1112c60b377beee2 → alpha2-wasm-6cb97e5ef34d0f09}/inline2.js
RENAMED
|
File without changes
|