@babylonjs/lite-gl 1.18.0 → 1.20.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 +31 -0
- package/index.d.ts +13 -0
- package/index.js +7 -0
- package/index.js.map +1 -1
- package/package.json +6 -3
- package/text/_gpu/text-effect.d.ts +1 -0
- package/text/_gpu/text-effect.js +70 -0
- package/text/_gpu/text-effect.js.map +1 -0
- package/text/_gpu/text-instances.d.ts +1 -0
- package/text/_gpu/text-instances.js +57 -0
- package/text/_gpu/text-instances.js.map +1 -0
- package/text/_gpu/text-textures.d.ts +1 -0
- package/text/_gpu/text-textures.js +82 -0
- package/text/_gpu/text-textures.js.map +1 -0
- package/text/_gpu/text-vao.d.ts +1 -0
- package/text/_gpu/text-vao.js +49 -0
- package/text/_gpu/text-vao.js.map +1 -0
- package/text/default-text-data.d.ts +28 -0
- package/text/default-text-data.js +103 -0
- package/text/default-text-data.js.map +1 -0
- package/text/font.d.ts +16 -0
- package/text/font.js +24 -0
- package/text/font.js.map +1 -0
- package/text/glyph-extraction.d.ts +19 -0
- package/text/glyph-extraction.js +115 -0
- package/text/glyph-extraction.js.map +1 -0
- package/text/glyph-storage.d.ts +68 -0
- package/text/glyph-storage.js +298 -0
- package/text/glyph-storage.js.map +1 -0
- package/text/layout.d.ts +18 -0
- package/text/layout.js +219 -0
- package/text/layout.js.map +1 -0
- package/text/set-font-weight-offset.d.ts +5 -0
- package/text/set-font-weight-offset.js +67 -0
- package/text/set-font-weight-offset.js.map +1 -0
- package/text/shaders/slug-shader.d.ts +1 -0
- package/text/shaders/slug-shader.js +181 -0
- package/text/shaders/slug-shader.js.map +1 -0
- package/text/shaders/text-shader-fragment.d.ts +1 -0
- package/text/shaders/text-shader-fragment.js +2 -0
- package/text/shaders/text-shader-fragment.js.map +1 -0
- package/text/shaders/weight-shader-fragment.d.ts +1 -0
- package/text/shaders/weight-shader-fragment.js +75 -0
- package/text/shaders/weight-shader-fragment.js.map +1 -0
- package/text/text-data.d.ts +109 -0
- package/text/text-data.js +723 -0
- package/text/text-data.js.map +1 -0
- package/text/text-renderer.d.ts +68 -0
- package/text/text-renderer.js +238 -0
- package/text/text-renderer.js.map +1 -0
|
@@ -0,0 +1,723 @@
|
|
|
1
|
+
/** GLTextData — slot-allocator-backed per-instance vertex buffer for a text block.
|
|
2
|
+
*
|
|
3
|
+
* Each draw group owns a contiguous slot range `[slotStart, slotStart + slotCount)`
|
|
4
|
+
* in the shared instance buffer. Live and dead slots intermix within that range;
|
|
5
|
+
* dead slots carry an all-ones packed word that the vertex shader detects and turns
|
|
6
|
+
* into a degenerate off-screen triangle. `addRun` / `replaceRun` reuse
|
|
7
|
+
* from the group's `freeSlots` LIFO when possible; otherwise they extend the
|
|
8
|
+
* group's range (shifting later *groups* — never other runs in the same group).
|
|
9
|
+
* `removeRun` writes the sentinel into its slots and returns them to the free-list.
|
|
10
|
+
*
|
|
11
|
+
* Each GLTextData is bound to one `GLGlyphStorage` for its glyph catalog. The storage is
|
|
12
|
+
* borrowed — caller owns its lifetime. `disposeTextData` releases the per-block
|
|
13
|
+
* instance buffer + style texture only.
|
|
14
|
+
*
|
|
15
|
+
* Cost per edit: O(touched glyphs) in the common single-font case, with an extra
|
|
16
|
+
* O(later-group slot count) shift only when the touched group must grow.
|
|
17
|
+
*/
|
|
18
|
+
import { disposeBuffer } from "../mesh.js";
|
|
19
|
+
import { disposeTexture } from "../texture.js";
|
|
20
|
+
/** Floats per instance: the anchor (x, y) plus one packed u32 holding the glyph index in its
|
|
21
|
+
* low 16 bits and the style index in its high 16. Everything else the shader needs is either
|
|
22
|
+
* glyph-invariant — the atlas's `GlyphMetadata` table, indexed by the glyph half — or shared
|
|
23
|
+
* by every glyph drawn at the same color and scale — this GLTextData's style palette, indexed
|
|
24
|
+
* by the style half. Neither is copied per instance. */
|
|
25
|
+
export const TEXT_INSTANCE_FLOATS = 3;
|
|
26
|
+
export const TEXT_INSTANCE_BYTES = TEXT_INSTANCE_FLOATS * 4;
|
|
27
|
+
/** Floats per style-palette entry, matching the WGSL `TextStyle` struct: a `vec4<f32>` color
|
|
28
|
+
* followed by a `vec4<f32>` of params whose `.x` carries the run's `invScale` and whose `.y`
|
|
29
|
+
* carries the optional per-run style parameter (see {@link TextStyleSeam}; 0 when no styling
|
|
30
|
+
* feature is installed). The rest is reserved padding that keeps the struct naturally
|
|
31
|
+
* 16-byte aligned. */
|
|
32
|
+
export const TEXT_STYLE_FLOATS = 8;
|
|
33
|
+
export const TEXT_STYLE_BYTES = TEXT_STYLE_FLOATS * 4;
|
|
34
|
+
/** Value of the packed word marking a slot as dead (skipped by the vertex shader). Both halves
|
|
35
|
+
* are all-ones, which `MAX_PACKED_INDEX` keeps unreachable for a real (glyph, style) pair. */
|
|
36
|
+
const DEAD_GLYPH = 0xffffffff;
|
|
37
|
+
/** Largest glyph or style index representable in a packed half. `0xffff` is reserved so the
|
|
38
|
+
* dead sentinel stays unambiguous. */
|
|
39
|
+
const MAX_PACKED_INDEX = 0xfffe;
|
|
40
|
+
const MAX_STYLE_ENTRIES = MAX_PACKED_INDEX + 1;
|
|
41
|
+
const WHITE_COLOR = [1, 1, 1, 1];
|
|
42
|
+
/** @internal */
|
|
43
|
+
export let _textStyleSeam = null;
|
|
44
|
+
/** @internal Install the styling seam. Called once by the opt-in setter. */
|
|
45
|
+
export function _installTextStyleSeam(seam) {
|
|
46
|
+
_textStyleSeam = seam;
|
|
47
|
+
}
|
|
48
|
+
/** Draw-group key for a run: its curve set unless a styling feature interned another. */
|
|
49
|
+
function runGroupKey(run) {
|
|
50
|
+
return _textStyleSeam?._key(run) ?? run.curveSet;
|
|
51
|
+
}
|
|
52
|
+
// ─── Per-slot packing ──────────────────────────────────────────────────────
|
|
53
|
+
function packGlyphAtSlot(out, outU32, slot, curveSet, glyphId, x, y, styleIdx) {
|
|
54
|
+
// An atlas slot exists only for glyphs that are also in `curveSet._curves` (both maps are
|
|
55
|
+
// written together and never pruned), so this single lookup doubles as the validity check.
|
|
56
|
+
// It yields an index into the atlas's glyph-metadata table; everything glyph-invariant
|
|
57
|
+
// lives there and is never copied into the instance.
|
|
58
|
+
const atlasSlot = curveSet._atlas._glyphSlots.get(glyphId);
|
|
59
|
+
if (!atlasSlot) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
const glyphIdx = atlasSlot._index;
|
|
63
|
+
// Both indices share one u32, so an out-of-range value would silently alias a different
|
|
64
|
+
// glyph or style — or the dead sentinel. Drop the glyph instead; the caller already treats
|
|
65
|
+
// a false return as an atlas miss and retires the slot.
|
|
66
|
+
if (glyphIdx > MAX_PACKED_INDEX || styleIdx > MAX_PACKED_INDEX) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
const w = slot * TEXT_INSTANCE_FLOATS;
|
|
70
|
+
out[w] = x;
|
|
71
|
+
out[w + 1] = y;
|
|
72
|
+
outU32[w + 2] = glyphIdx | (styleIdx << 16);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
function markSlotDead(out, outU32, slot) {
|
|
76
|
+
const base = slot * TEXT_INSTANCE_FLOATS;
|
|
77
|
+
out[base] = 0;
|
|
78
|
+
out[base + 1] = 0;
|
|
79
|
+
outU32[base + 2] = DEAD_GLYPH;
|
|
80
|
+
}
|
|
81
|
+
// ─── Style palette ─────────────────────────────────────────────────────────
|
|
82
|
+
function ensureStyleCapacity(data, requiredEntries) {
|
|
83
|
+
if (requiredEntries > MAX_STYLE_ENTRIES) {
|
|
84
|
+
throw new Error(`GLTextData style palette cannot exceed ${MAX_STYLE_ENTRIES} entries.`);
|
|
85
|
+
}
|
|
86
|
+
const requiredFloats = requiredEntries * TEXT_STYLE_FLOATS;
|
|
87
|
+
if (data._styles.length >= requiredFloats) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
let newLen = Math.max(data._styles.length * 2, TEXT_STYLE_FLOATS);
|
|
91
|
+
while (newLen < requiredFloats) {
|
|
92
|
+
newLen *= 2;
|
|
93
|
+
}
|
|
94
|
+
newLen = Math.min(newLen, MAX_STYLE_ENTRIES * TEXT_STYLE_FLOATS);
|
|
95
|
+
const grown = new Float32Array(newLen);
|
|
96
|
+
grown.set(data._styles);
|
|
97
|
+
data._styles = grown;
|
|
98
|
+
}
|
|
99
|
+
/** Palette entries a run needs: one shared default plus one per glyph carrying its own `color`.
|
|
100
|
+
* Overrides are deliberately not deduplicated — a dedicated entry per override glyph lets the
|
|
101
|
+
* write loop hand them out in glyph order instead of searching the palette, and even the
|
|
102
|
+
* pathological all-override case costs less per glyph (12 B instance + 32 B entry) than the
|
|
103
|
+
* 80 B instances this format replaced. */
|
|
104
|
+
function countRunStyles(run) {
|
|
105
|
+
const glyphs = run.glyphs;
|
|
106
|
+
let n = 1;
|
|
107
|
+
for (let i = 0; i < glyphs.length; i++) {
|
|
108
|
+
if (glyphs[i].color !== undefined) {
|
|
109
|
+
n++;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return n;
|
|
113
|
+
}
|
|
114
|
+
function releaseStyles(data, slots) {
|
|
115
|
+
for (let i = 0; i < slots.length; i++) {
|
|
116
|
+
data._freeStyleSlots.push(slots[i]);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function allocateStyles(data, count, previous) {
|
|
120
|
+
if (previous?.length === count) {
|
|
121
|
+
return previous;
|
|
122
|
+
}
|
|
123
|
+
const free = data._freeStyleSlots;
|
|
124
|
+
const needed = Math.max(0, count - free.length - (previous?.length ?? 0));
|
|
125
|
+
ensureStyleCapacity(data, data._styleCount + needed);
|
|
126
|
+
if (previous) {
|
|
127
|
+
releaseStyles(data, previous);
|
|
128
|
+
}
|
|
129
|
+
const highWater = data._styleCount;
|
|
130
|
+
const slots = new Array(count);
|
|
131
|
+
for (let i = 0; i < count; i++) {
|
|
132
|
+
slots[i] = free.pop() ?? data._styleCount++;
|
|
133
|
+
}
|
|
134
|
+
// Growing past the high-water mark lengthens the upload, and `ensureStyleGpu` only uploads
|
|
135
|
+
// when the version moved — so the bump cannot be left to `writeStyle`, which stays silent for
|
|
136
|
+
// an entry whose contents already match (an all-zero style writes nothing). Slots taken from
|
|
137
|
+
// the free list keep the upload length unchanged, so there `writeStyle` alone is enough.
|
|
138
|
+
if (data._styleCount !== highWater) {
|
|
139
|
+
data._styleVersion++;
|
|
140
|
+
}
|
|
141
|
+
return slots;
|
|
142
|
+
}
|
|
143
|
+
/** Write one palette entry, bumping `_styleVersion` only when the entry's contents actually
|
|
144
|
+
* change. Comparing against the `Math.fround` of each value rather than the value itself is
|
|
145
|
+
* what makes that check meaningful: the palette stores float32, so a double like `1 / 13.3`
|
|
146
|
+
* never compares equal to its own stored form and every frame would look like a change. */
|
|
147
|
+
function writeStyle(data, entry, color, invScale, styleParam) {
|
|
148
|
+
const w = entry * TEXT_STYLE_FLOATS;
|
|
149
|
+
const s = data._styles;
|
|
150
|
+
const r = Math.fround(color[0]);
|
|
151
|
+
const g = Math.fround(color[1]);
|
|
152
|
+
const b = Math.fround(color[2]);
|
|
153
|
+
const a = Math.fround(color[3]);
|
|
154
|
+
const iv = Math.fround(invScale);
|
|
155
|
+
const sp = Math.fround(styleParam);
|
|
156
|
+
if (s[w] === r && s[w + 1] === g && s[w + 2] === b && s[w + 3] === a && s[w + 4] === iv && s[w + 5] === sp) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
s[w] = r;
|
|
160
|
+
s[w + 1] = g;
|
|
161
|
+
s[w + 2] = b;
|
|
162
|
+
s[w + 3] = a;
|
|
163
|
+
s[w + 4] = iv;
|
|
164
|
+
s[w + 5] = sp;
|
|
165
|
+
data._styleVersion++;
|
|
166
|
+
}
|
|
167
|
+
// ─── Buffer + dirty-range helpers ──────────────────────────────────────────
|
|
168
|
+
function ensureInstanceCapacity(data, requiredInstances) {
|
|
169
|
+
const requiredFloats = requiredInstances * TEXT_INSTANCE_FLOATS;
|
|
170
|
+
if (data._instances.length >= requiredFloats) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
let newLen = Math.max(data._instances.length * 2, TEXT_INSTANCE_FLOATS);
|
|
174
|
+
while (newLen < requiredFloats) {
|
|
175
|
+
newLen *= 2;
|
|
176
|
+
}
|
|
177
|
+
const grown = new Float32Array(newLen);
|
|
178
|
+
grown.set(data._instances.subarray(0, data._instanceCount * TEXT_INSTANCE_FLOATS));
|
|
179
|
+
data._instances = grown;
|
|
180
|
+
data._instancesU32 = new Uint32Array(grown.buffer);
|
|
181
|
+
data._dirtyStart = 0;
|
|
182
|
+
data._dirtyEnd = data._instanceCount;
|
|
183
|
+
}
|
|
184
|
+
function markDirty(data, startInstance, endInstance) {
|
|
185
|
+
if (endInstance <= startInstance) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (data._dirtyStart === data._dirtyEnd) {
|
|
189
|
+
data._dirtyStart = startInstance;
|
|
190
|
+
data._dirtyEnd = endInstance;
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
if (startInstance < data._dirtyStart) {
|
|
194
|
+
data._dirtyStart = startInstance;
|
|
195
|
+
}
|
|
196
|
+
if (endInstance > data._dirtyEnd) {
|
|
197
|
+
data._dirtyEnd = endInstance;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
data._version++;
|
|
201
|
+
}
|
|
202
|
+
// ─── Slot allocator ────────────────────────────────────────────────────────
|
|
203
|
+
/** Pop a slot from `group._freeSlots`, or -1 if none. */
|
|
204
|
+
function popFreeSlot(group) {
|
|
205
|
+
return group._freeSlots.length > 0 ? group._freeSlots.pop() : -1;
|
|
206
|
+
}
|
|
207
|
+
/** Shift every group `slotStart` / freeSlot / run-record slot at or after `threshold` by
|
|
208
|
+
* `delta` (positive to open a gap, negative to close one). `exclude` — a group being grown
|
|
209
|
+
* in place — is skipped so its own range isn't shifted; run-record slots are always shifted. */
|
|
210
|
+
function shiftSlotsAtOrAfter(data, threshold, delta, exclude) {
|
|
211
|
+
for (const g of data._groups) {
|
|
212
|
+
if (g !== exclude && g._slotStart >= threshold) {
|
|
213
|
+
g._slotStart += delta;
|
|
214
|
+
for (let i = 0; i < g._freeSlots.length; i++) {
|
|
215
|
+
g._freeSlots[i] = g._freeSlots[i] + delta;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
for (const rec of data._runRecords.values()) {
|
|
220
|
+
const slots = rec._slots;
|
|
221
|
+
for (let i = 0; i < slots.length; i++) {
|
|
222
|
+
if (slots[i] >= threshold) {
|
|
223
|
+
slots[i] = slots[i] + delta;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
// Slot ranges moved — cached vertex arrays keyed on `_layoutVersion` must rebuild.
|
|
228
|
+
data._layoutVersion++;
|
|
229
|
+
}
|
|
230
|
+
/** Grow `group` by `extraSlots`. Returns the absolute index of the first newly-added
|
|
231
|
+
* slot. Shifts later groups' slot ranges right by `extraSlots` and rewrites any run
|
|
232
|
+
* slot indices that fall in the shifted range. Marks the shifted region dirty. */
|
|
233
|
+
function growGroup(data, group, extraSlots) {
|
|
234
|
+
const insertAt = group._slotStart + group._slotCount;
|
|
235
|
+
if (extraSlots <= 0) {
|
|
236
|
+
return insertAt;
|
|
237
|
+
}
|
|
238
|
+
ensureInstanceCapacity(data, data._instanceCount + extraSlots);
|
|
239
|
+
const floatDelta = extraSlots * TEXT_INSTANCE_FLOATS;
|
|
240
|
+
const moveStartFloat = insertAt * TEXT_INSTANCE_FLOATS;
|
|
241
|
+
const moveEndFloat = data._instanceCount * TEXT_INSTANCE_FLOATS;
|
|
242
|
+
if (moveEndFloat > moveStartFloat) {
|
|
243
|
+
data._instances.copyWithin(moveStartFloat + floatDelta, moveStartFloat, moveEndFloat);
|
|
244
|
+
}
|
|
245
|
+
// Shift later groups (and their runs) right to open the gap for the new slots.
|
|
246
|
+
shiftSlotsAtOrAfter(data, insertAt, extraSlots, group);
|
|
247
|
+
data._instanceCount += extraSlots;
|
|
248
|
+
group._slotCount += extraSlots;
|
|
249
|
+
// Newly-added slots and the shifted region are dirty.
|
|
250
|
+
markDirty(data, insertAt, data._instanceCount);
|
|
251
|
+
return insertAt;
|
|
252
|
+
}
|
|
253
|
+
/** Allocate `count` slots for `group`. Reuses free slots first, then extends. Returns
|
|
254
|
+
* the array of absolute slot indices in ascending order. */
|
|
255
|
+
function allocateSlots(data, group, count) {
|
|
256
|
+
// `.fill` is what keeps this PACKED_SMI_ELEMENTS in V8. A bare `new Array(count)` is
|
|
257
|
+
// holey, and `writeRunToSlots` hands this exact array straight to a run record, so the
|
|
258
|
+
// holeyness would leak into `shiftSlotsAtOrAfter`'s hot per-slot loop and halve its
|
|
259
|
+
// throughput.
|
|
260
|
+
const out = new Array(count).fill(-1);
|
|
261
|
+
// Instances are drawn in slot order, so a run's glyphs have to land on ascending slots or
|
|
262
|
+
// overlapping ones composite in the wrong order. `popFreeSlot` hands reclaimed slots back
|
|
263
|
+
// LIFO, so a block that was just freed comes back reversed. Track that while filling instead
|
|
264
|
+
// of rescanning afterwards, and sort only when it actually happened: `sort` runs a comparator
|
|
265
|
+
// call per element even on already-ordered input, which is pure overhead on the common path.
|
|
266
|
+
let sorted = true;
|
|
267
|
+
let prevSlot = -1;
|
|
268
|
+
let reused = count;
|
|
269
|
+
for (let i = 0; i < count; i++) {
|
|
270
|
+
const slot = popFreeSlot(group);
|
|
271
|
+
// Nothing refills the free list mid-loop, so the rest of `out` comes from the extension.
|
|
272
|
+
if (slot === -1) {
|
|
273
|
+
reused = i;
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
out[i] = slot;
|
|
277
|
+
sorted &&= slot >= prevSlot;
|
|
278
|
+
prevSlot = slot;
|
|
279
|
+
}
|
|
280
|
+
if (reused < count) {
|
|
281
|
+
const firstNewSlot = growGroup(data, group, count - reused);
|
|
282
|
+
// Extension slots are appended past the group's tail and ascend from there, so only the
|
|
283
|
+
// seam against the reused prefix can be out of order.
|
|
284
|
+
sorted &&= firstNewSlot >= prevSlot;
|
|
285
|
+
for (let i = reused, n = firstNewSlot; i < count; i++) {
|
|
286
|
+
out[i] = n++;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (!sorted) {
|
|
290
|
+
out.sort(ascendingSlot);
|
|
291
|
+
}
|
|
292
|
+
return out;
|
|
293
|
+
}
|
|
294
|
+
function ascendingSlot(a, b) {
|
|
295
|
+
return a - b;
|
|
296
|
+
}
|
|
297
|
+
/** Release `slots` back to `group._freeSlots`, marking each dead in the buffer. */
|
|
298
|
+
function freeSlots(data, group, slots) {
|
|
299
|
+
let minSlot = Number.POSITIVE_INFINITY;
|
|
300
|
+
let maxSlot = -1;
|
|
301
|
+
for (const s of slots) {
|
|
302
|
+
markSlotDead(data._instances, data._instancesU32, s);
|
|
303
|
+
group._freeSlots.push(s);
|
|
304
|
+
if (s < minSlot) {
|
|
305
|
+
minSlot = s;
|
|
306
|
+
}
|
|
307
|
+
if (s > maxSlot) {
|
|
308
|
+
maxSlot = s;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (maxSlot >= 0) {
|
|
312
|
+
markDirty(data, minSlot, maxSlot + 1);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
// ─── Draw-group helpers ────────────────────────────────────────────────────
|
|
316
|
+
function findGroup(data, groupKey) {
|
|
317
|
+
for (const g of data._groups) {
|
|
318
|
+
if (g._groupKey === groupKey) {
|
|
319
|
+
return g;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return undefined;
|
|
323
|
+
}
|
|
324
|
+
function lookupCurveSet(storage, curveSetId, op) {
|
|
325
|
+
const cs = storage._curveSets.get(curveSetId);
|
|
326
|
+
if (!cs) {
|
|
327
|
+
throw new Error(`updateTextData ${op}: storage does not contain curveSet "${curveSetId}" — add it via updateGlyphStorage first.`);
|
|
328
|
+
}
|
|
329
|
+
return cs;
|
|
330
|
+
}
|
|
331
|
+
/** Build a fresh draw group for `groupKey` starting at absolute slot `slotStart`. */
|
|
332
|
+
function makeDrawGroup(curveSetId, curveSet, slotStart, groupKey) {
|
|
333
|
+
return {
|
|
334
|
+
_curveSetId: curveSetId,
|
|
335
|
+
_curveSet: curveSet,
|
|
336
|
+
_slotStart: slotStart,
|
|
337
|
+
_slotCount: 0,
|
|
338
|
+
_liveCount: 0,
|
|
339
|
+
_freeSlots: [],
|
|
340
|
+
_groupKey: groupKey,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
function ensureGroup(data, curveSetId, groupKey) {
|
|
344
|
+
const existing = findGroup(data, groupKey);
|
|
345
|
+
if (existing) {
|
|
346
|
+
return existing;
|
|
347
|
+
}
|
|
348
|
+
const curveSet = lookupCurveSet(data._storage, curveSetId, "addRun");
|
|
349
|
+
const group = makeDrawGroup(curveSetId, curveSet, data._instanceCount, groupKey);
|
|
350
|
+
data._groups.push(group);
|
|
351
|
+
return group;
|
|
352
|
+
}
|
|
353
|
+
/** Write a run's glyphs into the given (already-allocated) instance and style slots.
|
|
354
|
+
* Returns the subset of instance slots that actually received
|
|
355
|
+
* live glyphs (skipped glyphs leave their slot dead). When every glyph lands — the
|
|
356
|
+
* overwhelmingly common case — that subset *is* `slots`, and the caller gets the same array
|
|
357
|
+
* back rather than a freshly built copy. */
|
|
358
|
+
function writeRunToSlots(data, group, run, slots, styleSlots) {
|
|
359
|
+
const ratio = run.pixelsPerFontUnit;
|
|
360
|
+
const invScale = ratio !== 0 ? 1 / ratio : 0;
|
|
361
|
+
const styleParam = _textStyleSeam?._param(run) ?? 0;
|
|
362
|
+
const defaultStyle = styleSlots[0];
|
|
363
|
+
writeStyle(data, defaultStyle, run.defaultColor ?? WHITE_COLOR, invScale, styleParam);
|
|
364
|
+
let overrideEntry = 0;
|
|
365
|
+
// Materialized only once a glyph actually misses the atlas, seeded with the prefix that
|
|
366
|
+
// did land; while it stays null, `slots` is by definition the live set.
|
|
367
|
+
let liveSlots = null;
|
|
368
|
+
let minSlot = Number.POSITIVE_INFINITY;
|
|
369
|
+
let maxSlot = -1;
|
|
370
|
+
for (let i = 0; i < run.glyphs.length; i++) {
|
|
371
|
+
const pg = run.glyphs[i];
|
|
372
|
+
const slot = slots[i];
|
|
373
|
+
let styleIdx = defaultStyle;
|
|
374
|
+
const color = pg.color;
|
|
375
|
+
if (color !== undefined) {
|
|
376
|
+
styleIdx = styleSlots[++overrideEntry];
|
|
377
|
+
writeStyle(data, styleIdx, color, invScale, styleParam);
|
|
378
|
+
}
|
|
379
|
+
const ok = packGlyphAtSlot(data._instances, data._instancesU32, slot, group._curveSet, pg.glyphId, pg.x, pg.y, styleIdx);
|
|
380
|
+
if (!ok) {
|
|
381
|
+
if (liveSlots === null) {
|
|
382
|
+
liveSlots = slots.slice(0, i);
|
|
383
|
+
}
|
|
384
|
+
markSlotDead(data._instances, data._instancesU32, slot);
|
|
385
|
+
group._freeSlots.push(slot);
|
|
386
|
+
}
|
|
387
|
+
else if (liveSlots !== null) {
|
|
388
|
+
liveSlots.push(slot);
|
|
389
|
+
}
|
|
390
|
+
if (slot < minSlot) {
|
|
391
|
+
minSlot = slot;
|
|
392
|
+
}
|
|
393
|
+
if (slot > maxSlot) {
|
|
394
|
+
maxSlot = slot;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
if (maxSlot >= 0) {
|
|
398
|
+
markDirty(data, minSlot, maxSlot + 1);
|
|
399
|
+
}
|
|
400
|
+
return liveSlots ?? slots;
|
|
401
|
+
}
|
|
402
|
+
// ─── reset (also serves as compaction) ─────────────────────────────────────
|
|
403
|
+
function applyReset(data, runs, storage) {
|
|
404
|
+
// Pre-reserve capacity for total glyphs across all runs.
|
|
405
|
+
let totalGlyphs = 0;
|
|
406
|
+
let totalStyles = 0;
|
|
407
|
+
for (const run of runs) {
|
|
408
|
+
totalGlyphs += run.glyphs.length;
|
|
409
|
+
totalStyles += countRunStyles(run);
|
|
410
|
+
}
|
|
411
|
+
ensureStyleCapacity(data, totalStyles);
|
|
412
|
+
const required = totalGlyphs * TEXT_INSTANCE_FLOATS;
|
|
413
|
+
if (data._instances.length < required) {
|
|
414
|
+
let newLen = Math.max(data._instances.length * 2, TEXT_INSTANCE_FLOATS);
|
|
415
|
+
while (newLen < required) {
|
|
416
|
+
newLen *= 2;
|
|
417
|
+
}
|
|
418
|
+
data._instances = new Float32Array(newLen);
|
|
419
|
+
data._instancesU32 = new Uint32Array(data._instances.buffer);
|
|
420
|
+
}
|
|
421
|
+
// Preserve previous groups for group reuse when the draw-group key matches. The key
|
|
422
|
+
// is the run's exact `GLCurveSetId` unless a styling feature interned another token, and it
|
|
423
|
+
// is compared by identity — never a delimited composite string, which would let a curve
|
|
424
|
+
// set whose id already ends in the delimiter+suffix collide with another curve set's
|
|
425
|
+
// variant group.
|
|
426
|
+
const prevGroupByKey = new Map();
|
|
427
|
+
for (const g of data._groups) {
|
|
428
|
+
prevGroupByKey.set(g._groupKey, g);
|
|
429
|
+
}
|
|
430
|
+
data._storage = storage;
|
|
431
|
+
// Group runs by draw-group key so each group's slots are contiguous initially.
|
|
432
|
+
const runsByKey = new Map();
|
|
433
|
+
for (const run of runs) {
|
|
434
|
+
const key = runGroupKey(run);
|
|
435
|
+
let list = runsByKey.get(key);
|
|
436
|
+
if (!list) {
|
|
437
|
+
list = [];
|
|
438
|
+
runsByKey.set(key, list);
|
|
439
|
+
}
|
|
440
|
+
list.push(run);
|
|
441
|
+
}
|
|
442
|
+
const newGroups = [];
|
|
443
|
+
const newRunRecords = new Map();
|
|
444
|
+
let writeSlot = 0;
|
|
445
|
+
// A reset rebuilds the palette densely and drops all free-slot state.
|
|
446
|
+
data._styleCount = 0;
|
|
447
|
+
data._freeStyleSlots.length = 0;
|
|
448
|
+
data._styleVersion++;
|
|
449
|
+
for (const [key, groupRuns] of runsByKey) {
|
|
450
|
+
// Every run in a group shares one curve set: the key is either the curve-set id
|
|
451
|
+
// itself or a token the styling feature interned per curve set.
|
|
452
|
+
const curveSetId = groupRuns[0].curveSet;
|
|
453
|
+
const curveSet = lookupCurveSet(storage, curveSetId, "reset");
|
|
454
|
+
const existing = prevGroupByKey.get(key);
|
|
455
|
+
const group = existing ?? makeDrawGroup(curveSetId, curveSet, writeSlot, key);
|
|
456
|
+
group._curveSet = curveSet;
|
|
457
|
+
group._slotStart = writeSlot;
|
|
458
|
+
group._freeSlots = [];
|
|
459
|
+
const groupIdx = newGroups.length;
|
|
460
|
+
let liveInGroup = 0;
|
|
461
|
+
for (const run of groupRuns) {
|
|
462
|
+
// Packed for the same reason as in `allocateSlots` — this array becomes the run
|
|
463
|
+
// record's slot list.
|
|
464
|
+
const slots = new Array(run.glyphs.length).fill(-1);
|
|
465
|
+
for (let i = 0; i < run.glyphs.length; i++) {
|
|
466
|
+
slots[i] = writeSlot++;
|
|
467
|
+
}
|
|
468
|
+
const styleCount = countRunStyles(run);
|
|
469
|
+
const styleSlots = new Array(styleCount);
|
|
470
|
+
for (let i = 0; i < styleCount; i++) {
|
|
471
|
+
styleSlots[i] = data._styleCount++;
|
|
472
|
+
}
|
|
473
|
+
const live = writeRunToSlots(data, group, run, slots, styleSlots);
|
|
474
|
+
liveInGroup += live.length;
|
|
475
|
+
newRunRecords.set(run, { _run: run, _groupIdx: groupIdx, _slots: live, _styleSlots: styleSlots });
|
|
476
|
+
}
|
|
477
|
+
group._slotCount = writeSlot - group._slotStart;
|
|
478
|
+
group._liveCount = liveInGroup;
|
|
479
|
+
newGroups.push(group);
|
|
480
|
+
}
|
|
481
|
+
data._instanceCount = writeSlot;
|
|
482
|
+
data._groups = newGroups;
|
|
483
|
+
data._runs.length = 0;
|
|
484
|
+
for (const r of runs) {
|
|
485
|
+
data._runs.push(r);
|
|
486
|
+
}
|
|
487
|
+
data._runRecords = newRunRecords;
|
|
488
|
+
data._dirtyStart = 0;
|
|
489
|
+
data._dirtyEnd = writeSlot;
|
|
490
|
+
data._version++;
|
|
491
|
+
data._layoutVersion++;
|
|
492
|
+
}
|
|
493
|
+
// ─── addRun / removeRun / replaceRun ───────────────────────────────────────
|
|
494
|
+
function resolveRun(data, ref) {
|
|
495
|
+
return typeof ref === "number" ? _resolveRunRef(data, ref, "updateTextData") : ref;
|
|
496
|
+
}
|
|
497
|
+
/** @internal Resolve a public `GLGlyphRun | number` reference against `data`'s live runs, so
|
|
498
|
+
* an opt-in per-run feature setter validates its argument exactly the way `updateTextData`
|
|
499
|
+
* does and throws the same shape of message. `op` prefixes that message.
|
|
500
|
+
*
|
|
501
|
+
* Unlike the internal `resolveRun`, an object reference is *checked for membership*: a
|
|
502
|
+
* feature setter is a standalone entry point, so it cannot rely on a caller having already
|
|
503
|
+
* looked the run's record up. `updateTextData`'s index path shares this function, so the
|
|
504
|
+
* index bound check can never drift between the two. */
|
|
505
|
+
export function _resolveRunRef(data, ref, op) {
|
|
506
|
+
if (typeof ref === "number") {
|
|
507
|
+
const r = data._runs[ref];
|
|
508
|
+
if (!r) {
|
|
509
|
+
throw new Error(`${op}: run index ${ref} out of range (0..${data._runs.length - 1}).`);
|
|
510
|
+
}
|
|
511
|
+
return r;
|
|
512
|
+
}
|
|
513
|
+
if (!data._runRecords.has(ref)) {
|
|
514
|
+
throw new Error(`${op}: GLGlyphRun reference is not in this GLTextData.`);
|
|
515
|
+
}
|
|
516
|
+
return ref;
|
|
517
|
+
}
|
|
518
|
+
/** Index of `ref` within `data._runs`, or -1 when it is not present. A numeric ref *is* that
|
|
519
|
+
* index (already range-checked by `resolveRun`), so it costs nothing; only an object ref
|
|
520
|
+
* needs the O(run count) scan — resolve it lazily, and only when the answer is actually used. */
|
|
521
|
+
function resolveRunIndex(data, ref) {
|
|
522
|
+
return typeof ref === "number" ? ref : data._runs.indexOf(ref);
|
|
523
|
+
}
|
|
524
|
+
function applyAddRun(data, run, insertBefore) {
|
|
525
|
+
if (data._runRecords.has(run)) {
|
|
526
|
+
throw new Error("updateTextData addRun: GLGlyphRun reference is already in this GLTextData.");
|
|
527
|
+
}
|
|
528
|
+
const at = insertBefore ?? data._runs.length;
|
|
529
|
+
lookupCurveSet(data._storage, run.curveSet, "addRun");
|
|
530
|
+
const styleSlots = allocateStyles(data, countRunStyles(run));
|
|
531
|
+
const group = ensureGroup(data, run.curveSet, runGroupKey(run));
|
|
532
|
+
const groupIdx = data._groups.indexOf(group);
|
|
533
|
+
const slots = allocateSlots(data, group, run.glyphs.length);
|
|
534
|
+
const live = writeRunToSlots(data, group, run, slots, styleSlots);
|
|
535
|
+
group._liveCount += live.length;
|
|
536
|
+
data._runRecords.set(run, { _run: run, _groupIdx: groupIdx, _slots: live, _styleSlots: styleSlots });
|
|
537
|
+
data._runs.splice(at, 0, run);
|
|
538
|
+
}
|
|
539
|
+
function applyRemoveRun(data, ref) {
|
|
540
|
+
const run = resolveRun(data, ref);
|
|
541
|
+
const rec = data._runRecords.get(run);
|
|
542
|
+
if (!rec) {
|
|
543
|
+
throw new Error("updateTextData removeRun: GLGlyphRun reference is not in this GLTextData.");
|
|
544
|
+
}
|
|
545
|
+
const group = data._groups[rec._groupIdx];
|
|
546
|
+
freeSlots(data, group, rec._slots);
|
|
547
|
+
group._liveCount -= rec._slots.length;
|
|
548
|
+
releaseStyles(data, rec._styleSlots);
|
|
549
|
+
data._runRecords.delete(run);
|
|
550
|
+
const runIdx = resolveRunIndex(data, ref);
|
|
551
|
+
if (runIdx >= 0) {
|
|
552
|
+
data._runs.splice(runIdx, 1);
|
|
553
|
+
}
|
|
554
|
+
// If the group has no live instances left and no remaining run (empty or whitespace-only runs
|
|
555
|
+
// own no slots but still point at their group), drop it and shrink the buffer tail.
|
|
556
|
+
if (group._liveCount === 0 && !isGroupReferenced(data, rec._groupIdx)) {
|
|
557
|
+
dropEmptyGroup(data, group);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
/** True when any remaining run record points at the group at `groupIdx`. */
|
|
561
|
+
function isGroupReferenced(data, groupIdx) {
|
|
562
|
+
for (const r of data._runRecords.values()) {
|
|
563
|
+
if (r._groupIdx === groupIdx) {
|
|
564
|
+
return true;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
return false;
|
|
568
|
+
}
|
|
569
|
+
/** Remove a group with no live instances. Shifts later groups left over the vacated range.
|
|
570
|
+
* The group's borrowed curveSet is left intact — caller owns the GLGlyphStorage lifetime. */
|
|
571
|
+
function dropEmptyGroup(data, group) {
|
|
572
|
+
const idx = data._groups.indexOf(group);
|
|
573
|
+
if (idx < 0) {
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
const removedStart = group._slotStart;
|
|
577
|
+
const removedCount = group._slotCount;
|
|
578
|
+
data._groups.splice(idx, 1);
|
|
579
|
+
// Re-index groupIdx for runs in later groups.
|
|
580
|
+
for (const r of data._runRecords.values()) {
|
|
581
|
+
if (r._groupIdx > idx) {
|
|
582
|
+
r._groupIdx--;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
if (removedCount > 0) {
|
|
586
|
+
const floatDelta = removedCount * TEXT_INSTANCE_FLOATS;
|
|
587
|
+
const moveStartFloat = (removedStart + removedCount) * TEXT_INSTANCE_FLOATS;
|
|
588
|
+
const moveEndFloat = data._instanceCount * TEXT_INSTANCE_FLOATS;
|
|
589
|
+
if (moveEndFloat > moveStartFloat) {
|
|
590
|
+
data._instances.copyWithin(moveStartFloat - floatDelta, moveStartFloat, moveEndFloat);
|
|
591
|
+
}
|
|
592
|
+
// Close the gap left by the removed group (its runs are already gone).
|
|
593
|
+
shiftSlotsAtOrAfter(data, removedStart, -removedCount);
|
|
594
|
+
data._instanceCount -= removedCount;
|
|
595
|
+
markDirty(data, removedStart, data._instanceCount);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
function applyReplaceRun(data, prevRef, newRun) {
|
|
599
|
+
const prev = resolveRun(data, prevRef);
|
|
600
|
+
const rec = data._runRecords.get(prev);
|
|
601
|
+
if (!rec) {
|
|
602
|
+
throw new Error("updateTextData replaceRun: previous GLGlyphRun reference is not in this GLTextData.");
|
|
603
|
+
}
|
|
604
|
+
if (prev !== newRun && data._runRecords.has(newRun)) {
|
|
605
|
+
throw new Error("updateTextData replaceRun: new GLGlyphRun reference is already in this GLTextData.");
|
|
606
|
+
}
|
|
607
|
+
const group = data._groups[rec._groupIdx];
|
|
608
|
+
// Staying in the same draw group means the run keeps its position in `_runs`, so the whole
|
|
609
|
+
// edit reduces to slot bookkeeping — no list splices, and no index scan to drive them. An
|
|
610
|
+
// empty new run is the one exception: it can leave the group with nothing live, and only
|
|
611
|
+
// the remove path knows how to retire a group.
|
|
612
|
+
if (runGroupKey(newRun) === group._groupKey && newRun.glyphs.length > 0) {
|
|
613
|
+
const styleSlots = allocateStyles(data, countRunStyles(newRun), rec._styleSlots);
|
|
614
|
+
const prevSlotCount = rec._slots.length;
|
|
615
|
+
let slots = rec._slots;
|
|
616
|
+
if (newRun.glyphs.length !== prevSlotCount) {
|
|
617
|
+
// Glyph count changed, so this run hands its slots back to the group's free list and
|
|
618
|
+
// takes a fresh block. It reclaims most of them immediately — the allocator pops the
|
|
619
|
+
// slots it just freed — so the write stays within roughly the same buffer range.
|
|
620
|
+
freeSlots(data, group, slots);
|
|
621
|
+
slots = allocateSlots(data, group, newRun.glyphs.length);
|
|
622
|
+
}
|
|
623
|
+
const live = writeRunToSlots(data, group, newRun, slots, styleSlots);
|
|
624
|
+
// Absorbs both a changed glyph count and any glyph that missed the atlas.
|
|
625
|
+
group._liveCount += live.length - prevSlotCount;
|
|
626
|
+
if (prev === newRun) {
|
|
627
|
+
// In-place glyph edits: the record and `_runs` already point at this run, so its
|
|
628
|
+
// live instance and style slot lists are the only things that can have moved.
|
|
629
|
+
rec._slots = live;
|
|
630
|
+
rec._styleSlots = styleSlots;
|
|
631
|
+
}
|
|
632
|
+
else {
|
|
633
|
+
data._runRecords.delete(prev);
|
|
634
|
+
data._runRecords.set(newRun, { _run: newRun, _groupIdx: rec._groupIdx, _slots: live, _styleSlots: styleSlots });
|
|
635
|
+
const runIdx = resolveRunIndex(data, prevRef);
|
|
636
|
+
if (runIdx >= 0) {
|
|
637
|
+
data._runs[runIdx] = newRun;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
// Different curve set, or an empty replacement → remove + add at the same position.
|
|
643
|
+
const insertPos = resolveRunIndex(data, prevRef);
|
|
644
|
+
lookupCurveSet(data._storage, newRun.curveSet, "replaceRun");
|
|
645
|
+
if (countRunStyles(newRun) > data._freeStyleSlots.length + rec._styleSlots.length + MAX_STYLE_ENTRIES - data._styleCount) {
|
|
646
|
+
throw new Error(`GLTextData style palette cannot exceed ${MAX_STYLE_ENTRIES} entries.`);
|
|
647
|
+
}
|
|
648
|
+
applyRemoveRun(data, insertPos >= 0 ? insertPos : prev);
|
|
649
|
+
applyAddRun(data, newRun, insertPos >= 0 ? insertPos : undefined);
|
|
650
|
+
}
|
|
651
|
+
// ─── Public API ────────────────────────────────────────────────────────────
|
|
652
|
+
/** Create a GLTextData bound to `storage`. If `runs` is omitted the GLTextData starts empty;
|
|
653
|
+
* runs can be appended later via `updateTextData({ update: "addRun", … })`. */
|
|
654
|
+
export function createTextData(storage, runs) {
|
|
655
|
+
const runsArray = [];
|
|
656
|
+
const instances = new Float32Array(TEXT_INSTANCE_FLOATS);
|
|
657
|
+
const data = {
|
|
658
|
+
_gpu: null,
|
|
659
|
+
runs: runsArray,
|
|
660
|
+
_runs: runsArray,
|
|
661
|
+
_groups: [],
|
|
662
|
+
_runRecords: new Map(),
|
|
663
|
+
_instances: instances,
|
|
664
|
+
_instancesU32: new Uint32Array(instances.buffer),
|
|
665
|
+
_instanceCount: 0,
|
|
666
|
+
_styles: new Float32Array(TEXT_STYLE_FLOATS),
|
|
667
|
+
_styleCount: 0,
|
|
668
|
+
_freeStyleSlots: [],
|
|
669
|
+
_styleVersion: 1,
|
|
670
|
+
_storage: storage,
|
|
671
|
+
_version: 1,
|
|
672
|
+
_layoutVersion: 0,
|
|
673
|
+
_dirtyStart: 0,
|
|
674
|
+
_dirtyEnd: 0,
|
|
675
|
+
};
|
|
676
|
+
if (runs && runs.length > 0) {
|
|
677
|
+
applyReset(data, runs, storage);
|
|
678
|
+
}
|
|
679
|
+
return data;
|
|
680
|
+
}
|
|
681
|
+
/** Apply an incremental edit to a `GLTextData`, such as adding, removing, replacing, or compacting runs.
|
|
682
|
+
*
|
|
683
|
+
* @param data - Text data block to update.
|
|
684
|
+
* @param update - Discriminated update operation to apply. */
|
|
685
|
+
export function updateTextData(data, update) {
|
|
686
|
+
switch (update.update) {
|
|
687
|
+
case "reset": {
|
|
688
|
+
// Defaults for compaction: keep current runs (defensive copy — applyReset
|
|
689
|
+
// mutates data._runs in place) and current storage.
|
|
690
|
+
const runs = update.runs ?? data._runs.slice();
|
|
691
|
+
const storage = update.storage ?? data._storage;
|
|
692
|
+
applyReset(data, runs, storage);
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
case "addRun":
|
|
696
|
+
applyAddRun(data, update.run, update.insertBefore);
|
|
697
|
+
return;
|
|
698
|
+
case "removeRun":
|
|
699
|
+
applyRemoveRun(data, update.run);
|
|
700
|
+
return;
|
|
701
|
+
case "replaceRun":
|
|
702
|
+
applyReplaceRun(data, update.previous, update.run);
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
/** Release per-block GPU resources owned by `data`. Does NOT dispose the bound
|
|
707
|
+
* `GLGlyphStorage` — caller owns its lifetime and must dispose it separately via
|
|
708
|
+
* `disposeGlyphStorage` once no `GLTextData` references it. */
|
|
709
|
+
export function disposeTextData(data) {
|
|
710
|
+
const gpu = data._gpu;
|
|
711
|
+
if (gpu) {
|
|
712
|
+
disposeBuffer(gpu._engine, gpu._instanceBuf);
|
|
713
|
+
disposeTexture(gpu._engine, gpu._styleTex);
|
|
714
|
+
data._gpu = null;
|
|
715
|
+
}
|
|
716
|
+
data._groups = [];
|
|
717
|
+
data._instanceCount = 0;
|
|
718
|
+
data._styleCount = 0;
|
|
719
|
+
data._freeStyleSlots.length = 0;
|
|
720
|
+
data._runs.length = 0;
|
|
721
|
+
data._runRecords.clear();
|
|
722
|
+
}
|
|
723
|
+
//# sourceMappingURL=text-data.js.map
|