@daasboard/render-core 0.0.0-stage → 0.1.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/LICENSE +5 -0
- package/README.md +8 -2
- package/dist/LICENSE-thumbhash.txt +21 -0
- package/dist/damage/DamageTracker.d.ts +20 -0
- package/dist/damage/DamageTracker.js +187 -0
- package/dist/fonts/FontRegistry.d.ts +140 -0
- package/dist/fonts/FontRegistry.js +1151 -0
- package/dist/fonts/arrivals.d.ts +13 -0
- package/dist/fonts/arrivals.js +16 -0
- package/dist/fonts/colorFont.d.ts +1 -0
- package/dist/fonts/colorFont.js +61 -0
- package/dist/fonts/combiningMarks.d.ts +1 -0
- package/dist/fonts/combiningMarks.js +329 -0
- package/dist/fonts/emojiPresentation.d.ts +3 -0
- package/dist/fonts/emojiPresentation.js +3 -0
- package/dist/fonts/fetchFontBytes.d.ts +2 -0
- package/dist/fonts/fetchFontBytes.js +35 -0
- package/dist/fonts/fontBytes.d.ts +2 -0
- package/dist/fonts/fontBytes.js +24 -0
- package/dist/fonts/manifest.d.ts +37 -0
- package/dist/fonts/manifest.js +2 -0
- package/dist/fonts/manifest.json +153 -0
- package/dist/fonts/ranges.d.ts +13 -0
- package/dist/fonts/ranges.js +86 -0
- package/dist/fonts/registeredFontFacts.d.ts +11 -0
- package/dist/fonts/registeredFontFacts.js +4 -0
- package/dist/fonts/segment.d.ts +31 -0
- package/dist/fonts/segment.js +299 -0
- package/dist/fonts/sha256.d.ts +9 -0
- package/dist/fonts/sha256.js +141 -0
- package/dist/geometry.d.ts +28 -0
- package/dist/geometry.js +53 -0
- package/dist/images/ImageCache.d.ts +117 -0
- package/dist/images/ImageCache.js +986 -0
- package/dist/images/arrivals.d.ts +15 -0
- package/dist/images/arrivals.js +28 -0
- package/dist/images/imagePlan.d.ts +58 -0
- package/dist/images/imagePlan.js +165 -0
- package/dist/images/imageRead.d.ts +9 -0
- package/dist/images/imageRead.js +56 -0
- package/dist/images/inspect.d.ts +14 -0
- package/dist/images/inspect.js +199 -0
- package/dist/images/prepareImages.d.ts +29 -0
- package/dist/images/prepareImages.js +245 -0
- package/dist/images/rungs.d.ts +31 -0
- package/dist/images/rungs.js +56 -0
- package/dist/images/thumbHash.d.ts +15 -0
- package/dist/images/thumbHash.js +191 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +36 -0
- package/dist/loop/FramePipeline.d.ts +72 -0
- package/dist/loop/FramePipeline.js +184 -0
- package/dist/loop/FrameScheduler.d.ts +114 -0
- package/dist/loop/FrameScheduler.js +341 -0
- package/dist/loop/IdleQueue.d.ts +70 -0
- package/dist/loop/IdleQueue.js +268 -0
- package/dist/loop/LoadPolicy.d.ts +41 -0
- package/dist/loop/LoadPolicy.js +68 -0
- package/dist/loop/sleep.d.ts +25 -0
- package/dist/loop/sleep.js +14 -0
- package/dist/renderer/Renderer.d.ts +234 -0
- package/dist/renderer/Renderer.js +68 -0
- package/dist/renderer/canvaskit/CanvasKitRenderer.d.ts +171 -0
- package/dist/renderer/canvaskit/CanvasKitRenderer.js +2108 -0
- package/dist/renderer/canvaskit/endCaps.d.ts +2 -0
- package/dist/renderer/canvaskit/endCaps.js +80 -0
- package/dist/renderer/canvaskit/fontCache.d.ts +5 -0
- package/dist/renderer/canvaskit/fontCache.js +149 -0
- package/dist/renderer/canvaskit/giantParagraph.d.ts +14 -0
- package/dist/renderer/canvaskit/giantParagraph.js +107 -0
- package/dist/renderer/canvaskit/imageReduction.d.ts +1 -0
- package/dist/renderer/canvaskit/imageReduction.js +15 -0
- package/dist/renderer/canvaskit/loadCanvasKit.d.ts +5 -0
- package/dist/renderer/canvaskit/loadCanvasKit.js +27 -0
- package/dist/renderer/idleWork.d.ts +7 -0
- package/dist/renderer/idleWork.js +29 -0
- package/dist/renderer/listMarkers.d.ts +11 -0
- package/dist/renderer/listMarkers.js +18 -0
- package/dist/renderer/strokePieces.d.ts +8 -0
- package/dist/renderer/strokePieces.js +255 -0
- package/dist/scene/AxisIndex.d.ts +27 -0
- package/dist/scene/AxisIndex.js +362 -0
- package/dist/scene/ChunkPictures.d.ts +78 -0
- package/dist/scene/ChunkPictures.js +499 -0
- package/dist/scene/SceneStore.d.ts +45 -0
- package/dist/scene/SceneStore.js +418 -0
- package/dist/scene/SpatialIndex.d.ts +34 -0
- package/dist/scene/SpatialIndex.js +361 -0
- package/dist/scene/hitTest.d.ts +13 -0
- package/dist/scene/hitTest.js +186 -0
- package/dist/scene/inPlace.d.ts +37 -0
- package/dist/scene/inPlace.js +204 -0
- package/dist/scene/paint.d.ts +122 -0
- package/dist/scene/paint.js +1094 -0
- package/dist/scene/pathClip.d.ts +14 -0
- package/dist/scene/pathClip.js +174 -0
- package/dist/scene/types.d.ts +163 -0
- package/dist/scene/types.js +1 -0
- package/dist/text/caseMapping.d.ts +7 -0
- package/dist/text/caseMapping.js +225 -0
- package/dist/text/textCase.d.ts +10 -0
- package/dist/text/textCase.js +152 -0
- package/dist/viewport/ViewportRaster.d.ts +39 -0
- package/dist/viewport/ViewportRaster.js +149 -0
- package/package.json +30 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Copyright (c) 2026 Spotworks AI LLC. All rights reserved.
|
|
2
|
+
|
|
3
|
+
This software is proprietary. No license or other right to use, copy, modify,
|
|
4
|
+
merge, publish, distribute, sublicense or sell it, in whole or in part, is
|
|
5
|
+
granted except under a separate written agreement with Spotworks AI LLC.
|
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @daasboard/render-core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
CanvasKit rendering, scene indexing and font loading for daasboard. Font binaries are supplied separately by `@daasboard/fonts`.
|
|
4
|
+
|
|
5
|
+
Hosts normally start from [`@daasboard/embed`](https://www.npmjs.com/package/@daasboard/embed), which mounts the editor and documents the required wasm and font assets. Keep every `@daasboard` package on the same exact release version.
|
|
6
|
+
|
|
7
|
+
Node hosts require Node 22.3 or later. The CanvasKit loader uses `process.getBuiltinModule`, introduced in Node 20.16 and 22.3.
|
|
8
|
+
|
|
9
|
+
This package provides ES modules and TypeScript declarations through its root entry point. Public availability grants no license; see `LICENSE`. Third-party components retain their own licenses.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Evan Wallace
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Camera, type Rect } from "../geometry.js";
|
|
2
|
+
export interface DamagePlan {
|
|
3
|
+
rects: Rect[];
|
|
4
|
+
full: boolean;
|
|
5
|
+
coverage: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function worldToDeviceRect(r: Rect, cam: Camera, dpr: number): Rect;
|
|
8
|
+
export declare function deviceToWorldRect(r: Rect, cam: Camera, dpr: number): Rect;
|
|
9
|
+
export declare function mergeRects(rects: Rect[]): Rect[];
|
|
10
|
+
export interface DamageOptions {
|
|
11
|
+
maxRects?: number;
|
|
12
|
+
fullAbove?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface RegionOptions {
|
|
15
|
+
maxRects?: number;
|
|
16
|
+
mergeBelowPx?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function planRegion(worldRects: readonly Rect[], cam: Camera, dpr: number, width: number, height: number, opts?: RegionOptions): Rect[];
|
|
19
|
+
export declare function disjoint(rects: readonly Rect[]): Rect[];
|
|
20
|
+
export declare function planDamage(worldRects: Rect[], cam: Camera, dpr: number, width: number, height: number, opts?: DamageOptions): DamagePlan;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { rectIntersects, rectSnapOut, rectUnion } from "../geometry.js";
|
|
2
|
+
export function worldToDeviceRect(r, cam, dpr) {
|
|
3
|
+
const s = cam.zoom * dpr;
|
|
4
|
+
return { x: (r.x - cam.x) * s, y: (r.y - cam.y) * s, w: r.w * s, h: r.h * s };
|
|
5
|
+
}
|
|
6
|
+
export function deviceToWorldRect(r, cam, dpr) {
|
|
7
|
+
const s = cam.zoom * dpr;
|
|
8
|
+
return { x: r.x / s + cam.x, y: r.y / s + cam.y, w: r.w / s, h: r.h / s };
|
|
9
|
+
}
|
|
10
|
+
function clampToSurface(r, w, h) {
|
|
11
|
+
const x0 = Math.max(0, r.x);
|
|
12
|
+
const y0 = Math.max(0, r.y);
|
|
13
|
+
const x1 = Math.min(w, r.x + r.w);
|
|
14
|
+
const y1 = Math.min(h, r.y + r.h);
|
|
15
|
+
if (x1 <= x0 || y1 <= y0)
|
|
16
|
+
return null;
|
|
17
|
+
return { x: x0, y: y0, w: x1 - x0, h: y1 - y0 };
|
|
18
|
+
}
|
|
19
|
+
export function mergeRects(rects) {
|
|
20
|
+
const out = rects.slice();
|
|
21
|
+
let merged = true;
|
|
22
|
+
while (merged) {
|
|
23
|
+
merged = false;
|
|
24
|
+
outer: for (let i = 0; i < out.length; i++) {
|
|
25
|
+
for (let j = i + 1; j < out.length; j++) {
|
|
26
|
+
const a = out[i];
|
|
27
|
+
const b = out[j];
|
|
28
|
+
const touching = a.x <= b.x + b.w && b.x <= a.x + a.w && a.y <= b.y + b.h && b.y <= a.y + a.h;
|
|
29
|
+
if (touching || rectIntersects(a, b)) {
|
|
30
|
+
out[i] = rectUnion(a, b);
|
|
31
|
+
out.splice(j, 1);
|
|
32
|
+
merged = true;
|
|
33
|
+
break outer;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return out;
|
|
39
|
+
}
|
|
40
|
+
export function planRegion(worldRects, cam, dpr, width, height, opts = {}) {
|
|
41
|
+
const max = Math.max(1, opts.maxRects ?? 12);
|
|
42
|
+
const free = opts.mergeBelowPx ?? 4096;
|
|
43
|
+
let rects = [];
|
|
44
|
+
for (const r of worldRects) {
|
|
45
|
+
const c = clampToSurface(rectSnapOut(worldToDeviceRect(r, cam, dpr)), width, height);
|
|
46
|
+
if (c)
|
|
47
|
+
rects.push(c);
|
|
48
|
+
}
|
|
49
|
+
if (rects.length > 64)
|
|
50
|
+
rects = gridRuns(rects, width, height);
|
|
51
|
+
if (rects.length > 64)
|
|
52
|
+
rects = [rects.reduce((a, b) => rectUnion(a, b))];
|
|
53
|
+
const n = rects.length;
|
|
54
|
+
if (n < 2)
|
|
55
|
+
return rects;
|
|
56
|
+
const area = (r) => r.w * r.h;
|
|
57
|
+
const overlap = (a, b) => {
|
|
58
|
+
const w = Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x);
|
|
59
|
+
const h = Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y);
|
|
60
|
+
return w > 0 && h > 0 ? w * h : 0;
|
|
61
|
+
};
|
|
62
|
+
const cost = (a, b) => area(rectUnion(a, b)) - (area(a) + area(b) - overlap(a, b));
|
|
63
|
+
const live = rects.map(() => true);
|
|
64
|
+
const costs = new Float64Array(n * n);
|
|
65
|
+
for (let i = 0; i < n; i++)
|
|
66
|
+
for (let j = i + 1; j < n; j++)
|
|
67
|
+
costs[i * n + j] = cost(rects[i], rects[j]);
|
|
68
|
+
let count = n;
|
|
69
|
+
while (count > 1) {
|
|
70
|
+
let best = Infinity;
|
|
71
|
+
let bi = -1;
|
|
72
|
+
let bj = -1;
|
|
73
|
+
for (let i = 0; i < n; i++) {
|
|
74
|
+
if (!live[i])
|
|
75
|
+
continue;
|
|
76
|
+
for (let j = i + 1; j < n; j++) {
|
|
77
|
+
if (live[j] && costs[i * n + j] < best) {
|
|
78
|
+
best = costs[i * n + j];
|
|
79
|
+
bi = i;
|
|
80
|
+
bj = j;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (bi < 0 || (best > free && count <= max))
|
|
85
|
+
break;
|
|
86
|
+
rects[bi] = rectUnion(rects[bi], rects[bj]);
|
|
87
|
+
live[bj] = false;
|
|
88
|
+
count--;
|
|
89
|
+
for (let k = 0; k < n; k++) {
|
|
90
|
+
if (!live[k] || k === bi)
|
|
91
|
+
continue;
|
|
92
|
+
const c = cost(rects[bi], rects[k]);
|
|
93
|
+
if (k < bi)
|
|
94
|
+
costs[k * n + bi] = c;
|
|
95
|
+
else
|
|
96
|
+
costs[bi * n + k] = c;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return disjoint(rects.filter((_, i) => live[i]));
|
|
100
|
+
}
|
|
101
|
+
export function disjoint(rects) {
|
|
102
|
+
const out = [];
|
|
103
|
+
for (const r of rects) {
|
|
104
|
+
let pieces = [r];
|
|
105
|
+
for (const o of out) {
|
|
106
|
+
if (!pieces.length)
|
|
107
|
+
break;
|
|
108
|
+
const next = [];
|
|
109
|
+
for (const p of pieces)
|
|
110
|
+
subtractRect(p, o, next);
|
|
111
|
+
pieces = next;
|
|
112
|
+
}
|
|
113
|
+
out.push(...pieces);
|
|
114
|
+
}
|
|
115
|
+
return out;
|
|
116
|
+
}
|
|
117
|
+
function subtractRect(a, b, out) {
|
|
118
|
+
const ax1 = a.x + a.w;
|
|
119
|
+
const ay1 = a.y + a.h;
|
|
120
|
+
const bx1 = b.x + b.w;
|
|
121
|
+
const by1 = b.y + b.h;
|
|
122
|
+
if (b.x >= ax1 || bx1 <= a.x || b.y >= ay1 || by1 <= a.y) {
|
|
123
|
+
out.push(a);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (b.y > a.y)
|
|
127
|
+
out.push({ x: a.x, y: a.y, w: a.w, h: b.y - a.y });
|
|
128
|
+
if (by1 < ay1)
|
|
129
|
+
out.push({ x: a.x, y: by1, w: a.w, h: ay1 - by1 });
|
|
130
|
+
const y0 = Math.max(a.y, b.y);
|
|
131
|
+
const y1 = Math.min(ay1, by1);
|
|
132
|
+
if (b.x > a.x)
|
|
133
|
+
out.push({ x: a.x, y: y0, w: b.x - a.x, h: y1 - y0 });
|
|
134
|
+
if (bx1 < ax1)
|
|
135
|
+
out.push({ x: bx1, y: y0, w: ax1 - bx1, h: y1 - y0 });
|
|
136
|
+
}
|
|
137
|
+
function gridRuns(rects, width, height) {
|
|
138
|
+
const cw = Math.max(1, Math.ceil(width / 16));
|
|
139
|
+
const ch = Math.max(1, Math.ceil(height / 16));
|
|
140
|
+
const cols = Math.ceil(width / cw);
|
|
141
|
+
const rows = Math.ceil(height / ch);
|
|
142
|
+
const covered = new Uint8Array(cols * rows);
|
|
143
|
+
for (const r of rects) {
|
|
144
|
+
const x1 = Math.min(cols - 1, Math.floor((r.x + r.w - 1) / cw));
|
|
145
|
+
const y1 = Math.min(rows - 1, Math.floor((r.y + r.h - 1) / ch));
|
|
146
|
+
for (let y = Math.floor(r.y / ch); y <= y1; y++)
|
|
147
|
+
for (let x = Math.floor(r.x / cw); x <= x1; x++)
|
|
148
|
+
covered[y * cols + x] = 1;
|
|
149
|
+
}
|
|
150
|
+
const out = [];
|
|
151
|
+
for (let y = 0; y < rows; y++) {
|
|
152
|
+
for (let x = 0; x < cols;) {
|
|
153
|
+
if (!covered[y * cols + x]) {
|
|
154
|
+
x++;
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
const start = x;
|
|
158
|
+
while (x < cols && covered[y * cols + x])
|
|
159
|
+
x++;
|
|
160
|
+
const r = { x: start * cw, y: y * ch, w: (x - start) * cw, h: ch };
|
|
161
|
+
const c = clampToSurface(r, width, height);
|
|
162
|
+
if (c)
|
|
163
|
+
out.push(c);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return out;
|
|
167
|
+
}
|
|
168
|
+
export function planDamage(worldRects, cam, dpr, width, height, opts = {}) {
|
|
169
|
+
const maxRects = opts.maxRects ?? 8;
|
|
170
|
+
const fullAbove = opts.fullAbove ?? 0.6;
|
|
171
|
+
const dev = [];
|
|
172
|
+
for (const r of worldRects) {
|
|
173
|
+
const c = clampToSurface(rectSnapOut(worldToDeviceRect(r, cam, dpr)), width, height);
|
|
174
|
+
if (c)
|
|
175
|
+
dev.push(c);
|
|
176
|
+
}
|
|
177
|
+
if (dev.length === 0)
|
|
178
|
+
return { rects: [], full: false, coverage: 0 };
|
|
179
|
+
let rects = mergeRects(dev);
|
|
180
|
+
if (rects.length > maxRects)
|
|
181
|
+
rects = [rects.reduce((a, b) => rectUnion(a, b))];
|
|
182
|
+
let coverage = 0;
|
|
183
|
+
for (const r of rects)
|
|
184
|
+
coverage += r.w * r.h;
|
|
185
|
+
const full = coverage / (width * height) > fullAbove;
|
|
186
|
+
return { rects, full, coverage };
|
|
187
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { Renderer, TextLayoutSpec } from "../renderer/Renderer.js";
|
|
2
|
+
import { type FontManifest, type HanLocale } from "./manifest.js";
|
|
3
|
+
export interface FontFace {
|
|
4
|
+
family: string;
|
|
5
|
+
weight?: number;
|
|
6
|
+
italic?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ResolvedText {
|
|
9
|
+
spec: TextLayoutSpec;
|
|
10
|
+
pending: readonly string[];
|
|
11
|
+
uncovered: readonly number[];
|
|
12
|
+
}
|
|
13
|
+
export interface FontRegistryOptions {
|
|
14
|
+
manifest?: FontManifest;
|
|
15
|
+
url?: (file: string, sha256: string) => string;
|
|
16
|
+
han?: readonly HanLocale[];
|
|
17
|
+
deferLoads?: boolean;
|
|
18
|
+
maxInFlight?: number;
|
|
19
|
+
fetchTimeoutMs?: number;
|
|
20
|
+
minBytesPerSecond?: number;
|
|
21
|
+
onError?: (file: string, err: unknown) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface FontRegistryStats {
|
|
24
|
+
faces: number;
|
|
25
|
+
loaded: number;
|
|
26
|
+
loading: number;
|
|
27
|
+
failed: number;
|
|
28
|
+
bytesLoaded: number;
|
|
29
|
+
detailsLoaded: number;
|
|
30
|
+
requests: number;
|
|
31
|
+
}
|
|
32
|
+
export interface FontLoadFailure {
|
|
33
|
+
key: string;
|
|
34
|
+
file: string;
|
|
35
|
+
error: unknown;
|
|
36
|
+
}
|
|
37
|
+
export interface PreparedFonts {
|
|
38
|
+
pending: readonly string[];
|
|
39
|
+
failures: readonly FontLoadFailure[];
|
|
40
|
+
}
|
|
41
|
+
export type FetchFontBytes = (url: string, signal?: AbortSignal, onProgress?: (receivedBytes: number) => void) => Promise<Uint8Array> | Uint8Array;
|
|
42
|
+
export declare class FontRegistry {
|
|
43
|
+
private readonly renderer;
|
|
44
|
+
private readonly fetchBytes;
|
|
45
|
+
private disposed;
|
|
46
|
+
private readonly abortLoads;
|
|
47
|
+
private detachRenderer;
|
|
48
|
+
private loaded;
|
|
49
|
+
private colorFamilies;
|
|
50
|
+
private inflight;
|
|
51
|
+
private listeners;
|
|
52
|
+
fallbacks: string[];
|
|
53
|
+
private readonly manifest;
|
|
54
|
+
private readonly opts;
|
|
55
|
+
private readonly groups;
|
|
56
|
+
private readonly byFamily;
|
|
57
|
+
private readonly defaultGroup;
|
|
58
|
+
private readonly han;
|
|
59
|
+
private readonly chains;
|
|
60
|
+
private analyses;
|
|
61
|
+
private lruOldest;
|
|
62
|
+
private lruNewest;
|
|
63
|
+
private analysisRevision;
|
|
64
|
+
private analysisCount;
|
|
65
|
+
private analysisBytes;
|
|
66
|
+
private oversized;
|
|
67
|
+
private oversizedUsed;
|
|
68
|
+
private resolves;
|
|
69
|
+
private faceMemo;
|
|
70
|
+
private emojiMemo;
|
|
71
|
+
private queue;
|
|
72
|
+
private inFlight;
|
|
73
|
+
private idleWaiters;
|
|
74
|
+
private keyWaiters;
|
|
75
|
+
private demand;
|
|
76
|
+
private retryTimer;
|
|
77
|
+
private counters;
|
|
78
|
+
private failures;
|
|
79
|
+
constructor(renderer: Renderer, fetchBytes: FetchFontBytes, options?: FontRegistryOptions);
|
|
80
|
+
dispose(): void;
|
|
81
|
+
private fetchUntilDisposed;
|
|
82
|
+
registerBytes(family: string, bytes: Uint8Array): void;
|
|
83
|
+
load(family: string, url: string): Promise<void>;
|
|
84
|
+
has(family: string): boolean;
|
|
85
|
+
families(): string[];
|
|
86
|
+
isLoaded(key: string): boolean;
|
|
87
|
+
onLoaded(l: (family: string) => void): () => void;
|
|
88
|
+
ready(): Promise<void>;
|
|
89
|
+
resolve(spec: TextLayoutSpec): ResolvedText;
|
|
90
|
+
private isKnownFamily;
|
|
91
|
+
private isColorFamily;
|
|
92
|
+
private coversRun;
|
|
93
|
+
private safeNonEmojiRun;
|
|
94
|
+
private colorBidiRuns;
|
|
95
|
+
private paragraphRuns;
|
|
96
|
+
private emojiRuns;
|
|
97
|
+
private paragraphSegments;
|
|
98
|
+
private shapingBlockRuns;
|
|
99
|
+
private primaryFace;
|
|
100
|
+
private analyze;
|
|
101
|
+
private cachedAnalysis;
|
|
102
|
+
private cacheAnalysis;
|
|
103
|
+
private linkAnalysis;
|
|
104
|
+
private unlinkAnalysis;
|
|
105
|
+
private forgetAnalysis;
|
|
106
|
+
private dropAnalyses;
|
|
107
|
+
private chain;
|
|
108
|
+
private need;
|
|
109
|
+
private emojiBaseFace;
|
|
110
|
+
private emojiFaceFor;
|
|
111
|
+
private want;
|
|
112
|
+
private wantDetail;
|
|
113
|
+
private enqueue;
|
|
114
|
+
retry(pending: readonly string[]): void;
|
|
115
|
+
retainPending(pending: readonly string[]): () => void;
|
|
116
|
+
private scheduleRetry;
|
|
117
|
+
private static retryAfterDelay;
|
|
118
|
+
private retryDue;
|
|
119
|
+
private jobKey;
|
|
120
|
+
private file;
|
|
121
|
+
private url;
|
|
122
|
+
private pump;
|
|
123
|
+
private fetchWithDeadline;
|
|
124
|
+
private fetchBounded;
|
|
125
|
+
private verify;
|
|
126
|
+
private verifyHash;
|
|
127
|
+
drain(limit?: number): number;
|
|
128
|
+
whenIdle(): Promise<void>;
|
|
129
|
+
private isLoading;
|
|
130
|
+
private whenKeysSettled;
|
|
131
|
+
prepare(specs: Iterable<TextLayoutSpec>): Promise<PreparedFonts>;
|
|
132
|
+
private checkPreparing;
|
|
133
|
+
private prepared;
|
|
134
|
+
private land;
|
|
135
|
+
private fail;
|
|
136
|
+
private settle;
|
|
137
|
+
private setFaces;
|
|
138
|
+
private notify;
|
|
139
|
+
stats(): FontRegistryStats;
|
|
140
|
+
}
|