@flighthq/bitmapfont-formats 0.5.1-next.920.da8f530 → 0.6.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 +2 -2
- package/dist/.tsbuildinfo.contract +1 -0
- package/dist/.tsbuildinfo.runtime +1 -0
- package/dist/bitmapFontBinary.d.ts +4 -0
- package/dist/bitmapFontBinary.d.ts.map +1 -0
- package/dist/bitmapFontBinary.js +129 -0
- package/dist/bitmapFontBinary.js.map +1 -0
- package/dist/bitmapFontDetect.d.ts +59 -0
- package/dist/bitmapFontDetect.d.ts.map +1 -0
- package/dist/bitmapFontDetect.js +133 -0
- package/dist/bitmapFontDetect.js.map +1 -0
- package/dist/bitmapFontFnt.d.ts +2 -1
- package/dist/bitmapFontFnt.d.ts.map +1 -1
- package/dist/bitmapFontFnt.js +1 -1
- package/dist/bitmapFontFnt.js.map +1 -1
- package/dist/bitmapFontFormatKind.d.ts +37 -0
- package/dist/bitmapFontFormatKind.d.ts.map +1 -0
- package/dist/bitmapFontFormatKind.js +123 -0
- package/dist/bitmapFontFormatKind.js.map +1 -0
- package/dist/bitmapFontJson.d.ts +2 -1
- package/dist/bitmapFontJson.d.ts.map +1 -1
- package/dist/bitmapFontJson.js +4 -3
- package/dist/bitmapFontJson.js.map +1 -1
- package/dist/bitmapFontRecord.d.ts +3 -1
- package/dist/bitmapFontRecord.d.ts.map +1 -1
- package/dist/bitmapFontRecord.js +1 -2
- package/dist/bitmapFontRecord.js.map +1 -1
- package/dist/bitmapFontXml.d.ts +2 -1
- package/dist/bitmapFontXml.d.ts.map +1 -1
- package/dist/bitmapFontXml.js +1 -1
- package/dist/bitmapFontXml.js.map +1 -1
- package/dist/bitmapfontFormatRequirements.d.ts +9 -0
- package/dist/bitmapfontFormatRequirements.d.ts.map +1 -0
- package/dist/bitmapfontFormatRequirements.js +9 -0
- package/dist/bitmapfontFormatRequirements.js.map +1 -0
- package/dist/contract.bitmapfont-formats-types.d.ts +2 -0
- package/dist/contract.bitmapfont-formats-types.d.ts.map +1 -0
- package/dist/contract.bitmapfont-formats-types.js +4 -0
- package/dist/contract.bitmapfont-formats-types.js.map +1 -0
- package/dist/contract.d.ts +10 -3
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +10 -3
- package/dist/contract.js.map +1 -1
- package/dist/explainBitmapFontParse.d.ts +4 -0
- package/dist/explainBitmapFontParse.d.ts.map +1 -0
- package/dist/explainBitmapFontParse.js +194 -0
- package/dist/explainBitmapFontParse.js.map +1 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +59 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +13 -7
- package/src/bitmapFontBinary.test.ts +196 -0
- package/src/bitmapFontDetect.test.ts +335 -0
- package/src/bitmapFontFnt.test.ts +5 -2
- package/src/bitmapFontFormatKind.test.ts +71 -0
- package/src/bitmapFontJson.test.ts +5 -5
- package/src/bitmapFontRecord.test.ts +3 -2
- package/src/bitmapFontXml.test.ts +2 -2
- package/src/explainBitmapFontParse.test.ts +161 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { decodeUTF8 } from '@flighthq/encoding/contract';
|
|
2
|
+
import { getKindMapKeys, withKindMapEntry, withoutKindMapEntry } from '@flighthq/registry/contract';
|
|
3
|
+
import { parseBitmapFontBinary } from './bitmapFontBinary.js';
|
|
4
|
+
import { parseBitmapFontFnt } from './bitmapFontFnt.js';
|
|
5
|
+
import { readBitmapFontFormatKind } from './bitmapFontFormatKind.js';
|
|
6
|
+
import { parseBitmapFontJson } from './bitmapFontJson.js';
|
|
7
|
+
import { parseBitmapFontXml } from './bitmapFontXml.js';
|
|
8
|
+
import { BitmapFontFormatKindBmFontBinary, BitmapFontFormatKindBmFontJson, BitmapFontFormatKindBmFontText, BitmapFontFormatKindBmFontXml, } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Installs the formats named in `options` into the registry.
|
|
11
|
+
*
|
|
12
|
+
* ★ THE SEAM IS EXPLICIT AND NOTHING REGISTERS ON IMPORT. This package declares `"sideEffects": false`, so the
|
|
13
|
+
* built-ins are seeded by the registry's own initializer rather than by front-end modules registering
|
|
14
|
+
* themselves — and options stay inert data a caller applies when they choose.
|
|
15
|
+
*
|
|
16
|
+
* Re-registering a kind is last-write-wins. Detection does not depend on registration order: every built-in
|
|
17
|
+
* detector asks one shared discrimination and answers only for its own kind.
|
|
18
|
+
*/
|
|
19
|
+
export function applyBitmapFontImportOptions(options) {
|
|
20
|
+
for (const format of options.formats ?? [])
|
|
21
|
+
bindBitmapFontFormat(format.kind, format.entry);
|
|
22
|
+
}
|
|
23
|
+
/** Sniff the bytes of a bitmap font descriptor and return its format kind, or `null` when no registered format
|
|
24
|
+
* recognises it.
|
|
25
|
+
*
|
|
26
|
+
* Detection is structural, not extension-based, which matters more here than for most families: BMFont writes
|
|
27
|
+
* its binary, text and XML forms all under `.fnt`, so the extension cannot name the format.
|
|
28
|
+
*
|
|
29
|
+
* Returns `null` for unknown or corrupt input — never throws. */
|
|
30
|
+
export function detectBitmapFontFormat(bytes) {
|
|
31
|
+
for (const [kind, entry] of getRegistry()) {
|
|
32
|
+
if (entry.detect(bytes))
|
|
33
|
+
return kind;
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
/** Retrieve the registered entry for a `BitmapFontFormatKind`, or `null` when none is registered.
|
|
38
|
+
*
|
|
39
|
+
* Useful for introspecting which formats are available, or for calling one format's detector or parser
|
|
40
|
+
* directly without going through detection. */
|
|
41
|
+
export function getBitmapFontFormat(kind) {
|
|
42
|
+
return getRegistry().get(kind) ?? null;
|
|
43
|
+
}
|
|
44
|
+
/** Return a sorted snapshot of every bound bitmap font format kind. */
|
|
45
|
+
export function getBitmapFontFormatKinds() {
|
|
46
|
+
const kinds = [];
|
|
47
|
+
getKindMapKeys(kinds, getRegistry());
|
|
48
|
+
return kinds;
|
|
49
|
+
}
|
|
50
|
+
/** Parse a bitmap font descriptor into a `BitmapFont`, auto-detecting the format.
|
|
51
|
+
*
|
|
52
|
+
* Pass `formatKind` to skip detection when the format is already known. Returns `null` when the format is not
|
|
53
|
+
* recognised, or when the recognised front end rejects the document — an expected failure, not a throw. */
|
|
54
|
+
export function parseBitmapFont(bytes, formatKind, options, diagnostics) {
|
|
55
|
+
const kind = formatKind ?? detectBitmapFontFormat(bytes);
|
|
56
|
+
if (kind === null || kind === undefined)
|
|
57
|
+
return null;
|
|
58
|
+
return getBitmapFontFormat(kind)?.parse(bytes, options, diagnostics) ?? null;
|
|
59
|
+
}
|
|
60
|
+
/** Register a custom bitmap font format for `detectBitmapFontFormat` and `parseBitmapFont`.
|
|
61
|
+
*
|
|
62
|
+
* Last-write-wins: registering a built-in kind replaces it. Third-party formats should use a vendor-prefixed
|
|
63
|
+
* kind (e.g. `'acme.MyFont'`) so they cannot collide with a built-in.
|
|
64
|
+
*
|
|
65
|
+
* A custom detector should be as narrow as the built-ins are — they are mutually exclusive, so detection does
|
|
66
|
+
* not depend on registration order today, and a broad custom detector is the one way to reintroduce that
|
|
67
|
+
* dependence. */
|
|
68
|
+
export function registerBitmapFontFormat(kind, entry) {
|
|
69
|
+
bindBitmapFontFormat(kind, entry);
|
|
70
|
+
}
|
|
71
|
+
export const bmFontBinaryFormat = {
|
|
72
|
+
entry: {
|
|
73
|
+
detect: (bytes) => readBitmapFontFormatKind(bytes) === BitmapFontFormatKindBmFontBinary,
|
|
74
|
+
parse: (bytes, options, diagnostics) => parseBitmapFontBinary(bytes, options, diagnostics),
|
|
75
|
+
},
|
|
76
|
+
kind: BitmapFontFormatKindBmFontBinary,
|
|
77
|
+
};
|
|
78
|
+
export const bmFontJsonFormat = {
|
|
79
|
+
entry: {
|
|
80
|
+
detect: (bytes) => readBitmapFontFormatKind(bytes) === BitmapFontFormatKindBmFontJson,
|
|
81
|
+
parse: (bytes, options, diagnostics) => parseBitmapFontJson(decodeUTF8(bytes), options, diagnostics),
|
|
82
|
+
},
|
|
83
|
+
kind: BitmapFontFormatKindBmFontJson,
|
|
84
|
+
};
|
|
85
|
+
export const bmFontTextFormat = {
|
|
86
|
+
entry: {
|
|
87
|
+
detect: (bytes) => readBitmapFontFormatKind(bytes) === BitmapFontFormatKindBmFontText,
|
|
88
|
+
parse: (bytes, options, diagnostics) => parseBitmapFontFnt(decodeUTF8(bytes), options, diagnostics),
|
|
89
|
+
},
|
|
90
|
+
kind: BitmapFontFormatKindBmFontText,
|
|
91
|
+
};
|
|
92
|
+
export const bmFontXmlFormat = {
|
|
93
|
+
entry: {
|
|
94
|
+
detect: (bytes) => readBitmapFontFormatKind(bytes) === BitmapFontFormatKindBmFontXml,
|
|
95
|
+
parse: (bytes, options, diagnostics) => parseBitmapFontXml(decodeUTF8(bytes), options, diagnostics),
|
|
96
|
+
},
|
|
97
|
+
kind: BitmapFontFormatKindBmFontXml,
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Every built-in bitmap font format.
|
|
101
|
+
*
|
|
102
|
+
* Naming this is equivalent to what the registry seeds itself with, and it is what a caller passes when they want
|
|
103
|
+
* every format. A caller wanting a subset names the descriptors they want, and the front ends they leave out —
|
|
104
|
+
* with their XML or JSON readers — never link. The list is alphabetical by kind because nothing depends on its
|
|
105
|
+
* order; `describe('bitmapFontAllFormats')` measures that.
|
|
106
|
+
*/
|
|
107
|
+
export const bitmapFontAllFormats = [
|
|
108
|
+
bmFontBinaryFormat,
|
|
109
|
+
bmFontJsonFormat,
|
|
110
|
+
bmFontTextFormat,
|
|
111
|
+
bmFontXmlFormat,
|
|
112
|
+
];
|
|
113
|
+
/** Remove a format binding, including a caller override of a built-in kind. */
|
|
114
|
+
export function unregisterBitmapFontFormat(kind) {
|
|
115
|
+
_registry = withoutKindMapEntry(getRegistry(), kind);
|
|
116
|
+
}
|
|
117
|
+
function bindBitmapFontFormat(kind, entry) {
|
|
118
|
+
_registry = withKindMapEntry(getRegistry(), kind, entry);
|
|
119
|
+
}
|
|
120
|
+
// Seeded from the full preset, so the built-in set lives in exactly one place instead of being stated here and
|
|
121
|
+
// restated by anyone assembling the same set. Built-ins are seeded here rather than self-registering from their
|
|
122
|
+
// own modules on import: this package declares `"sideEffects": false`, so a top-level
|
|
123
|
+
// `registerBitmapFontFormat` call in each front end would be the import-time side effect the SDK bans, and it
|
|
124
|
+
// would drag every front end into any consumer that imported one.
|
|
125
|
+
function getRegistry() {
|
|
126
|
+
if (_registry !== null)
|
|
127
|
+
return _registry;
|
|
128
|
+
_registry = new Map();
|
|
129
|
+
applyBitmapFontImportOptions({ formats: bitmapFontAllFormats });
|
|
130
|
+
return _registry;
|
|
131
|
+
}
|
|
132
|
+
let _registry = null;
|
|
133
|
+
//# sourceMappingURL=bitmapFontDetect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitmapFontDetect.js","sourceRoot":"","sources":["../src/bitmapFontDetect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEpG,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAOxD,OAAO,EACL,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;GASG;AACH,MAAM,UAAU,4BAA4B,CAAC,OAA0C;IACrF,KAAK,MAAM,MA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AAI,EAAE,6BAA6B;CACpC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAoD;IACnF,kBAAkB;IAClB,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;CAChB,CAAC;AAEF,+EAA+E;AAC/E,MAAM,UAAU,0BAA0B,CAAC,IAA0B;IACnE,SAAS,GAAG,mBAAmB,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;AACvD,CAAC;AAED,SAAS,oBAAoB,CAAC,IAA0B,EAAE,KAA4B;IACpF,SAAS,GAAG,gBAAgB,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAC3D,CAAC;AAED,+GAA+G;AAC/G,gHAAgH;AAChH,sFAAsF;AACtF,8GAA8G;AAC9G,kEAAkE;AAClE,SAAS,WAAW;IAClB,IAAI,SAAS,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACzC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;IACtB,4BAA4B,CAAC,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAChE,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,IAAI,SAAS,GAAoE,IAAI,CAAC"}
|
package/dist/bitmapFontFnt.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { BitmapFont,
|
|
1
|
+
import type { BitmapFont, BitmapFontParseOptions } from '@flighthq/bitmapfont/contract';
|
|
2
|
+
import type { ImportDiagnostic } from '@flighthq/importdiagnostics/contract';
|
|
2
3
|
export declare function formatBitmapFontFnt(font: Readonly<BitmapFont>): string;
|
|
3
4
|
export declare function parseBitmapFontFnt(text: string, options?: Readonly<BitmapFontParseOptions>, diagnostics?: ImportDiagnostic[]): BitmapFont | null;
|
|
4
5
|
//# sourceMappingURL=bitmapFontFnt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmapFontFnt.d.ts","sourceRoot":"","sources":["../src/bitmapFontFnt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"bitmapFontFnt.d.ts","sourceRoot":"","sources":["../src/bitmapFontFnt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAyB,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAE/G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAa7E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,MAAM,CAwCtE;AAOD,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,QAAQ,CAAC,sBAAsB,CAAC,EAC1C,WAAW,CAAC,EAAE,gBAAgB,EAAE,GAC/B,UAAU,GAAG,IAAI,CAInB"}
|
package/dist/bitmapFontFnt.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getBitmapFontMetrics, unpackBitmapFontKerningKey } from '@flighthq/bitmapfont/contract';
|
|
2
|
-
import { buildBitmapFontFromRecord, reportDroppedBitmapFontRecords } from './bitmapFontRecord';
|
|
2
|
+
import { buildBitmapFontFromRecord, reportDroppedBitmapFontRecords } from './bitmapFontRecord.js';
|
|
3
3
|
// Re-emits a `BitmapFont` as the classic AngelCode/BMFont text `.fnt` (`info`/`common`/`page`/`char`/
|
|
4
4
|
// `kerning` lines of `key=value` pairs). Lossless for the fields the model carries — the glyph table
|
|
5
5
|
// (including each glyph's `page`), kerning pairs, encoding, and line metrics all round-trip
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmapFontFnt.js","sourceRoot":"","sources":["../src/bitmapFontFnt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"bitmapFontFnt.js","sourceRoot":"","sources":["../src/bitmapFontFnt.ts"],"names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|
+
import type { BitmapFontFormatKind } from './types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The bitmap-font content discrimination, with NO registry behind it.
|
|
4
|
+
*
|
|
5
|
+
* ★ IT LIVES HERE SO A CALLER CAN ASK WHICH FORMAT A FILE IS WITHOUT INSTALLING FOUR PARSERS. This was a private
|
|
6
|
+
* function of `bitmapFontDetect.ts`, which is also where the registry, the appliers and all four front ends live —
|
|
7
|
+
* so the only way to reach the answer was to import the module that seeds the full preset. A build-time analyzer
|
|
8
|
+
* needs exactly this answer and none of that: it reads a `.fnt`, learns which ONE of the three forms BMFont wrote,
|
|
9
|
+
* and names that parser alone. The four detectors in `bitmapFontDetect.ts` still ask this same function, so the
|
|
10
|
+
* move cannot make a detector and the analyzer disagree.
|
|
11
|
+
*
|
|
12
|
+
* It is a pure function of bytes. It registers nothing, reads no module state, and pulls in no front end.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* The ONE discrimination all four built-in detectors ask, which is what makes them mutually exclusive.
|
|
16
|
+
*
|
|
17
|
+
* Each detector compares this answer against its own kind, so exactly one can be true for any file and none of
|
|
18
|
+
* them is a broad net another has to be registered ahead of. That matters unusually much for this family: BMFont
|
|
19
|
+
* writes all three of its `.fnt` forms — binary, text and XML — under the SAME extension, so the format is
|
|
20
|
+
* knowable only from the content and a loose detector has nothing to fall back on.
|
|
21
|
+
*
|
|
22
|
+
* The four discriminants are format facts and cannot overlap by construction:
|
|
23
|
+
* - binary: the three bytes `BMF` followed by version 3, which is the exact header the binary front end
|
|
24
|
+
* requires, so a detector and its parser cannot disagree.
|
|
25
|
+
* - XML: the first non-space character is `<` and the root element is `<font>`, which is the root the XML front
|
|
26
|
+
* end requires.
|
|
27
|
+
* - JSON: the first non-space character is `{` AND the object carries the `common` and `chars` blocks the JSON
|
|
28
|
+
* front end requires. The extra condition is not decoration: `.json` is shared with seven other families, so
|
|
29
|
+
* a detector that claimed every JSON object would link this front end into any build with a config file.
|
|
30
|
+
* - text: neither of the above, and a line whose first token is one of the grammar's own block names.
|
|
31
|
+
*
|
|
32
|
+
* Only the first bytes are decoded for the text discrimination — a font descriptor carries thousands of char
|
|
33
|
+
* lines and detection runs over every candidate asset in a build, so reading the whole file to find out it is a
|
|
34
|
+
* font at all would be paid once per registered format.
|
|
35
|
+
*/
|
|
36
|
+
export declare function readBitmapFontFormatKind(bytes: Readonly<Uint8Array>): BitmapFontFormatKind | null;
|
|
37
|
+
//# sourceMappingURL=bitmapFontFormatKind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitmapFontFormatKind.d.ts","sourceRoot":"","sources":["../src/bitmapFontFormatKind.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,oBAAoB,GAAG,IAAI,CAYjG"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { decodeUTF8 } from '@flighthq/encoding/contract';
|
|
2
|
+
import { BitmapFontFormatKindBmFontBinary, BitmapFontFormatKindBmFontJson, BitmapFontFormatKindBmFontText, BitmapFontFormatKindBmFontXml, } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The bitmap-font content discrimination, with NO registry behind it.
|
|
5
|
+
*
|
|
6
|
+
* ★ IT LIVES HERE SO A CALLER CAN ASK WHICH FORMAT A FILE IS WITHOUT INSTALLING FOUR PARSERS. This was a private
|
|
7
|
+
* function of `bitmapFontDetect.ts`, which is also where the registry, the appliers and all four front ends live —
|
|
8
|
+
* so the only way to reach the answer was to import the module that seeds the full preset. A build-time analyzer
|
|
9
|
+
* needs exactly this answer and none of that: it reads a `.fnt`, learns which ONE of the three forms BMFont wrote,
|
|
10
|
+
* and names that parser alone. The four detectors in `bitmapFontDetect.ts` still ask this same function, so the
|
|
11
|
+
* move cannot make a detector and the analyzer disagree.
|
|
12
|
+
*
|
|
13
|
+
* It is a pure function of bytes. It registers nothing, reads no module state, and pulls in no front end.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* The ONE discrimination all four built-in detectors ask, which is what makes them mutually exclusive.
|
|
17
|
+
*
|
|
18
|
+
* Each detector compares this answer against its own kind, so exactly one can be true for any file and none of
|
|
19
|
+
* them is a broad net another has to be registered ahead of. That matters unusually much for this family: BMFont
|
|
20
|
+
* writes all three of its `.fnt` forms — binary, text and XML — under the SAME extension, so the format is
|
|
21
|
+
* knowable only from the content and a loose detector has nothing to fall back on.
|
|
22
|
+
*
|
|
23
|
+
* The four discriminants are format facts and cannot overlap by construction:
|
|
24
|
+
* - binary: the three bytes `BMF` followed by version 3, which is the exact header the binary front end
|
|
25
|
+
* requires, so a detector and its parser cannot disagree.
|
|
26
|
+
* - XML: the first non-space character is `<` and the root element is `<font>`, which is the root the XML front
|
|
27
|
+
* end requires.
|
|
28
|
+
* - JSON: the first non-space character is `{` AND the object carries the `common` and `chars` blocks the JSON
|
|
29
|
+
* front end requires. The extra condition is not decoration: `.json` is shared with seven other families, so
|
|
30
|
+
* a detector that claimed every JSON object would link this front end into any build with a config file.
|
|
31
|
+
* - text: neither of the above, and a line whose first token is one of the grammar's own block names.
|
|
32
|
+
*
|
|
33
|
+
* Only the first bytes are decoded for the text discrimination — a font descriptor carries thousands of char
|
|
34
|
+
* lines and detection runs over every candidate asset in a build, so reading the whole file to find out it is a
|
|
35
|
+
* font at all would be paid once per registered format.
|
|
36
|
+
*/
|
|
37
|
+
export function readBitmapFontFormatKind(bytes) {
|
|
38
|
+
if (bytes.length >= 4 && bytes[0] === 66 && bytes[1] === 77 && bytes[2] === 70 && bytes[3] === 3) {
|
|
39
|
+
return BitmapFontFormatKindBmFontBinary;
|
|
40
|
+
}
|
|
41
|
+
const head = decodeUTF8(bytes, 0, Math.min(bytes.length, DETECT_WINDOW_BYTES));
|
|
42
|
+
const trimmed = head.trimStart();
|
|
43
|
+
if (trimmed === '')
|
|
44
|
+
return null;
|
|
45
|
+
if (trimmed.startsWith('<')) {
|
|
46
|
+
return readXmlRootElementName(trimmed) === 'font' ? BitmapFontFormatKindBmFontXml : null;
|
|
47
|
+
}
|
|
48
|
+
if (trimmed.startsWith('{'))
|
|
49
|
+
return isBmFontJsonObject(bytes) ? BitmapFontFormatKindBmFontJson : null;
|
|
50
|
+
return hasBmFontTextBlock(trimmed) ? BitmapFontFormatKindBmFontText : null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Whether the bytes are a JSON object carrying the two blocks the JSON front end requires.
|
|
54
|
+
*
|
|
55
|
+
* ★ THE OPENING BRACE IS NOT ENOUGH, AND THE COMPOSITE ANALYZER IS WHAT PROVED IT. `.json` is shared with seven
|
|
56
|
+
* other format families, so claiming every JSON object put the BMFont JSON front end into the bundle of any build
|
|
57
|
+
* with an app config or a Tiled map beside its assets — the exact bundle inflation content-aware analysis exists
|
|
58
|
+
* to prevent. Requiring `common` and `chars` asks the same question `parseBitmapFontJson` asks (it returns null
|
|
59
|
+
* without either), so the detector still cannot disagree with its parser.
|
|
60
|
+
*
|
|
61
|
+
* This is the one branch that decodes and parses the WHOLE document rather than the detection window: a `chars`
|
|
62
|
+
* array carries thousands of entries and can push `common` past any fixed prefix, so a windowed answer here would
|
|
63
|
+
* be wrong for exactly the large fonts it was meant to make cheap. The sibling JSON families pay the same cost.
|
|
64
|
+
*/
|
|
65
|
+
function isBmFontJsonObject(bytes) {
|
|
66
|
+
let raw;
|
|
67
|
+
try {
|
|
68
|
+
raw = JSON.parse(decodeUTF8(bytes));
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
if (raw === null || typeof raw !== 'object' || Array.isArray(raw))
|
|
74
|
+
return false;
|
|
75
|
+
const obj = raw;
|
|
76
|
+
const hasChars = Array.isArray(obj.chars) || (obj.chars !== null && typeof obj.chars === 'object');
|
|
77
|
+
return hasChars && obj.common !== null && typeof obj.common === 'object';
|
|
78
|
+
}
|
|
79
|
+
// Whether the head of a text document opens with one of the BMFont text grammar's own block names. `info` and
|
|
80
|
+
// `common` are the two blocks every writer emits first; `page` and `char` are accepted so a fragment that omits
|
|
81
|
+
// the header is still recognised as this grammar rather than as prose.
|
|
82
|
+
function hasBmFontTextBlock(head) {
|
|
83
|
+
for (const rawLine of head.split(/\r\n?|\n/)) {
|
|
84
|
+
const line = rawLine.trim();
|
|
85
|
+
if (line === '')
|
|
86
|
+
continue;
|
|
87
|
+
const spaceAt = line.search(/\s/);
|
|
88
|
+
const tag = spaceAt < 0 ? line : line.slice(0, spaceAt);
|
|
89
|
+
if (tag === 'info' || tag === 'common' || tag === 'page' || tag === 'char' || tag === 'chars')
|
|
90
|
+
return true;
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
// The name of the first ELEMENT in an XML document, skipping the declaration, comments and the doctype, or
|
|
96
|
+
// `null` when the text does not open an element.
|
|
97
|
+
function readXmlRootElementName(trimmed) {
|
|
98
|
+
let index = 0;
|
|
99
|
+
while (index < trimmed.length) {
|
|
100
|
+
if (!trimmed.startsWith('<', index)) {
|
|
101
|
+
const next = trimmed.indexOf('<', index);
|
|
102
|
+
if (next < 0)
|
|
103
|
+
return null;
|
|
104
|
+
index = next;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
if (trimmed.startsWith('<?', index) || trimmed.startsWith('<!', index)) {
|
|
108
|
+
const comment = trimmed.startsWith('<!--', index);
|
|
109
|
+
const close = comment ? trimmed.indexOf('-->', index) : trimmed.indexOf('>', index);
|
|
110
|
+
if (close < 0)
|
|
111
|
+
return null;
|
|
112
|
+
index = close + (comment ? 3 : 1);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
const match = /^<([A-Za-z_][\w.:-]*)/.exec(trimmed.slice(index));
|
|
116
|
+
return match === null ? null : match[1];
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
// Enough to carry an XML declaration, a doctype, a comment and the first grammar line of any of the three text
|
|
121
|
+
// forms. A descriptor whose first block starts further in than this is not something any BMFont writer emits.
|
|
122
|
+
const DETECT_WINDOW_BYTES = 4096;
|
|
123
|
+
//# sourceMappingURL=bitmapFontFormatKind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitmapFontFormatKind.js","sourceRoot":"","sources":["../src/bitmapFontFormatKind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EACL,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AAGpB;;;;;;;;;;;GAWG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAA2B;IAClE,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QACjG,OAAO,gCAAgC,CAAC;IAC1C,CAAC;IACD,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAC/E,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IACjC,IAAI,OAAO,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5B,OAAO,sBAAsB,CAAC,OAAO,CAAC,KAAK,MAAM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KAAK,CAAC,CAAC;YACpF,IAAI,KAAK,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC;YAC3B,KAAK,GAAG,KAAK,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAClC,SAAS;QACX,CAAC;QACD,MAAM,KAAK,GAAG,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACjE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,+GAA+G;AAC/G,8GAA8G;AAC9G,MAAM,mBAAmB,GAAG,IAAI,CAAC"}
|
package/dist/bitmapFontJson.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { BitmapFont,
|
|
1
|
+
import type { BitmapFont, BitmapFontParseOptions } from '@flighthq/bitmapfont/contract';
|
|
2
|
+
import type { ImportDiagnostic } from '@flighthq/importdiagnostics/contract';
|
|
2
3
|
export declare function parseBitmapFontJson(text: string, options?: Readonly<BitmapFontParseOptions>, diagnostics?: ImportDiagnostic[]): BitmapFont | null;
|
|
3
4
|
//# sourceMappingURL=bitmapFontJson.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmapFontJson.d.ts","sourceRoot":"","sources":["../src/bitmapFontJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"bitmapFontJson.d.ts","sourceRoot":"","sources":["../src/bitmapFontJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAsB,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAY7E,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,QAAQ,CAAC,sBAAsB,CAAC,EAC1C,WAAW,CAAC,EAAE,gBAAgB,EAAE,GAC/B,UAAU,GAAG,IAAI,CAInB"}
|
package/dist/bitmapFontJson.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildBitmapFontFromRecord, reportDroppedBitmapFontRecords } from './bitmapFontRecord';
|
|
1
|
+
import { buildBitmapFontFromRecord, reportDroppedBitmapFontRecords } from './bitmapFontRecord.js';
|
|
2
2
|
// Parses the JSON AngelCode/BMFont export into a `BitmapFont`. The shape mirrors the text/XML blocks as
|
|
3
3
|
// an object: `{ common: { lineHeight, base }, pages: [file, …], chars: [{ id, x, … }], kernings: [{
|
|
4
4
|
// first, second, amount }] }`, where `pages` is a filename array whose index is the page id. A
|
|
@@ -37,10 +37,11 @@ function parseBitmapFontJsonRecord(text, diagnostics) {
|
|
|
37
37
|
let droppedChars = 0;
|
|
38
38
|
let droppedKernings = 0;
|
|
39
39
|
const rawChars = root.chars;
|
|
40
|
-
|
|
40
|
+
const charIterable = Array.isArray(rawChars) ? rawChars : isObject(rawChars) ? Object.values(rawChars) : null;
|
|
41
|
+
if (charIterable === null)
|
|
41
42
|
return null;
|
|
42
43
|
const chars = [];
|
|
43
|
-
for (const raw of
|
|
44
|
+
for (const raw of charIterable) {
|
|
44
45
|
const char = readJsonChar(raw);
|
|
45
46
|
if (char === null)
|
|
46
47
|
droppedChars++;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmapFontJson.js","sourceRoot":"","sources":["../src/bitmapFontJson.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bitmapFontJson.js","sourceRoot":"","sources":["../src/bitmapFontJson.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAGlG,wGAAwG;AACxG,oGAAoG;AACpG,+FAA+F;AAC/F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AK,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5E,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { BitmapFont,
|
|
1
|
+
import type { BitmapFont, BitmapFontParseOptions } from '@flighthq/bitmapfont/contract';
|
|
2
|
+
import type { ImportDiagnostic } from '@flighthq/importdiagnostics/contract';
|
|
3
|
+
import type { BitmapFontRecord } from './types.ts';
|
|
2
4
|
export declare function buildBitmapFontFromRecord(record: Readonly<BitmapFontRecord>, options?: Readonly<BitmapFontParseOptions>): BitmapFont | null;
|
|
3
5
|
/**
|
|
4
6
|
* Reports the records a parse dropped, once per kind rather than once per record.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmapFontRecord.d.ts","sourceRoot":"","sources":["../src/bitmapFontRecord.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bitmapFontRecord.d.ts","sourceRoot":"","sources":["../src/bitmapFontRecord.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EAIV,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAG7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAanD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,EAClC,OAAO,CAAC,EAAE,QAAQ,CAAC,sBAAsB,CAAC,GACzC,UAAU,GAAG,IAAI,CAyDnB;AAED;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,gBAAgB,EAAE,GAAG,SAAS,EAC3C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACf,IAAI,CAgBN"}
|
package/dist/bitmapFontRecord.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createBitmapFont } from '@flighthq/bitmapfont/contract';
|
|
2
|
-
import { reportImportDiagnostic } from '@flighthq/importdiagnostics/contract';
|
|
3
|
-
import { ImportDiagnosticSeverity } from '@flighthq/types/contract';
|
|
2
|
+
import { ImportDiagnosticSeverity, reportImportDiagnostic } from '@flighthq/importdiagnostics/contract';
|
|
4
3
|
// Maps a parsed `BitmapFontRecord` onto a `BitmapFont` via `createBitmapFont`, resolving every atlas
|
|
5
4
|
// page the record declares through `options.resolvePage` (called once per page id). The resolved
|
|
6
5
|
// atlases become the font's page-indexed `pages` (page id = index), and each `char`'s `page` carries
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmapFontRecord.js","sourceRoot":"","sources":["../src/bitmapFontRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"bitmapFontRecord.js","sourceRoot":"","sources":["../src/bitmapFontRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAQjE,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAMxG,qGAAqG;AACrG,iGAAiG;AACjG,qGAAqG;AACrG,+FAA+F;AAC/F,oGAAoG;AACpG,oGAAoG;AACpG,yFAAyF;AACzF,+FAA+F;AAC/F,gGAAgG;AAChG,+FAA+F;AAC/F,cAAc;AACd,MAAM,UAAU,yBAAyB,CACvC,MAAkC,EAClC,OAA0C;IAE1C,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAwB,CAAC;IACjD,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC;IACnB,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAChC,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,C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W,EAAE,wBAAwB,CAAC,IAAI,EAAE,2BAA2B,EAAE,MAAM,EAAE;YACtG,OAAO,EAAE,QAAQ;SAClB,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
package/dist/bitmapFontXml.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { BitmapFont,
|
|
1
|
+
import type { BitmapFont, BitmapFontParseOptions } from '@flighthq/bitmapfont/contract';
|
|
2
|
+
import type { ImportDiagnostic } from '@flighthq/importdiagnostics/contract';
|
|
2
3
|
export declare function parseBitmapFontXml(text: string, options?: Readonly<BitmapFontParseOptions>, diagnostics?: ImportDiagnostic[]): BitmapFont | null;
|
|
3
4
|
//# sourceMappingURL=bitmapFontXml.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmapFontXml.d.ts","sourceRoot":"","sources":["../src/bitmapFontXml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"bitmapFontXml.d.ts","sourceRoot":"","sources":["../src/bitmapFontXml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAkB7E,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,QAAQ,CAAC,sBAAsB,CAAC,EAC1C,WAAW,CAAC,EAAE,gBAAgB,EAAE,GAC/B,UAAU,GAAG,IAAI,CAInB"}
|
package/dist/bitmapFontXml.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getXmlElementAttribute, getXmlElementAttributeNumber, getXmlElementChildByName, getXmlElementChildrenByName, parseXmlDocument, } from '@flighthq/xml/contract';
|
|
2
|
-
import { buildBitmapFontFromRecord, reportDroppedBitmapFontRecords } from './bitmapFontRecord';
|
|
2
|
+
import { buildBitmapFontFromRecord, reportDroppedBitmapFontRecords } from './bitmapFontRecord.js';
|
|
3
3
|
// Parses the XML AngelCode/BMFont `.fnt` variant into a `BitmapFont`. The document is
|
|
4
4
|
// `<font><info/><common/><pages><page/></pages><chars><char/></chars><kernings><kerning/></kernings></font>`
|
|
5
5
|
// with every field an element attribute. Semantics match `parseBitmapFontFnt` — the same line metrics,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmapFontXml.js","sourceRoot":"","sources":["../src/bitmapFontXml.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bitmapFontXml.js","sourceRoot":"","sources":["../src/bitmapFontXml.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAGlG,sFAAsF;AACtF,6GAA6G;AAC7G,uGAAuG;AACvG,qGAAqG;AACrG,2FAA2F;AAC3F,MAAM,UAAU,kBAAkB,CAChC,IAAY,EACZ,OAA0C,EAC1C,WAAgC;IAEhC,MAAM,MAAM,GAAG,wBAAwB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC3D,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACjC,OAAO,yBAAyB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC;AAED,qGAAqG;AACrG,+CAA+C;AAC/C,SAAS,wBAAwB,CAAC,IAAY,EAAE,WAA2C;IACzF,MAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAEvD,MAAM,MAAM,GAAG,wBAAwB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;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AS,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,4BAA4B,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACjE,MAAM,QAAQ,GAAG,4BAA4B,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACnE,IACE,EAAE,KAAK,IAAI;QACX,CAAC,KAAK,IAAI;QACV,CAAC,KAAK,IAAI;QACV,KAAK,KAAK,IAAI;QACd,MAAM,KAAK,IAAI;QACf,OAAO,KAAK,IAAI;QAChB,OAAO,KAAK,IAAI;QAChB,QAAQ,KAAK,IAAI,EACjB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO;QACL,MAAM;QACN,EAAE;QACF,IAAI,EAAE,4BAA4B,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC;QACxD,KAAK;QACL,CAAC;QACD,QAAQ;QACR,OAAO;QACP,CAAC;QACD,OAAO;KACR,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,OAA6B;IACnD,MAAM,KAAK,GAAG,4BAA4B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,4BAA4B,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAG,4BAA4B,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC/D,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACtE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The requirement-key namespace for this format family.
|
|
3
|
+
*
|
|
4
|
+
* Every format package exports one, and the catalog sweep in `catalog-rows.test.ts` reads them off the packages
|
|
5
|
+
* rather than keeping its own list — so a family whose namespace is not exported here is a family the catalog can
|
|
6
|
+
* silently stop covering.
|
|
7
|
+
*/
|
|
8
|
+
export declare const BITMAP_FONT_REQUIREMENT_KEY_NAMESPACE = "bitmapfont";
|
|
9
|
+
//# sourceMappingURL=bitmapfontFormatRequirements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitmapfontFormatRequirements.d.ts","sourceRoot":"","sources":["../src/bitmapfontFormatRequirements.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,qCAAqC,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The requirement-key namespace for this format family.
|
|
3
|
+
*
|
|
4
|
+
* Every format package exports one, and the catalog sweep in `catalog-rows.test.ts` reads them off the packages
|
|
5
|
+
* rather than keeping its own list — so a family whose namespace is not exported here is a family the catalog can
|
|
6
|
+
* silently stop covering.
|
|
7
|
+
*/
|
|
8
|
+
export const BITMAP_FONT_REQUIREMENT_KEY_NAMESPACE = 'bitmapfont';
|
|
9
|
+
//# sourceMappingURL=bitmapfontFormatRequirements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitmapfontFormatRequirements.js","sourceRoot":"","sources":["../src/bitmapfontFormatRequirements.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.bitmapfont-formats-types.d.ts","sourceRoot":"","sources":["../src/contract.bitmapfont-formats-types.ts"],"names":[],"mappings":"AAEA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Acyclic build entry selected by contract-only projects through the `.bitmapfont-formats-types` module suffix.
|
|
2
|
+
// The published @flighthq/bitmapfont-formats/contract entry remains contract.ts, which adds runtime values.
|
|
3
|
+
export * from './types.js';
|
|
4
|
+
//# sourceMappingURL=contract.bitmapfont-formats-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.bitmapfont-formats-types.js","sourceRoot":"","sources":["../src/contract.bitmapfont-formats-types.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAChH,4GAA4G;AAC5G,cAAc,YAAY,CAAC"}
|
package/dist/contract.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './bitmapfontFormatRequirements.ts';
|
|
2
|
+
export * from './bitmapFontDetect.ts';
|
|
3
|
+
export * from './bitmapFontBinary.ts';
|
|
4
|
+
export * from './bitmapFontFnt.ts';
|
|
5
|
+
export * from './bitmapFontFormatKind.ts';
|
|
6
|
+
export * from './bitmapFontJson.ts';
|
|
7
|
+
export * from './bitmapFontRecord.ts';
|
|
8
|
+
export * from './bitmapFontXml.ts';
|
|
9
|
+
export * from './explainBitmapFontParse.ts';
|
|
10
|
+
export * from './types.ts';
|
|
4
11
|
//# sourceMappingURL=contract.d.ts.map
|
package/dist/contract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,YAAY,CAAC"}
|
package/dist/contract.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './bitmapfontFormatRequirements.js';
|
|
2
|
+
export * from './bitmapFontDetect.js';
|
|
3
|
+
export * from './bitmapFontBinary.js';
|
|
4
|
+
export * from './bitmapFontFnt.js';
|
|
5
|
+
export * from './bitmapFontFormatKind.js';
|
|
6
|
+
export * from './bitmapFontJson.js';
|
|
7
|
+
export * from './bitmapFontRecord.js';
|
|
8
|
+
export * from './bitmapFontXml.js';
|
|
9
|
+
export * from './explainBitmapFontParse.js';
|
|
10
|
+
export * from './types.js';
|
|
4
11
|
//# sourceMappingURL=contract.js.map
|
package/dist/contract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,YAAY,CAAC"}
|