@flighthq/bitmaptext 0.5.0-next.1944.cd6b6e7 → 0.5.1-edge.1019.1274ec5
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 +2 -2
- package/dist/bitmapText.d.ts +7 -1
- package/dist/bitmapText.d.ts.map +1 -1
- package/dist/bitmapText.js +46 -8
- package/dist/bitmapText.js.map +1 -1
- package/dist/contract.d.ts +3 -0
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +3 -0
- package/dist/contract.js.map +1 -1
- package/dist/enableBitmapTextGuards.d.ts +20 -0
- package/dist/enableBitmapTextGuards.d.ts.map +1 -0
- package/dist/enableBitmapTextGuards.js +44 -0
- package/dist/enableBitmapTextGuards.js.map +1 -0
- package/dist/explainBitmapTextMissingGlyphs.d.ts +3 -0
- package/dist/explainBitmapTextMissingGlyphs.d.ts.map +1 -0
- package/dist/explainBitmapTextMissingGlyphs.js +21 -0
- package/dist/explainBitmapTextMissingGlyphs.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/updateBitmapText.d.ts +6 -0
- package/dist/updateBitmapText.d.ts.map +1 -1
- package/dist/updateBitmapText.js +215 -81
- package/dist/updateBitmapText.js.map +1 -1
- package/package.json +9 -7
- package/src/bitmapText.test.ts +124 -8
- package/src/enableBitmapTextGuards.test.ts +119 -0
- package/src/explainBitmapTextMissingGlyphs.test.ts +57 -0
- package/src/updateBitmapText.test.ts +354 -23
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/bitmaptext`. The `@f
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/bitmaptext@0.5.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/bitmaptext@0.5.1-edge.1019.1274ec5](https://github.com/flighthq/flight/tree/1274ec5c923947dc64d5ffedcbd8169fc758cd9f/packages/bitmaptext)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/1274ec5c923947dc64d5ffedcbd8169fc758cd9f/LICENSE.md)
|
package/dist/bitmapText.d.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import type { BitmapText, BitmapTextAlign, BitmapTextData, BitmapTextOptions, BitmapTextPage, BitmapTextRuntime, GlyphSource, Rectangle } from '@flighthq/types/contract';
|
|
1
|
+
import type { BitmapText, BitmapTextAlign, BitmapTextData, BitmapTextOptions, BitmapTextPage, BitmapTextRuntime, EntityConstruction, GlyphSource, Rectangle } from '@flighthq/types/contract';
|
|
2
2
|
export declare function computeBitmapTextLocalBoundsRectangle(out: Rectangle, source: Readonly<BitmapText>): void;
|
|
3
3
|
export declare function createBitmapText(glyphSource: GlyphSource | null, options?: Readonly<BitmapTextOptions>): BitmapText;
|
|
4
4
|
export declare function createBitmapTextData(data?: Readonly<Partial<BitmapTextData>>): BitmapTextData;
|
|
5
5
|
export declare function createBitmapTextRuntime(): BitmapTextRuntime;
|
|
6
6
|
export declare function getBitmapTextBounds(source: Readonly<BitmapText>): Rectangle;
|
|
7
|
+
export declare function getBitmapTextLineCount(source: Readonly<BitmapText>): number;
|
|
7
8
|
export declare function getBitmapTextPages(source: Readonly<BitmapText>): readonly BitmapTextPage[];
|
|
9
|
+
export declare function initializeBitmapTextData(out: EntityConstruction<BitmapTextData>, data?: Readonly<Partial<BitmapTextData>>): void;
|
|
10
|
+
export declare function isBitmapTextGlyphLayoutStale(source: Readonly<BitmapText>): boolean;
|
|
11
|
+
export declare function isBitmapTextTruncated(source: Readonly<BitmapText>): boolean;
|
|
8
12
|
export declare function reserveBitmapText(target: BitmapText, glyphCapacity: number): void;
|
|
9
13
|
export declare function setBitmapTextAlign(target: BitmapText, align: BitmapTextAlign): void;
|
|
14
|
+
export declare function setBitmapTextEllipsis(target: BitmapText, ellipsis: string): void;
|
|
10
15
|
export declare function setBitmapTextGlyphSource(target: BitmapText, glyphSource: GlyphSource | null): void;
|
|
11
16
|
export declare function setBitmapTextLetterSpacing(target: BitmapText, letterSpacing: number): void;
|
|
12
17
|
export declare function setBitmapTextLineHeight(target: BitmapText, lineHeight: number): void;
|
|
18
|
+
export declare function setBitmapTextMaxLines(target: BitmapText, maxLines: number | null): void;
|
|
13
19
|
export declare function setBitmapTextText(target: BitmapText, text: string): void;
|
|
14
20
|
export declare function setBitmapTextWrapWidth(target: BitmapText, wrapWidth: number | null): void;
|
|
15
21
|
//# sourceMappingURL=bitmapText.d.ts.map
|
package/dist/bitmapText.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmapText.d.ts","sourceRoot":"","sources":["../src/bitmapText.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bitmapText.d.ts","sourceRoot":"","sources":["../src/bitmapText.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EAGX,SAAS,EACV,MAAM,0BAA0B,CAAC;AASlC,wBAAgB,qCAAqC,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,IAAI,CAWxG;AASD,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,UAAU,CAanH;AAED,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,GAAG,cAAc,CAI7F;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAU3D;AAID,wBAA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BAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAExE;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAEzF"}
|
package/dist/bitmapText.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
|
|
1
2
|
import { copyRectangle, createRectangle, reserveFloat32Array, reserveUint16Array } from '@flighthq/geometry/contract';
|
|
2
3
|
import { createNode2D, createNode2DRuntime, getNode2DRuntime } from '@flighthq/scene2d/contract';
|
|
3
4
|
import { createTextureAtlas } from '@flighthq/textureatlas/contract';
|
|
@@ -37,19 +38,19 @@ export function createBitmapText(glyphSource, options) {
|
|
|
37
38
|
return bitmapText;
|
|
38
39
|
}
|
|
39
40
|
export function createBitmapTextData(data) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
letterSpacing: data?.letterSpacing ?? 0,
|
|
44
|
-
lineHeight: data?.lineHeight ?? 1,
|
|
45
|
-
text: data?.text ?? '',
|
|
46
|
-
wrapWidth: data?.wrapWidth ?? null,
|
|
47
|
-
};
|
|
41
|
+
const out = allocateEntity();
|
|
42
|
+
initializeBitmapTextData(out, data);
|
|
43
|
+
return finishEntity(out);
|
|
48
44
|
}
|
|
49
45
|
export function createBitmapTextRuntime() {
|
|
50
46
|
const runtime = createNode2DRuntime(defaultMethods);
|
|
47
|
+
// -1 is below every real version, so a node that has never been laid out reads stale and one
|
|
48
|
+
// `refreshBitmapTextGlyphLayout` brings it up — no separate "was it ever updated" flag.
|
|
49
|
+
runtime.glyphLayoutVersion = -1;
|
|
50
|
+
runtime.lineCount = 0;
|
|
51
51
|
runtime.localBoundsRectangle = null;
|
|
52
52
|
runtime.pages = [];
|
|
53
|
+
runtime.truncated = false;
|
|
53
54
|
return runtime;
|
|
54
55
|
}
|
|
55
56
|
// Allocates a fresh Rectangle holding the laid-out text extent. Use
|
|
@@ -59,11 +60,38 @@ export function getBitmapTextBounds(source) {
|
|
|
59
60
|
computeBitmapTextLocalBoundsRectangle(out, source);
|
|
60
61
|
return out;
|
|
61
62
|
}
|
|
63
|
+
export function getBitmapTextLineCount(source) {
|
|
64
|
+
return getNode2DRuntime(source).lineCount;
|
|
65
|
+
}
|
|
62
66
|
// The glyph-quad pages the node draws — one per glyph-atlas page in page order. A single-page source
|
|
63
67
|
// yields exactly one; the array is never empty after construction.
|
|
64
68
|
export function getBitmapTextPages(source) {
|
|
65
69
|
return getNode2DRuntime(source).pages;
|
|
66
70
|
}
|
|
71
|
+
export function initializeBitmapTextData(out, data) {
|
|
72
|
+
out.align = data?.align ?? 'left';
|
|
73
|
+
out.ellipsis = data?.ellipsis ?? '';
|
|
74
|
+
out.glyphSource = data?.glyphSource ?? null;
|
|
75
|
+
out.letterSpacing = data?.letterSpacing ?? 0;
|
|
76
|
+
out.lineHeight = data?.lineHeight ?? 1;
|
|
77
|
+
out.maxLines = data?.maxLines ?? null;
|
|
78
|
+
out.text = data?.text ?? '';
|
|
79
|
+
out.wrapWidth = data?.wrapWidth ?? null;
|
|
80
|
+
}
|
|
81
|
+
// True when the page regions baked by the last `updateBitmapText` no longer describe the glyphs they
|
|
82
|
+
// were built for, because the bound glyph source has repacked since. Rects that have gone stale stay
|
|
83
|
+
// well-formed — they simply cover other glyphs now — so this version comparison is the only way to
|
|
84
|
+
// tell, and it is the check `refreshBitmapTextGlyphLayout` performs. A node that has never been laid
|
|
85
|
+
// out reads true; a node with no glyph source, or one bound to a static font, reads false forever.
|
|
86
|
+
export function isBitmapTextGlyphLayoutStale(source) {
|
|
87
|
+
const glyphSource = source.data.glyphSource;
|
|
88
|
+
if (glyphSource === null)
|
|
89
|
+
return false;
|
|
90
|
+
return getNode2DRuntime(source).glyphLayoutVersion !== glyphSource.getGlyphLayoutVersion();
|
|
91
|
+
}
|
|
92
|
+
export function isBitmapTextTruncated(source) {
|
|
93
|
+
return getNode2DRuntime(source).truncated;
|
|
94
|
+
}
|
|
67
95
|
// Grows each page's quad arrays to hold at least `glyphCapacity` glyph quads without reallocating during
|
|
68
96
|
// layout. Optional — `updateBitmapText` auto-grows — but avoids incremental reallocation for large
|
|
69
97
|
// strings. Reserving every page over-allocates for multi-page text but never under-sizes.
|
|
@@ -78,6 +106,9 @@ export function reserveBitmapText(target, glyphCapacity) {
|
|
|
78
106
|
export function setBitmapTextAlign(target, align) {
|
|
79
107
|
target.data.align = align;
|
|
80
108
|
}
|
|
109
|
+
export function setBitmapTextEllipsis(target, ellipsis) {
|
|
110
|
+
target.data.ellipsis = ellipsis;
|
|
111
|
+
}
|
|
81
112
|
export function setBitmapTextGlyphSource(target, glyphSource) {
|
|
82
113
|
target.data.glyphSource = glyphSource;
|
|
83
114
|
}
|
|
@@ -87,6 +118,9 @@ export function setBitmapTextLetterSpacing(target, letterSpacing) {
|
|
|
87
118
|
export function setBitmapTextLineHeight(target, lineHeight) {
|
|
88
119
|
target.data.lineHeight = lineHeight;
|
|
89
120
|
}
|
|
121
|
+
export function setBitmapTextMaxLines(target, maxLines) {
|
|
122
|
+
target.data.maxLines = maxLines;
|
|
123
|
+
}
|
|
90
124
|
export function setBitmapTextText(target, text) {
|
|
91
125
|
target.data.text = text;
|
|
92
126
|
}
|
|
@@ -96,10 +130,14 @@ export function setBitmapTextWrapWidth(target, wrapWidth) {
|
|
|
96
130
|
function applyBitmapTextOptions(data, options) {
|
|
97
131
|
if (options.align !== undefined)
|
|
98
132
|
data.align = options.align;
|
|
133
|
+
if (options.ellipsis !== undefined)
|
|
134
|
+
data.ellipsis = options.ellipsis;
|
|
99
135
|
if (options.letterSpacing !== undefined)
|
|
100
136
|
data.letterSpacing = options.letterSpacing;
|
|
101
137
|
if (options.lineHeight !== undefined)
|
|
102
138
|
data.lineHeight = options.lineHeight;
|
|
139
|
+
if (options.maxLines !== undefined)
|
|
140
|
+
data.maxLines = options.maxLines;
|
|
103
141
|
if (options.text !== undefined)
|
|
104
142
|
data.text = options.text;
|
|
105
143
|
if (options.wrapWidth !== undefined)
|
package/dist/bitmapText.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmapText.js","sourceRoot":"","sources":["../src/bitmapText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACjG,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"bitmapText.js","sourceRoot":"","sources":["../src/bitmapText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACjG,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAcrE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,oGAAoG;AACpG,iEAAiE;AACjE,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAEvC,sGAAsG;AACtG,qFAAqF;AACrF,MAAM,UAAU,qCAAqC,CAAC,GAAc,EAAE,MAA4B;IAChG,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAsB,CAAC;IAC9D,MAAM,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAC5C,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACV,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;Q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AAC1E,CAAC;AAED,SAAS,wBAAwB,CAAC,GAAc,EAAE,MAAsB;IACtE,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAoB,CAAsB,CAAC;IAC5E,IAAI,OAAO,CAAC,oBAAoB,KAAK,IAAI;QAAE,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAC9F,CAAC;AAED,uGAAuG;AACvG,SAAS,oBAAoB;IAC3B,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,GAAG,EAAE,IAAI,WAAW,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,YAAY,EAAE,EAAE,CAAC;AACnH,CAAC;AAED,MAAM,cAAc,GAA0C;IAC5D,2BAA2B,EAAE,wBAAwB;CACtD,CAAC"}
|
package/dist/contract.d.ts
CHANGED
package/dist/contract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/contract.js
CHANGED
package/dist/contract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Uninstalls the guard installed by `enableBitmapTextGuards`. */
|
|
2
|
+
export declare function disableBitmapTextGuards(): void;
|
|
3
|
+
/**
|
|
4
|
+
* Installs the caller-facing bitmap-text guard (opt-in, dev-only). It warns once — through
|
|
5
|
+
* `@flighthq/log` — when a layout never settles:
|
|
6
|
+
*
|
|
7
|
+
* **The layout did not converge.** `updateBitmapText` re-runs a layout whose glyph rects a repack
|
|
8
|
+
* invalidated mid-pass, and it ran out of passes. The string needs more glyphs resident at once than
|
|
9
|
+
* the atlas can hold, so rasterizing the end of it evicts the start, every pass invalidates the one
|
|
10
|
+
* before, and the quads that get drawn sample whatever displaced them. Unlike a full cache this does
|
|
11
|
+
* not resolve itself with use: the atlas has to be bigger or the font smaller.
|
|
12
|
+
*
|
|
13
|
+
* Pair with `isBitmapTextGlyphLayoutStale` for a pull-style answer about one node, and with
|
|
14
|
+
* `enableGlyphAtlasGuards` for the atlas-side view of the same pressure — that one reports the repacks
|
|
15
|
+
* and the glyphs they drop, this one reports the text that could not be laid out through them. Not
|
|
16
|
+
* importing this module costs production nothing: the wording and the `@flighthq/log` dependency live
|
|
17
|
+
* only here.
|
|
18
|
+
*/
|
|
19
|
+
export declare function enableBitmapTextGuards(): void;
|
|
20
|
+
//# sourceMappingURL=enableBitmapTextGuards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enableBitmapTextGuards.d.ts","sourceRoot":"","sources":["../src/enableBitmapTextGuards.ts"],"names":[],"mappings":"AAKA,kEAAkE;AAClE,wBAAgB,uBAAuB,IAAI,IAAI,CAG9C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAG7C"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { logOnce } from '@flighthq/log/contract';
|
|
2
|
+
import { LogLevel } from '@flighthq/types/contract';
|
|
3
|
+
import { setBitmapTextLayoutGuard, setBitmapTextMissingGlyphGuard } from './updateBitmapText';
|
|
4
|
+
/** Uninstalls the guard installed by `enableBitmapTextGuards`. */
|
|
5
|
+
export function disableBitmapTextGuards() {
|
|
6
|
+
setBitmapTextLayoutGuard(null);
|
|
7
|
+
setBitmapTextMissingGlyphGuard(null);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Installs the caller-facing bitmap-text guard (opt-in, dev-only). It warns once — through
|
|
11
|
+
* `@flighthq/log` — when a layout never settles:
|
|
12
|
+
*
|
|
13
|
+
* **The layout did not converge.** `updateBitmapText` re-runs a layout whose glyph rects a repack
|
|
14
|
+
* invalidated mid-pass, and it ran out of passes. The string needs more glyphs resident at once than
|
|
15
|
+
* the atlas can hold, so rasterizing the end of it evicts the start, every pass invalidates the one
|
|
16
|
+
* before, and the quads that get drawn sample whatever displaced them. Unlike a full cache this does
|
|
17
|
+
* not resolve itself with use: the atlas has to be bigger or the font smaller.
|
|
18
|
+
*
|
|
19
|
+
* Pair with `isBitmapTextGlyphLayoutStale` for a pull-style answer about one node, and with
|
|
20
|
+
* `enableGlyphAtlasGuards` for the atlas-side view of the same pressure — that one reports the repacks
|
|
21
|
+
* and the glyphs they drop, this one reports the text that could not be laid out through them. Not
|
|
22
|
+
* importing this module costs production nothing: the wording and the `@flighthq/log` dependency live
|
|
23
|
+
* only here.
|
|
24
|
+
*/
|
|
25
|
+
export function enableBitmapTextGuards() {
|
|
26
|
+
setBitmapTextLayoutGuard(warnOnBitmapTextLayoutBlocked);
|
|
27
|
+
setBitmapTextMissingGlyphGuard(warnOnBitmapTextMissingGlyph);
|
|
28
|
+
}
|
|
29
|
+
function warnOnBitmapTextMissingGlyph(codepoint) {
|
|
30
|
+
logOnce(`bitmaptext:missing-glyph:${codepoint}`, LogLevel.Warn, {
|
|
31
|
+
message: `updateBitmapText: no glyph for codepoint U+${codepoint.toString(16).toUpperCase().padStart(4, '0')} ` +
|
|
32
|
+
`(${String.fromCodePoint(codepoint)}) — the glyph source does not contain this character, so it is ` +
|
|
33
|
+
'skipped during layout. Use explainBitmapTextMissingGlyphs for a full inventory.',
|
|
34
|
+
}, 'bitmaptext');
|
|
35
|
+
}
|
|
36
|
+
function warnOnBitmapTextLayoutBlocked(_reason, attempts) {
|
|
37
|
+
logOnce('bitmaptext:layout-did-not-converge', LogLevel.Warn, {
|
|
38
|
+
message: `updateBitmapText: the glyph source repacked during all ${attempts} layout passes, so this text ` +
|
|
39
|
+
'never settled — its glyphs cannot all be resident in the atlas at once, and the quads drawn from ' +
|
|
40
|
+
'the final pass sample stale rects. Enlarge the glyph atlas or reduce the font size; ' +
|
|
41
|
+
'enableGlyphAtlasGuards reports the repacks from the atlas side.',
|
|
42
|
+
}, 'bitmaptext');
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=enableBitmapTextGuards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enableBitmapTextGuards.js","sourceRoot":"","sources":["../src/enableBitmapTextGuards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAE9F,kEAAkE;AAClE,MAAM,UAAU,uBAAuB;IACrC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAC/B,8BAA8B,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,sBAAsB;IACpC,wBAAwB,CAAC,6BAA6B,CAAC,CAAC;IACxD,8BAA8B,CAAC,4BAA4B,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,4BAA4B,CAAC,SAAiB;IACrD,OAAO,CACL,4BAA4B,SAAS,EAAE,EACvC,QAAQ,CAAC,IAAI,EACb;QACE,OAAO,EACL,8CAA8C,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG;YACtG,IAAI,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,iEAAiE;YACpG,iFAAiF;KACpF,EACD,YAAY,CACb,CAAC;AACJ,CAAC;AAED,SAAS,6BAA6B,CAAC,OAAe,EAAE,QAAgB;IACtE,OAAO,CACL,oCAAoC,EACpC,QAAQ,CAAC,IAAI,EACb;QACE,OAAO,EACL,0DAA0D,QAAQ,+BAA+B;YACjG,mGAAmG;YACnG,sFAAsF;YACtF,iEAAiE;KACpE,EACD,YAAY,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { BitmapTextMissingGlyphs, GlyphSource } from '@flighthq/types/contract';
|
|
2
|
+
export declare function explainBitmapTextMissingGlyphs(glyphSource: Readonly<GlyphSource>, text: string): BitmapTextMissingGlyphs;
|
|
3
|
+
//# sourceMappingURL=explainBitmapTextMissingGlyphs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explainBitmapTextMissingGlyphs.d.ts","sourceRoot":"","sources":["../src/explainBitmapTextMissingGlyphs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAErF,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC,EAClC,IAAI,EAAE,MAAM,GACX,uBAAuB,CAkBzB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function explainBitmapTextMissingGlyphs(glyphSource, text) {
|
|
2
|
+
const seen = new Set();
|
|
3
|
+
const missing = [];
|
|
4
|
+
let totalCodepoints = 0;
|
|
5
|
+
for (const character of text) {
|
|
6
|
+
const codepoint = character.codePointAt(0);
|
|
7
|
+
if (codepoint === undefined)
|
|
8
|
+
continue;
|
|
9
|
+
if (codepoint === 0x0a || codepoint === 0x0d)
|
|
10
|
+
continue;
|
|
11
|
+
totalCodepoints++;
|
|
12
|
+
if (seen.has(codepoint))
|
|
13
|
+
continue;
|
|
14
|
+
seen.add(codepoint);
|
|
15
|
+
if (glyphSource.getGlyphEntry(codepoint) === null) {
|
|
16
|
+
missing.push(codepoint);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return { missingCodepoints: missing, totalCodepoints };
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=explainBitmapTextMissingGlyphs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explainBitmapTextMissingGlyphs.js","sourceRoot":"","sources":["../src/explainBitmapTextMissingGlyphs.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,8BAA8B,CAC5C,WAAkC,EAClC,IAAY;IAEZ,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,eAAe,GAAG,CAAC,CAAC;IAExB,KAAK,MAAM,SAAS,IAAI,IAAI,EAAE,CAAC;QAC7B,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAC3C,IAAI,SAAS,KAAK,SAAS;YAAE,SAAS;QACtC,IAAI,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,IAAI;YAAE,SAAS;QACvD,eAAe,EAAE,CAAC;QAClB,IAAI,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;YAAE,SAAS;QAClC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpB,IAAI,WAAW,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC;YAClD,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;AACzD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { computeBitmapTextLocalBoundsRectangle, createBitmapText, getBitmapTextBounds, getBitmapTextPages, reserveBitmapText, setBitmapTextAlign, setBitmapTextGlyphSource, setBitmapTextLetterSpacing, setBitmapTextLineHeight, setBitmapTextText, setBitmapTextWrapWidth, updateBitmapText, } from './contract';
|
|
1
|
+
export { computeBitmapTextLocalBoundsRectangle, createBitmapText, disableBitmapTextGuards, enableBitmapTextGuards, explainBitmapTextMissingGlyphs, getBitmapTextBounds, getBitmapTextLineCount, getBitmapTextPages, isBitmapTextGlyphLayoutStale, isBitmapTextTruncated, refreshBitmapTextGlyphLayout, reserveBitmapText, setBitmapTextAlign, setBitmapTextEllipsis, setBitmapTextGlyphSource, setBitmapTextMissingGlyphGuard, setBitmapTextLetterSpacing, setBitmapTextLineHeight, setBitmapTextMaxLines, setBitmapTextText, setBitmapTextWrapWidth, updateBitmapText, } from './contract';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,8BAA8B,EAC9B,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,4BAA4B,EAC5B,qBAAqB,EACrB,4BAA4B,EAC5B,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,8BAA8B,EAC9B,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { computeBitmapTextLocalBoundsRectangle, createBitmapText, getBitmapTextBounds, getBitmapTextPages, reserveBitmapText, setBitmapTextAlign, setBitmapTextGlyphSource, setBitmapTextLetterSpacing, setBitmapTextLineHeight, setBitmapTextText, setBitmapTextWrapWidth, updateBitmapText, } from './contract';
|
|
1
|
+
export { computeBitmapTextLocalBoundsRectangle, createBitmapText, disableBitmapTextGuards, enableBitmapTextGuards, explainBitmapTextMissingGlyphs, getBitmapTextBounds, getBitmapTextLineCount, getBitmapTextPages, isBitmapTextGlyphLayoutStale, isBitmapTextTruncated, refreshBitmapTextGlyphLayout, reserveBitmapText, setBitmapTextAlign, setBitmapTextEllipsis, setBitmapTextGlyphSource, setBitmapTextMissingGlyphGuard, setBitmapTextLetterSpacing, setBitmapTextLineHeight, setBitmapTextMaxLines, setBitmapTextText, setBitmapTextWrapWidth, updateBitmapText, } from './contract';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,8BAA8B,EAC9B,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,4BAA4B,EAC5B,qBAAqB,EACrB,4BAA4B,EAC5B,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,8BAA8B,EAC9B,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import type { BitmapText } from '@flighthq/types/contract';
|
|
2
|
+
export declare function refreshBitmapTextGlyphLayout(bitmapText: BitmapText): boolean;
|
|
3
|
+
/** Installs the bitmap-text guard, or clears it with `null`. The seam keeps the wording and the
|
|
4
|
+
* `@flighthq/log` dependency in the separately-importable guard module rather than in layout; not
|
|
5
|
+
* importing that module costs production nothing. Called by `enableBitmapTextGuards`. */
|
|
6
|
+
export declare function setBitmapTextLayoutGuard(guard: ((reason: string, attempts: number) => void) | null): void;
|
|
7
|
+
export declare function setBitmapTextMissingGlyphGuard(guard: ((codepoint: number) => void) | null): void;
|
|
2
8
|
export declare function updateBitmapText(bitmapText: BitmapText): void;
|
|
3
9
|
//# sourceMappingURL=updateBitmapText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateBitmapText.d.ts","sourceRoot":"","sources":["../src/updateBitmapText.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,UAAU,EAOX,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"updateBitmapText.d.ts","sourceRoot":"","sources":["../src/updateBitmapText.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,UAAU,EAOX,MAAM,0BAA0B,CAAC;AAWlC,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAI5E;AAED;;0FAE0F;AAC1F,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAEzG;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAEhG;AAsBD,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAwB7D"}
|