docxkeun 0.1.2 → 0.2.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/CHANGELOG.md +55 -0
- package/README.md +139 -16
- package/dist/api/editor.d.ts +172 -5
- package/dist/api/editor.js +814 -24
- package/dist/api/headers.d.ts +51 -0
- package/dist/api/headers.js +133 -0
- package/dist/api/index.d.ts +5 -1
- package/dist/api/index.js +4 -1
- package/dist/api/lists.d.ts +37 -0
- package/dist/api/lists.js +132 -0
- package/dist/api/parts.js +1 -0
- package/dist/api/positions.js +1 -0
- package/dist/api/revisions.d.ts +61 -0
- package/dist/api/revisions.js +390 -0
- package/dist/api/selection.d.ts +57 -0
- package/dist/api/selection.js +91 -0
- package/dist/charts/color.d.ts +45 -0
- package/dist/charts/color.js +322 -0
- package/dist/charts/format.d.ts +12 -0
- package/dist/charts/format.js +459 -0
- package/dist/charts/index.d.ts +11 -0
- package/dist/charts/index.js +8 -0
- package/dist/charts/model.d.ts +225 -0
- package/dist/charts/model.js +758 -0
- package/dist/charts/outline.d.ts +17 -0
- package/dist/charts/outline.js +214 -0
- package/dist/charts/render.d.ts +20 -0
- package/dist/charts/render.js +1772 -0
- package/dist/drawing/arrows.d.ts +37 -0
- package/dist/drawing/arrows.js +99 -0
- package/dist/drawing/formula.d.ts +40 -0
- package/dist/drawing/formula.js +159 -0
- package/dist/drawing/geometry.d.ts +61 -0
- package/dist/drawing/geometry.js +286 -0
- package/dist/drawing/index.d.ts +12 -0
- package/dist/drawing/index.js +8 -0
- package/dist/drawing/presets.d.ts +72 -0
- package/dist/drawing/presets.js +2874 -0
- package/dist/fonts/shaping/apply.d.ts +94 -0
- package/dist/fonts/shaping/apply.js +349 -0
- package/dist/fonts/shaping/arabic.d.ts +28 -0
- package/dist/fonts/shaping/arabic.js +235 -0
- package/dist/fonts/shaping/buffer.d.ts +53 -0
- package/dist/fonts/shaping/buffer.js +95 -0
- package/dist/fonts/shaping/gdef.d.ts +30 -0
- package/dist/fonts/shaping/gdef.js +66 -0
- package/dist/fonts/shaping/gpos.d.ts +86 -0
- package/dist/fonts/shaping/gpos.js +428 -0
- package/dist/fonts/shaping/gsub.d.ts +65 -0
- package/dist/fonts/shaping/gsub.js +313 -0
- package/dist/fonts/shaping/index.d.ts +32 -0
- package/dist/fonts/shaping/index.js +402 -0
- package/dist/fonts/shaping/indic.d.ts +6 -0
- package/dist/fonts/shaping/indic.js +805 -0
- package/dist/fonts/shaping/layout-common.d.ts +124 -0
- package/dist/fonts/shaping/layout-common.js +349 -0
- package/dist/fonts/shaping/plan.d.ts +87 -0
- package/dist/fonts/shaping/plan.js +152 -0
- package/dist/fonts/shaping/scripts.d.ts +26 -0
- package/dist/fonts/shaping/scripts.js +160 -0
- package/dist/fonts/shaping/shaper.d.ts +23 -0
- package/dist/fonts/shaping/shaper.js +5 -0
- package/dist/fonts/shaping/unicode.d.ts +34 -0
- package/dist/fonts/shaping/unicode.js +138 -0
- package/dist/images/bmp.d.ts +9 -0
- package/dist/images/bmp.js +234 -0
- package/dist/images/gif.d.ts +9 -0
- package/dist/images/gif.js +215 -0
- package/dist/images/index.d.ts +18 -0
- package/dist/images/index.js +63 -0
- package/dist/images/png-encode.d.ts +4 -0
- package/dist/images/png-encode.js +73 -0
- package/dist/images/size.d.ts +10 -0
- package/dist/images/size.js +83 -0
- package/dist/images/tiff.d.ts +14 -0
- package/dist/images/tiff.js +407 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +5 -0
- package/dist/layout/bidi.d.ts +18 -0
- package/dist/layout/bidi.js +71 -0
- package/dist/layout/blocks.d.ts +20 -3
- package/dist/layout/blocks.js +88 -58
- package/dist/layout/cache.d.ts +31 -0
- package/dist/layout/cache.js +38 -0
- package/dist/layout/drawing.d.ts +30 -0
- package/dist/layout/drawing.js +120 -0
- package/dist/layout/engine.d.ts +3 -0
- package/dist/layout/engine.js +218 -11
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.js +1 -0
- package/dist/layout/lines.d.ts +63 -5
- package/dist/layout/lines.js +245 -20
- package/dist/layout/paint.d.ts +25 -3
- package/dist/layout/paint.js +26 -10
- package/dist/layout/shapes.d.ts +7 -0
- package/dist/layout/shapes.js +338 -0
- package/dist/layout/style.d.ts +4 -0
- package/dist/layout/style.js +2 -0
- package/dist/layout/types.d.ts +89 -2
- package/dist/math/boxes.d.ts +88 -0
- package/dist/math/boxes.js +166 -0
- package/dist/math/index.d.ts +29 -0
- package/dist/math/index.js +44 -0
- package/dist/math/layout.d.ts +13 -0
- package/dist/math/layout.js +771 -0
- package/dist/math/linear.d.ts +3 -0
- package/dist/math/linear.js +152 -0
- package/dist/math/omml.d.ts +15 -0
- package/dist/math/omml.js +57 -0
- package/dist/math/paths.d.ts +61 -0
- package/dist/math/paths.js +450 -0
- package/dist/math/symbols.d.ts +49 -0
- package/dist/math/symbols.js +269 -0
- package/dist/math/text.d.ts +53 -0
- package/dist/math/text.js +316 -0
- package/dist/metafile/canvas.d.ts +80 -0
- package/dist/metafile/canvas.js +515 -0
- package/dist/metafile/dib.d.ts +27 -0
- package/dist/metafile/dib.js +300 -0
- package/dist/metafile/emf.d.ts +31 -0
- package/dist/metafile/emf.js +591 -0
- package/dist/metafile/geometry.d.ts +49 -0
- package/dist/metafile/geometry.js +85 -0
- package/dist/metafile/index.d.ts +27 -0
- package/dist/metafile/index.js +34 -0
- package/dist/metafile/reader.d.ts +28 -0
- package/dist/metafile/reader.js +59 -0
- package/dist/metafile/state.d.ts +118 -0
- package/dist/metafile/state.js +172 -0
- package/dist/metafile/text.d.ts +17 -0
- package/dist/metafile/text.js +130 -0
- package/dist/metafile/wmf.d.ts +33 -0
- package/dist/metafile/wmf.js +395 -0
- package/dist/model/content.d.ts +92 -7
- package/dist/model/content.js +251 -17
- package/dist/model/document.d.ts +34 -1
- package/dist/model/document.js +80 -1
- package/dist/model/fields.d.ts +4 -0
- package/dist/model/fields.js +10 -0
- package/dist/model/numbering.d.ts +2 -0
- package/dist/model/numbering.js +22 -0
- package/dist/model/props.d.ts +2 -0
- package/dist/model/props.js +3 -0
- package/dist/opc/index.d.ts +1 -1
- package/dist/opc/package.d.ts +34 -0
- package/dist/opc/package.js +58 -4
- package/dist/pdf/export.js +97 -6
- package/dist/pdf/images.d.ts +7 -0
- package/dist/pdf/images.js +39 -2
- package/dist/render/activity.d.ts +138 -0
- package/dist/render/activity.js +794 -0
- package/dist/render/clipboard.d.ts +29 -0
- package/dist/render/clipboard.js +401 -0
- package/dist/render/comments.d.ts +166 -0
- package/dist/render/comments.js +779 -0
- package/dist/render/context-menu.d.ts +124 -0
- package/dist/render/context-menu.js +525 -0
- package/dist/render/editing.d.ts +146 -5
- package/dist/render/editing.js +678 -53
- package/dist/render/index.d.ts +12 -0
- package/dist/render/index.js +11 -0
- package/dist/render/navigation-panel.d.ts +76 -0
- package/dist/render/navigation-panel.js +431 -0
- package/dist/render/selection.js +5 -0
- package/dist/render/svg.d.ts +4 -6
- package/dist/render/svg.js +69 -7
- package/dist/render/toolbar.d.ts +83 -0
- package/dist/render/toolbar.js +505 -0
- package/dist/render/ui/comment-layout.d.ts +39 -0
- package/dist/render/ui/comment-layout.js +79 -0
- package/dist/render/ui/icons.d.ts +6 -0
- package/dist/render/ui/icons.js +38 -0
- package/dist/render/ui/menu.d.ts +38 -0
- package/dist/render/ui/menu.js +274 -0
- package/dist/render/ui/nav-model.d.ts +11 -0
- package/dist/render/ui/nav-model.js +34 -0
- package/dist/render/ui/overflow.d.ts +5 -0
- package/dist/render/ui/overflow.js +18 -0
- package/dist/render/ui/popover.d.ts +18 -0
- package/dist/render/ui/popover.js +109 -0
- package/dist/render/ui/theme.d.ts +2 -0
- package/dist/render/ui/theme.js +29 -0
- package/dist/render/undo.d.ts +76 -0
- package/dist/render/undo.js +144 -0
- package/dist/render/viewer.d.ts +100 -7
- package/dist/render/viewer.js +302 -92
- package/dist/security/policy.d.ts +3 -0
- package/dist/security/policy.js +6 -2
- package/dist/security/protection.d.ts +1 -0
- package/dist/security/protection.js +1 -1
- package/dist/text/bidi-data.d.ts +53 -0
- package/dist/text/bidi-data.js +318 -0
- package/dist/text/bidi.d.ts +37 -0
- package/dist/text/bidi.js +508 -0
- package/dist/xml/ns.d.ts +5 -0
- package/dist/xml/ns.js +7 -0
- package/package.json +9 -2
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
export const GLOBAL_MASK = 1;
|
|
2
|
+
export class PlanBuilder {
|
|
3
|
+
entries = [];
|
|
4
|
+
stage = [0, 0];
|
|
5
|
+
pauses = [[], []];
|
|
6
|
+
/** Adds a feature to the current stage of both tables (it runs wherever the font has it). */
|
|
7
|
+
add(tag, flags = {}) {
|
|
8
|
+
this.entries.push({ tag, flags, stage: [this.stage[0], this.stage[1]] });
|
|
9
|
+
}
|
|
10
|
+
enable(tag, flags = {}) {
|
|
11
|
+
this.add(tag, { ...flags, global: true });
|
|
12
|
+
}
|
|
13
|
+
has(tag) {
|
|
14
|
+
return this.entries.some((e) => e.tag === tag);
|
|
15
|
+
}
|
|
16
|
+
remove(tag) {
|
|
17
|
+
for (let i = this.entries.length - 1; i >= 0; i--)
|
|
18
|
+
if (this.entries[i].tag === tag)
|
|
19
|
+
this.entries.splice(i, 1);
|
|
20
|
+
}
|
|
21
|
+
pauseGsub(hook) {
|
|
22
|
+
this.pauses[0].push({ stage: this.stage[0], hook });
|
|
23
|
+
this.stage[0]++;
|
|
24
|
+
}
|
|
25
|
+
compile(gsub, gpos, gsubSel, gposSel) {
|
|
26
|
+
// Merge repeated requests: the first one's joiner/syllable flags win, the last decides
|
|
27
|
+
// whether it is global, and it runs in the earliest stage asked for.
|
|
28
|
+
const merged = new Map();
|
|
29
|
+
for (const e of this.entries) {
|
|
30
|
+
const prev = merged.get(e.tag);
|
|
31
|
+
if (!prev) {
|
|
32
|
+
merged.set(e.tag, { tag: e.tag, flags: { ...e.flags }, stage: [e.stage[0], e.stage[1]] });
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
prev.flags.global = e.flags.global;
|
|
36
|
+
prev.flags.fallback = prev.flags.fallback || e.flags.fallback;
|
|
37
|
+
prev.stage[0] = Math.min(prev.stage[0], e.stage[0]);
|
|
38
|
+
prev.stage[1] = Math.min(prev.stage[1], e.stage[1]);
|
|
39
|
+
}
|
|
40
|
+
const tables = [gsub?.layout, gpos?.layout];
|
|
41
|
+
const sels = [gsubSel, gposSel];
|
|
42
|
+
const plan = new ShapePlan(gsub, gpos, gsubSel?.scriptTag, gposSel?.scriptTag);
|
|
43
|
+
let nextBit = 1;
|
|
44
|
+
const active = [];
|
|
45
|
+
for (const entry of merged.values()) {
|
|
46
|
+
const index = [-1, -1];
|
|
47
|
+
for (const t of [0, 1]) {
|
|
48
|
+
const table = tables[t];
|
|
49
|
+
const sel = sels[t];
|
|
50
|
+
if (table && sel)
|
|
51
|
+
index[t] = table.findFeature(sel.langSys, entry.tag);
|
|
52
|
+
}
|
|
53
|
+
if (index[0] < 0 && index[1] < 0 && !entry.flags.fallback)
|
|
54
|
+
continue;
|
|
55
|
+
let mask;
|
|
56
|
+
if (entry.flags.global)
|
|
57
|
+
mask = GLOBAL_MASK;
|
|
58
|
+
else {
|
|
59
|
+
if (nextBit > 30)
|
|
60
|
+
continue; // out of mask bits: drop the feature rather than alias another
|
|
61
|
+
mask = 1 << nextBit++;
|
|
62
|
+
}
|
|
63
|
+
plan.masks.set(entry.tag, mask);
|
|
64
|
+
plan.featureIndex[0].set(entry.tag, index[0]);
|
|
65
|
+
plan.featureIndex[1].set(entry.tag, index[1]);
|
|
66
|
+
active.push({ entry, mask, index });
|
|
67
|
+
}
|
|
68
|
+
for (const t of [0, 1]) {
|
|
69
|
+
const table = tables[t];
|
|
70
|
+
const sel = sels[t];
|
|
71
|
+
const pauses = this.pauses[t];
|
|
72
|
+
const stageCount = pauses.length + 1;
|
|
73
|
+
const stages = [];
|
|
74
|
+
for (let s = 0; s < stageCount; s++) {
|
|
75
|
+
const lookups = [];
|
|
76
|
+
if (table && sel) {
|
|
77
|
+
if (s === 0 && sel.langSys.required >= 0) {
|
|
78
|
+
for (const li of table.featureLookups(sel.langSys.required))
|
|
79
|
+
lookups.push({ index: li, mask: GLOBAL_MASK, autoZwj: true, autoZwnj: true, perSyllable: false });
|
|
80
|
+
}
|
|
81
|
+
for (const { entry, mask, index } of active) {
|
|
82
|
+
if (entry.stage[t] !== s || index[t] < 0)
|
|
83
|
+
continue;
|
|
84
|
+
for (const li of table.featureLookups(index[t])) {
|
|
85
|
+
lookups.push({
|
|
86
|
+
index: li,
|
|
87
|
+
mask,
|
|
88
|
+
autoZwj: !entry.flags.manualZwj,
|
|
89
|
+
autoZwnj: !entry.flags.manualZwnj,
|
|
90
|
+
perSyllable: !!entry.flags.perSyllable,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
lookups.sort((a, b) => a.index - b.index);
|
|
96
|
+
const deduped = [];
|
|
97
|
+
for (const l of lookups) {
|
|
98
|
+
const last = deduped[deduped.length - 1];
|
|
99
|
+
if (last && last.index === l.index) {
|
|
100
|
+
last.mask |= l.mask;
|
|
101
|
+
last.autoZwj &&= l.autoZwj;
|
|
102
|
+
last.autoZwnj &&= l.autoZwnj;
|
|
103
|
+
last.perSyllable ||= l.perSyllable;
|
|
104
|
+
}
|
|
105
|
+
else
|
|
106
|
+
deduped.push({ ...l });
|
|
107
|
+
}
|
|
108
|
+
stages.push({ lookups: deduped, pause: pauses.find((p) => p.stage === s)?.hook });
|
|
109
|
+
}
|
|
110
|
+
if (t === 0)
|
|
111
|
+
plan.gsubStages = stages;
|
|
112
|
+
else
|
|
113
|
+
plan.gposStages = stages;
|
|
114
|
+
}
|
|
115
|
+
return plan;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
export class ShapePlan {
|
|
119
|
+
gsub;
|
|
120
|
+
gpos;
|
|
121
|
+
gsubScript;
|
|
122
|
+
gposScript;
|
|
123
|
+
gsubStages = [];
|
|
124
|
+
gposStages = [];
|
|
125
|
+
masks = new Map();
|
|
126
|
+
featureIndex = [new Map(), new Map()];
|
|
127
|
+
/** Shaper-specific data computed once per plan. */
|
|
128
|
+
shaperData;
|
|
129
|
+
/** Unicode-script tag being shaped ('deva', 'arab', 'DFLT'...). */
|
|
130
|
+
script = 'DFLT';
|
|
131
|
+
constructor(gsub, gpos,
|
|
132
|
+
/** Script tag GSUB/GPOS actually selected ('dev2', 'DFLT', ...), undefined when absent. */
|
|
133
|
+
gsubScript, gposScript) {
|
|
134
|
+
this.gsub = gsub;
|
|
135
|
+
this.gpos = gpos;
|
|
136
|
+
this.gsubScript = gsubScript;
|
|
137
|
+
this.gposScript = gposScript;
|
|
138
|
+
}
|
|
139
|
+
/** Mask bit of a feature, 0 when the plan doesn't apply it. */
|
|
140
|
+
maskOf(tag) {
|
|
141
|
+
return this.masks.get(tag) ?? 0;
|
|
142
|
+
}
|
|
143
|
+
/** Whether the font itself implements the feature (as opposed to a shaper fallback). */
|
|
144
|
+
hasFeature(table, tag) {
|
|
145
|
+
return (this.featureIndex[table].get(tag) ?? -1) >= 0;
|
|
146
|
+
}
|
|
147
|
+
/** GSUB lookups of a feature (for "would this substitute?" queries). */
|
|
148
|
+
gsubLookups(tag) {
|
|
149
|
+
const fi = this.featureIndex[0].get(tag) ?? -1;
|
|
150
|
+
return fi >= 0 && this.gsub ? this.gsub.layout.featureLookups(fi) : [];
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unicode scripts as OpenType script tags, and script itemization of text. The Script
|
|
3
|
+
* property comes from the JS regex engine (\p{Script=...}); results are cached per code
|
|
4
|
+
* point. Common and Inherited characters (spaces, digits, punctuation, combining marks) take
|
|
5
|
+
* the script of the run around them, and paired brackets follow their opening partner, the
|
|
6
|
+
* way ICU and HarfBuzz itemize.
|
|
7
|
+
*/
|
|
8
|
+
/** The OpenType script tag of a code point ('DFLT' for Common, Inherited and unknown). */
|
|
9
|
+
export declare function scriptOf(cp: number): string;
|
|
10
|
+
export interface ScriptRun {
|
|
11
|
+
/** UTF-16 start index (inclusive). */
|
|
12
|
+
start: number;
|
|
13
|
+
/** UTF-16 end index (exclusive). */
|
|
14
|
+
end: number;
|
|
15
|
+
script: string;
|
|
16
|
+
}
|
|
17
|
+
/** Splits text into runs of one script each; neutral characters join the surrounding run. */
|
|
18
|
+
export declare function itemizeScripts(text: string): ScriptRun[];
|
|
19
|
+
/** The first non-neutral script of the text, or 'DFLT'. */
|
|
20
|
+
export declare function detectScript(text: string): string;
|
|
21
|
+
/** Indic scripts with their new-style ("version 2") OpenType tags. */
|
|
22
|
+
export declare const INDIC_NEW_TAGS: Readonly<Record<string, string>>;
|
|
23
|
+
/** Maps a script tag given as 'dev2' etc. back to the Unicode-script tag ('deva'). */
|
|
24
|
+
export declare function canonicalScript(tag: string): string;
|
|
25
|
+
/** Tags to look up in a font for a script, preferred first ('dev2' before 'deva'). */
|
|
26
|
+
export declare function scriptTagCandidates(script: string): string[];
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unicode scripts as OpenType script tags, and script itemization of text. The Script
|
|
3
|
+
* property comes from the JS regex engine (\p{Script=...}); results are cached per code
|
|
4
|
+
* point. Common and Inherited characters (spaces, digits, punctuation, combining marks) take
|
|
5
|
+
* the script of the run around them, and paired brackets follow their opening partner, the
|
|
6
|
+
* way ICU and HarfBuzz itemize.
|
|
7
|
+
*/
|
|
8
|
+
/** Unicode Script value → OpenType script tag. */
|
|
9
|
+
const SCRIPT_TAGS = [
|
|
10
|
+
['Latin', 'latn'], ['Greek', 'grek'], ['Cyrillic', 'cyrl'], ['Armenian', 'armn'], ['Hebrew', 'hebr'],
|
|
11
|
+
['Arabic', 'arab'], ['Syriac', 'syrc'], ['Thaana', 'thaa'], ['Nko', 'nko '], ['Samaritan', 'samr'],
|
|
12
|
+
['Mandaic', 'mand'], ['Devanagari', 'deva'], ['Bengali', 'beng'], ['Gurmukhi', 'guru'], ['Gujarati', 'gujr'],
|
|
13
|
+
['Oriya', 'orya'], ['Tamil', 'taml'], ['Telugu', 'telu'], ['Kannada', 'knda'], ['Malayalam', 'mlym'],
|
|
14
|
+
['Sinhala', 'sinh'], ['Thai', 'thai'], ['Lao', 'lao '], ['Tibetan', 'tibt'], ['Myanmar', 'mymr'],
|
|
15
|
+
['Georgian', 'geor'], ['Hangul', 'hang'], ['Ethiopic', 'ethi'], ['Cherokee', 'cher'],
|
|
16
|
+
['Canadian_Aboriginal', 'cans'], ['Ogham', 'ogam'], ['Runic', 'runr'], ['Khmer', 'khmr'], ['Mongolian', 'mong'],
|
|
17
|
+
['Hiragana', 'kana'], ['Katakana', 'kana'], ['Bopomofo', 'bopo'], ['Han', 'hani'], ['Yi', 'yi '],
|
|
18
|
+
['Tifinagh', 'tfng'], ['Coptic', 'copt'], ['Javanese', 'java'], ['Balinese', 'bali'], ['Sundanese', 'sund'],
|
|
19
|
+
['Tai_Tham', 'lana'], ['Tai_Le', 'tale'], ['New_Tai_Lue', 'talu'], ['Tai_Viet', 'tavt'], ['Cham', 'cham'],
|
|
20
|
+
['Lepcha', 'lepc'], ['Limbu', 'limb'], ['Buginese', 'bugi'], ['Batak', 'batk'], ['Tagalog', 'tglg'],
|
|
21
|
+
['Hanunoo', 'hano'], ['Buhid', 'buhd'], ['Tagbanwa', 'tagb'], ['Vai', 'vai '], ['Ol_Chiki', 'olck'],
|
|
22
|
+
['Meetei_Mayek', 'mtei'], ['Saurashtra', 'saur'], ['Kayah_Li', 'kali'], ['Rejang', 'rjng'], ['Adlam', 'adlm'],
|
|
23
|
+
['Hanifi_Rohingya', 'rohg'], ['Chakma', 'cakm'], ['Sharada', 'shrd'], ['Brahmi', 'brah'], ['Kaithi', 'kthi'],
|
|
24
|
+
['Glagolitic', 'glag'], ['Gothic', 'goth'], ['Braille', 'brai'], ['Bamum', 'bamu'], ['Osage', 'osge'],
|
|
25
|
+
['Lisu', 'lisu'], ['Newa', 'newa'], ['Grantha', 'gran'], ['Tirhuta', 'tirh'], ['Modi', 'modi'], ['Takri', 'takr'],
|
|
26
|
+
['Khojki', 'khoj'], ['Mahajani', 'mahj'], ['Siddham', 'sidd'], ['Ahom', 'ahom'], ['Dogra', 'dogr'],
|
|
27
|
+
['Phags_Pa', 'phag'], ['Syloti_Nagri', 'sylo'], ['Kharoshthi', 'khar'], ['Manichaean', 'mani'],
|
|
28
|
+
['Psalter_Pahlavi', 'phlp'], ['Sogdian', 'sogd'], ['Yezidi', 'yezi'], ['Old_Italic', 'ital'],
|
|
29
|
+
['Deseret', 'dsrt'], ['Shavian', 'shaw'], ['Osmanya', 'osma'], ['Cuneiform', 'xsux'],
|
|
30
|
+
['Egyptian_Hieroglyphs', 'egyp'],
|
|
31
|
+
];
|
|
32
|
+
const NEUTRAL_RES = [/\p{Script=Common}/u, /\p{Script=Inherited}/u];
|
|
33
|
+
let scriptRes;
|
|
34
|
+
const scriptCache = new Map();
|
|
35
|
+
function scriptRegexes() {
|
|
36
|
+
if (!scriptRes) {
|
|
37
|
+
scriptRes = [];
|
|
38
|
+
for (const [name, tag] of SCRIPT_TAGS) {
|
|
39
|
+
try {
|
|
40
|
+
scriptRes.push([new RegExp(`\\p{Script=${name}}`, 'u'), tag]);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// A runtime with older Unicode data: that script just itemizes as 'DFLT'.
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return scriptRes;
|
|
48
|
+
}
|
|
49
|
+
/** The OpenType script tag of a code point ('DFLT' for Common, Inherited and unknown). */
|
|
50
|
+
export function scriptOf(cp) {
|
|
51
|
+
if (cp < 0x80)
|
|
52
|
+
return (cp >= 0x41 && cp <= 0x5a) || (cp >= 0x61 && cp <= 0x7a) ? 'latn' : 'DFLT';
|
|
53
|
+
if (cp >= 0xc0 && cp <= 0x24f && cp !== 0xd7 && cp !== 0xf7)
|
|
54
|
+
return 'latn';
|
|
55
|
+
const cached = scriptCache.get(cp);
|
|
56
|
+
if (cached)
|
|
57
|
+
return cached;
|
|
58
|
+
const s = String.fromCodePoint(cp);
|
|
59
|
+
let tag = 'DFLT';
|
|
60
|
+
if (!NEUTRAL_RES.some((re) => re.test(s))) {
|
|
61
|
+
for (const [re, t] of scriptRegexes()) {
|
|
62
|
+
if (re.test(s)) {
|
|
63
|
+
tag = t;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (scriptCache.size < 8192)
|
|
69
|
+
scriptCache.set(cp, tag);
|
|
70
|
+
return tag;
|
|
71
|
+
}
|
|
72
|
+
const BRACKET_PAIRS = [
|
|
73
|
+
[0x28, 0x29], [0x5b, 0x5d], [0x7b, 0x7d], [0xab, 0xbb], [0x2039, 0x203a], [0x2045, 0x2046], [0x207d, 0x207e],
|
|
74
|
+
[0x208d, 0x208e], [0x2329, 0x232a], [0x27e8, 0x27e9], [0x3008, 0x3009], [0x300a, 0x300b], [0x300c, 0x300d],
|
|
75
|
+
[0x300e, 0x300f], [0x3010, 0x3011], [0x3014, 0x3015], [0x3016, 0x3017], [0x3018, 0x3019], [0x301a, 0x301b],
|
|
76
|
+
[0xff08, 0xff09], [0xff3b, 0xff3d], [0xff5b, 0xff5d], [0xff5f, 0xff60], [0xff62, 0xff63],
|
|
77
|
+
];
|
|
78
|
+
const OPEN_BRACKETS = new Set(BRACKET_PAIRS.map(([o]) => o));
|
|
79
|
+
const CLOSE_TO_OPEN = new Map(BRACKET_PAIRS.map(([o, c]) => [c, o]));
|
|
80
|
+
/** Splits text into runs of one script each; neutral characters join the surrounding run. */
|
|
81
|
+
export function itemizeScripts(text) {
|
|
82
|
+
const runs = [];
|
|
83
|
+
let runStart = 0;
|
|
84
|
+
let runScript = 'DFLT';
|
|
85
|
+
const open = [];
|
|
86
|
+
for (let i = 0; i < text.length;) {
|
|
87
|
+
const cp = text.codePointAt(i);
|
|
88
|
+
let script = scriptOf(cp);
|
|
89
|
+
if (script === 'DFLT') {
|
|
90
|
+
if (OPEN_BRACKETS.has(cp)) {
|
|
91
|
+
if (open.length < 64)
|
|
92
|
+
open.push({ cp, script: runScript });
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const opener = CLOSE_TO_OPEN.get(cp);
|
|
96
|
+
if (opener !== undefined) {
|
|
97
|
+
for (let k = open.length - 1; k >= 0; k--) {
|
|
98
|
+
if (open[k].cp === opener) {
|
|
99
|
+
script = open[k].script;
|
|
100
|
+
open.length = k;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (script !== 'DFLT' && script !== runScript) {
|
|
108
|
+
if (runScript === 'DFLT') {
|
|
109
|
+
runScript = script;
|
|
110
|
+
for (const o of open)
|
|
111
|
+
if (o.script === 'DFLT')
|
|
112
|
+
o.script = script;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
runs.push({ start: runStart, end: i, script: runScript });
|
|
116
|
+
runStart = i;
|
|
117
|
+
runScript = script;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
i += cp > 0xffff ? 2 : 1;
|
|
121
|
+
}
|
|
122
|
+
if (text.length > runStart)
|
|
123
|
+
runs.push({ start: runStart, end: text.length, script: runScript });
|
|
124
|
+
return runs;
|
|
125
|
+
}
|
|
126
|
+
/** The first non-neutral script of the text, or 'DFLT'. */
|
|
127
|
+
export function detectScript(text) {
|
|
128
|
+
for (let i = 0; i < text.length;) {
|
|
129
|
+
const cp = text.codePointAt(i);
|
|
130
|
+
const s = scriptOf(cp);
|
|
131
|
+
if (s !== 'DFLT')
|
|
132
|
+
return s;
|
|
133
|
+
i += cp > 0xffff ? 2 : 1;
|
|
134
|
+
}
|
|
135
|
+
return 'DFLT';
|
|
136
|
+
}
|
|
137
|
+
/** Indic scripts with their new-style ("version 2") OpenType tags. */
|
|
138
|
+
export const INDIC_NEW_TAGS = {
|
|
139
|
+
deva: 'dev2',
|
|
140
|
+
beng: 'bng2',
|
|
141
|
+
guru: 'gur2',
|
|
142
|
+
gujr: 'gjr2',
|
|
143
|
+
orya: 'ory2',
|
|
144
|
+
taml: 'tml2',
|
|
145
|
+
telu: 'tel2',
|
|
146
|
+
knda: 'knd2',
|
|
147
|
+
mlym: 'mlm2',
|
|
148
|
+
};
|
|
149
|
+
const INDIC_OLD_TAGS = Object.fromEntries(Object.entries(INDIC_NEW_TAGS).map(([o, n]) => [n, o]));
|
|
150
|
+
/** Maps a script tag given as 'dev2' etc. back to the Unicode-script tag ('deva'). */
|
|
151
|
+
export function canonicalScript(tag) {
|
|
152
|
+
return INDIC_OLD_TAGS[tag] ?? tag;
|
|
153
|
+
}
|
|
154
|
+
/** Tags to look up in a font for a script, preferred first ('dev2' before 'deva'). */
|
|
155
|
+
export function scriptTagCandidates(script) {
|
|
156
|
+
if (script === 'DFLT')
|
|
157
|
+
return [];
|
|
158
|
+
const newTag = INDIC_NEW_TAGS[script];
|
|
159
|
+
return newTag ? [newTag, script] : [script];
|
|
160
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Script shapers: what features a script needs beyond the common set, in which stages, and
|
|
3
|
+
* the per-script buffer work (joining analysis, syllable reordering). The default shaper
|
|
4
|
+
* (Latin, Greek, Cyrillic, Hebrew, CJK, Thai and everything without a dedicated shaper)
|
|
5
|
+
* adds nothing and relies on the common features.
|
|
6
|
+
*/
|
|
7
|
+
import type { PlanBuilder, ShapeContext } from './plan.js';
|
|
8
|
+
export interface Shaper {
|
|
9
|
+
name: string;
|
|
10
|
+
/** Adds the shaper's features and pauses to the plan, before the common features. */
|
|
11
|
+
collectFeatures?(b: PlanBuilder, script: string): void;
|
|
12
|
+
/** Adjusts features after the common ones were added (e.g. Indic turns 'liga' off). */
|
|
13
|
+
overrideFeatures?(b: PlanBuilder): void;
|
|
14
|
+
/** Sets per-glyph masks / categories once glyphs are mapped, before GSUB. */
|
|
15
|
+
setupMasks?(ctx: ShapeContext): void;
|
|
16
|
+
/** Zero the advance of GDEF mark glyphs after GPOS (marks then sit on their base). */
|
|
17
|
+
zeroMarks: boolean;
|
|
18
|
+
/** Recompose base + combining mark into a precomposed character the font has. */
|
|
19
|
+
compose: boolean;
|
|
20
|
+
/** Characters to decompose even when the font has them (Indic two-part matras). */
|
|
21
|
+
alwaysDecompose?(cp: number): boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const defaultShaper: Shaper;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The few Unicode properties shaping needs beyond scripts: mark general categories (glyph
|
|
3
|
+
* classes for fonts without GDEF, Arabic transparency, cluster formation), default-ignorable
|
|
4
|
+
* code points (ZWJ, ZWNJ, bidi controls: hidden after shaping), and bidi mirroring for
|
|
5
|
+
* right-to-left runs. General categories come from the JS regex engine's Unicode tables
|
|
6
|
+
* (\p{...}), so no data has to be bundled for them.
|
|
7
|
+
*/
|
|
8
|
+
export declare const UFlag: {
|
|
9
|
+
/** General category Mn (non-spacing mark). */
|
|
10
|
+
readonly NonSpacingMark: 1;
|
|
11
|
+
/** Mc (spacing mark). */
|
|
12
|
+
readonly SpacingMark: 2;
|
|
13
|
+
/** Me (enclosing mark). */
|
|
14
|
+
readonly EnclosingMark: 4;
|
|
15
|
+
/** Cf (format control). */
|
|
16
|
+
readonly Format: 8;
|
|
17
|
+
readonly DefaultIgnorable: 16;
|
|
18
|
+
readonly Zwnj: 32;
|
|
19
|
+
readonly Zwj: 64;
|
|
20
|
+
/** Joins the previous character's cluster (marks, variation selectors, emoji modifiers). */
|
|
21
|
+
readonly Continuation: 128;
|
|
22
|
+
};
|
|
23
|
+
/** Default_Ignorable_Code_Point (DerivedCoreProperties), the ranges that occur in text. */
|
|
24
|
+
export declare function isDefaultIgnorable(cp: number): boolean;
|
|
25
|
+
/** UFlag bits for a code point (cached: text reuses few distinct characters). */
|
|
26
|
+
export declare function unicodeFlags(cp: number): number;
|
|
27
|
+
export declare function isExtendedPictographic(cp: number): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether mark `b` must come before mark `a` (canonical reordering). The JS normalizer knows
|
|
30
|
+
* every combining class: NFD swaps a pair exactly when ccc(a) > ccc(b) > 0.
|
|
31
|
+
*/
|
|
32
|
+
export declare function markGoesBefore(b: number, a: number): boolean;
|
|
33
|
+
/** The mirrored counterpart of a code point in right-to-left text, or undefined. */
|
|
34
|
+
export declare function mirrorOf(cp: number): number | undefined;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The few Unicode properties shaping needs beyond scripts: mark general categories (glyph
|
|
3
|
+
* classes for fonts without GDEF, Arabic transparency, cluster formation), default-ignorable
|
|
4
|
+
* code points (ZWJ, ZWNJ, bidi controls: hidden after shaping), and bidi mirroring for
|
|
5
|
+
* right-to-left runs. General categories come from the JS regex engine's Unicode tables
|
|
6
|
+
* (\p{...}), so no data has to be bundled for them.
|
|
7
|
+
*/
|
|
8
|
+
export const UFlag = {
|
|
9
|
+
/** General category Mn (non-spacing mark). */
|
|
10
|
+
NonSpacingMark: 0x01,
|
|
11
|
+
/** Mc (spacing mark). */
|
|
12
|
+
SpacingMark: 0x02,
|
|
13
|
+
/** Me (enclosing mark). */
|
|
14
|
+
EnclosingMark: 0x04,
|
|
15
|
+
/** Cf (format control). */
|
|
16
|
+
Format: 0x08,
|
|
17
|
+
DefaultIgnorable: 0x10,
|
|
18
|
+
Zwnj: 0x20,
|
|
19
|
+
Zwj: 0x40,
|
|
20
|
+
/** Joins the previous character's cluster (marks, variation selectors, emoji modifiers). */
|
|
21
|
+
Continuation: 0x80,
|
|
22
|
+
};
|
|
23
|
+
const RE_MN = /\p{Mn}/u;
|
|
24
|
+
const RE_MC = /\p{Mc}/u;
|
|
25
|
+
const RE_ME = /\p{Me}/u;
|
|
26
|
+
const RE_CF = /\p{Cf}/u;
|
|
27
|
+
const RE_PICTO = /\p{Extended_Pictographic}/u;
|
|
28
|
+
const flagCache = new Map();
|
|
29
|
+
/** Default_Ignorable_Code_Point (DerivedCoreProperties), the ranges that occur in text. */
|
|
30
|
+
export function isDefaultIgnorable(cp) {
|
|
31
|
+
if (cp < 0xad)
|
|
32
|
+
return false;
|
|
33
|
+
return (cp === 0xad ||
|
|
34
|
+
cp === 0x34f ||
|
|
35
|
+
cp === 0x61c ||
|
|
36
|
+
(cp >= 0x115f && cp <= 0x1160) ||
|
|
37
|
+
(cp >= 0x17b4 && cp <= 0x17b5) ||
|
|
38
|
+
(cp >= 0x180b && cp <= 0x180f) ||
|
|
39
|
+
(cp >= 0x200b && cp <= 0x200f) ||
|
|
40
|
+
(cp >= 0x202a && cp <= 0x202e) ||
|
|
41
|
+
(cp >= 0x2060 && cp <= 0x206f) ||
|
|
42
|
+
cp === 0x3164 ||
|
|
43
|
+
(cp >= 0xfe00 && cp <= 0xfe0f) ||
|
|
44
|
+
cp === 0xfeff ||
|
|
45
|
+
cp === 0xffa0 ||
|
|
46
|
+
(cp >= 0xfff0 && cp <= 0xfff8) ||
|
|
47
|
+
(cp >= 0x1bca0 && cp <= 0x1bca3) ||
|
|
48
|
+
(cp >= 0x1d173 && cp <= 0x1d17a) ||
|
|
49
|
+
(cp >= 0xe0000 && cp <= 0xe0fff));
|
|
50
|
+
}
|
|
51
|
+
/** UFlag bits for a code point (cached: text reuses few distinct characters). */
|
|
52
|
+
export function unicodeFlags(cp) {
|
|
53
|
+
if (cp < 0x300)
|
|
54
|
+
return cp === 0xad ? UFlag.Format | UFlag.DefaultIgnorable : 0;
|
|
55
|
+
const cached = flagCache.get(cp);
|
|
56
|
+
if (cached !== undefined)
|
|
57
|
+
return cached;
|
|
58
|
+
const s = String.fromCodePoint(cp);
|
|
59
|
+
let f = 0;
|
|
60
|
+
if (RE_MN.test(s))
|
|
61
|
+
f |= UFlag.NonSpacingMark;
|
|
62
|
+
else if (RE_MC.test(s))
|
|
63
|
+
f |= UFlag.SpacingMark;
|
|
64
|
+
else if (RE_ME.test(s))
|
|
65
|
+
f |= UFlag.EnclosingMark;
|
|
66
|
+
else if (RE_CF.test(s))
|
|
67
|
+
f |= UFlag.Format;
|
|
68
|
+
if (isDefaultIgnorable(cp))
|
|
69
|
+
f |= UFlag.DefaultIgnorable;
|
|
70
|
+
if (cp === 0x200c)
|
|
71
|
+
f |= UFlag.Zwnj;
|
|
72
|
+
if (cp === 0x200d)
|
|
73
|
+
f |= UFlag.Zwj;
|
|
74
|
+
if (f & (UFlag.NonSpacingMark | UFlag.SpacingMark | UFlag.EnclosingMark) ||
|
|
75
|
+
(cp >= 0xfe00 && cp <= 0xfe0f) ||
|
|
76
|
+
(cp >= 0xe0100 && cp <= 0xe01ef) ||
|
|
77
|
+
(cp >= 0x1f3fb && cp <= 0x1f3ff) ||
|
|
78
|
+
(cp >= 0xe0020 && cp <= 0xe007f)) {
|
|
79
|
+
f |= UFlag.Continuation;
|
|
80
|
+
}
|
|
81
|
+
if (flagCache.size < 4096)
|
|
82
|
+
flagCache.set(cp, f);
|
|
83
|
+
return f;
|
|
84
|
+
}
|
|
85
|
+
export function isExtendedPictographic(cp) {
|
|
86
|
+
return cp >= 0xa9 && RE_PICTO.test(String.fromCodePoint(cp));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* HarfBuzz's "modified combining classes" for Hebrew points (SBL order: shin/sin dot and
|
|
90
|
+
* dagesh before vowels, so fonts can compose shin+dot) and Arabic harakat (shadda first, so
|
|
91
|
+
* shadda+vowel ligatures and mark-to-mark stacking work as typed).
|
|
92
|
+
*/
|
|
93
|
+
const MODIFIED_CCC = new Map([
|
|
94
|
+
[0x05b0, 22], [0x05b1, 15], [0x05b2, 16], [0x05b3, 17], [0x05b4, 23], [0x05b5, 18], [0x05b6, 19], [0x05b7, 20],
|
|
95
|
+
[0x05b8, 21], [0x05b9, 14], [0x05ba, 14], [0x05bb, 24], [0x05bc, 12], [0x05bd, 25], [0x05bf, 13], [0x05c1, 10],
|
|
96
|
+
[0x05c2, 11], [0x05c7, 21],
|
|
97
|
+
[0x064b, 28], [0x064c, 29], [0x064d, 30], [0x064e, 31], [0x064f, 32], [0x0650, 33], [0x0651, 27], [0x0652, 34],
|
|
98
|
+
[0x0670, 35],
|
|
99
|
+
]);
|
|
100
|
+
/**
|
|
101
|
+
* Whether mark `b` must come before mark `a` (canonical reordering). The JS normalizer knows
|
|
102
|
+
* every combining class: NFD swaps a pair exactly when ccc(a) > ccc(b) > 0.
|
|
103
|
+
*/
|
|
104
|
+
export function markGoesBefore(b, a) {
|
|
105
|
+
if (a === b)
|
|
106
|
+
return false; // NFD of a doubled mark reads the same "swapped"
|
|
107
|
+
const ma = MODIFIED_CCC.get(a);
|
|
108
|
+
const mb = MODIFIED_CCC.get(b);
|
|
109
|
+
if (ma !== undefined && mb !== undefined)
|
|
110
|
+
return mb < ma;
|
|
111
|
+
const sa = String.fromCodePoint(a);
|
|
112
|
+
const sb = String.fromCodePoint(b);
|
|
113
|
+
if (sa.normalize('NFD') !== sa || sb.normalize('NFD') !== sb)
|
|
114
|
+
return false;
|
|
115
|
+
return (sa + sb).normalize('NFD') === sb + sa;
|
|
116
|
+
}
|
|
117
|
+
/** Bidi_Mirroring_Glyph pairs for the brackets and math signs that occur in documents. */
|
|
118
|
+
const MIRROR_PAIRS = [
|
|
119
|
+
[0x28, 0x29], [0x3c, 0x3e], [0x5b, 0x5d], [0x7b, 0x7d], [0xab, 0xbb], [0x0f3a, 0x0f3b], [0x0f3c, 0x0f3d],
|
|
120
|
+
[0x169b, 0x169c], [0x2039, 0x203a], [0x2045, 0x2046], [0x207d, 0x207e], [0x208d, 0x208e], [0x2208, 0x220b],
|
|
121
|
+
[0x2209, 0x220c], [0x220a, 0x220d], [0x2264, 0x2265], [0x2266, 0x2267], [0x226a, 0x226b], [0x2282, 0x2283],
|
|
122
|
+
[0x2286, 0x2287], [0x2308, 0x2309], [0x230a, 0x230b], [0x2329, 0x232a], [0x2768, 0x2769], [0x276a, 0x276b],
|
|
123
|
+
[0x276c, 0x276d], [0x276e, 0x276f], [0x2770, 0x2771], [0x2772, 0x2773], [0x2774, 0x2775], [0x27e6, 0x27e7],
|
|
124
|
+
[0x27e8, 0x27e9], [0x27ea, 0x27eb], [0x2983, 0x2984], [0x2985, 0x2986], [0x2987, 0x2988], [0x2989, 0x298a],
|
|
125
|
+
[0x3008, 0x3009], [0x300a, 0x300b], [0x300c, 0x300d], [0x300e, 0x300f], [0x3010, 0x3011], [0x3014, 0x3015],
|
|
126
|
+
[0x3016, 0x3017], [0x3018, 0x3019], [0x301a, 0x301b], [0xfe59, 0xfe5a], [0xfe5b, 0xfe5c], [0xfe5d, 0xfe5e],
|
|
127
|
+
[0xfe64, 0xfe65], [0xff08, 0xff09], [0xff1c, 0xff1e], [0xff3b, 0xff3d], [0xff5b, 0xff5d], [0xff5f, 0xff60],
|
|
128
|
+
[0xff62, 0xff63],
|
|
129
|
+
];
|
|
130
|
+
const MIRRORS = new Map();
|
|
131
|
+
for (const [a, b] of MIRROR_PAIRS) {
|
|
132
|
+
MIRRORS.set(a, b);
|
|
133
|
+
MIRRORS.set(b, a);
|
|
134
|
+
}
|
|
135
|
+
/** The mirrored counterpart of a code point in right-to-left text, or undefined. */
|
|
136
|
+
export function mirrorOf(cp) {
|
|
137
|
+
return MIRRORS.get(cp);
|
|
138
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BMP / DIB decoder producing RGBA pixels. Reads BITMAPCOREHEADER (OS/2 1.x), BITMAPINFOHEADER
|
|
3
|
+
* and its V2–V5 extensions, and the shorter OS/2 2.x headers; 1, 2, 4, 8, 16, 24 and 32 bits per
|
|
4
|
+
* pixel; BI_RGB, BI_BITFIELDS, BI_ALPHABITFIELDS, BI_RLE8 and BI_RLE4.
|
|
5
|
+
*/
|
|
6
|
+
import type { RasterImage } from '../layout/types.js';
|
|
7
|
+
export declare function isBmp(b: Uint8Array): boolean;
|
|
8
|
+
/** Decode a .bmp file (with its 14-byte BITMAPFILEHEADER). */
|
|
9
|
+
export declare function decodeBmp(bytes: Uint8Array): RasterImage;
|