reamkit 1.29.0 → 1.31.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 +60 -24
- package/dist/esm/core/converter/project.js +3 -1
- package/dist/esm/core/crypto/offcrypto.js +1 -1
- package/dist/esm/core/document-model/index.d.ts +1 -1
- package/dist/esm/core/document-model/types.d.ts +65 -0
- package/dist/esm/core/drawingml/shape-render.js +13 -1
- package/dist/esm/core/font/index.d.ts +2 -0
- package/dist/esm/core/font/ttf-build.d.ts +113 -0
- package/dist/esm/core/font/ttf-build.js +1224 -0
- package/dist/esm/core/font/ttf-subset.d.ts +19 -0
- package/dist/esm/core/font/ttf-subset.js +14 -1
- package/dist/esm/core/fonts/index.d.ts +1 -1
- package/dist/esm/core/fonts/provider.d.ts +17 -0
- package/dist/esm/core/fonts/provider.js +27 -2
- package/dist/esm/core/fonts/remote-fonts.d.ts +8 -0
- package/dist/esm/core/fonts/remote-fonts.js +108 -18
- package/dist/esm/core/ir/flow.d.ts +88 -1
- package/dist/esm/core/numbering/index.d.ts +1 -1
- package/dist/esm/core/numbering/state.d.ts +11 -1
- package/dist/esm/core/numbering/state.js +10 -1
- package/dist/esm/core/style-cascade/resolver.js +35 -4
- package/dist/esm/core/style-cascade/types.d.ts +19 -1
- package/dist/esm/core/style-cascade/types.js +3 -0
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/layout/page-doc.d.ts +10 -3
- package/dist/esm/layout/styled-layout.d.ts +48 -7
- package/dist/esm/layout/styled-layout.js +881 -119
- package/dist/esm/layout/turned-section.d.ts +38 -0
- package/dist/esm/layout/turned-section.js +193 -0
- package/dist/esm/pdf/styled-page-emitter.js +78 -2
- package/dist/esm/pdf-reader/annot-draw.js +93 -1
- package/dist/esm/pdf-reader/annots.d.ts +18 -0
- package/dist/esm/pdf-reader/annots.js +86 -9
- package/dist/esm/pdf-reader/cff-outline.d.ts +27 -0
- package/dist/esm/pdf-reader/cff-outline.js +169 -21
- package/dist/esm/pdf-reader/cmap.js +5 -2
- package/dist/esm/pdf-reader/content.d.ts +70 -4
- package/dist/esm/pdf-reader/content.js +172 -12
- package/dist/esm/pdf-reader/display.d.ts +36 -0
- package/dist/esm/pdf-reader/display.js +82 -1
- package/dist/esm/pdf-reader/document.js +5 -1
- package/dist/esm/pdf-reader/embedded-fonts.d.ts +25 -0
- package/dist/esm/pdf-reader/embedded-fonts.js +78 -9
- package/dist/esm/pdf-reader/encodings.d.ts +8 -0
- package/dist/esm/pdf-reader/encodings.js +25 -3
- package/dist/esm/pdf-reader/face-outlines.d.ts +78 -0
- package/dist/esm/pdf-reader/face-outlines.js +362 -0
- package/dist/esm/pdf-reader/figures.d.ts +52 -0
- package/dist/esm/pdf-reader/figures.js +433 -0
- package/dist/esm/pdf-reader/flow-build.d.ts +224 -7
- package/dist/esm/pdf-reader/flow-build.js +545 -39
- package/dist/esm/pdf-reader/font.d.ts +27 -1
- package/dist/esm/pdf-reader/font.js +632 -63
- package/dist/esm/pdf-reader/glyf-outline.d.ts +33 -0
- package/dist/esm/pdf-reader/glyf-outline.js +148 -3
- package/dist/esm/pdf-reader/glyph-names.js +154 -1
- package/dist/esm/pdf-reader/glyph-shapes.d.ts +18 -0
- package/dist/esm/pdf-reader/glyph-shapes.js +57 -0
- package/dist/esm/pdf-reader/image-decode.js +70 -4
- package/dist/esm/pdf-reader/images.d.ts +5 -0
- package/dist/esm/pdf-reader/images.js +4 -2
- package/dist/esm/pdf-reader/jbig2.d.ts +40 -1
- package/dist/esm/pdf-reader/jbig2.js +78 -16
- package/dist/esm/pdf-reader/jpeg.d.ts +6 -3
- package/dist/esm/pdf-reader/jpeg.js +21 -1
- package/dist/esm/pdf-reader/layout.d.ts +119 -2
- package/dist/esm/pdf-reader/layout.js +2219 -184
- package/dist/esm/pdf-reader/lexer.d.ts +10 -0
- package/dist/esm/pdf-reader/lexer.js +17 -0
- package/dist/esm/pdf-reader/page-numbers.d.ts +53 -0
- package/dist/esm/pdf-reader/page-numbers.js +167 -0
- package/dist/esm/pdf-reader/pattern-tint.d.ts +11 -1
- package/dist/esm/pdf-reader/pattern-tint.js +21 -3
- package/dist/esm/pdf-reader/regions.d.ts +25 -0
- package/dist/esm/pdf-reader/regions.js +167 -0
- package/dist/esm/pdf-reader/shading.d.ts +58 -2
- package/dist/esm/pdf-reader/shading.js +181 -11
- package/dist/esm/pdf-reader/struct-tree.js +112 -8
- package/dist/esm/pdf-reader/tagged.js +207 -28
- package/dist/esm/pdf-reader/text-rules.js +1 -1
- package/dist/esm/pdf-reader/text.d.ts +6 -3
- package/dist/esm/pdf-reader/text.js +106 -22
- package/dist/esm/pdf-reader/type1-outline.d.ts +11 -0
- package/dist/esm/pdf-reader/type1-outline.js +63 -8
- package/dist/esm/pdf-reader/vector.d.ts +8 -2
- package/dist/esm/pdf-reader/vector.js +105 -6
- package/dist/esm/word/doc/doc-reader.js +6 -2
- package/dist/esm/word/doc/doc-text.d.ts +6 -0
- package/dist/esm/word/doc/doc-text.js +19 -1
- package/dist/esm/word/document-parser.d.ts +2 -2
- package/dist/esm/word/document-parser.js +11 -1
- package/dist/esm/word/docx-reader.js +5 -3
- package/dist/esm/word/docx-writer.js +341 -54
- package/dist/esm/word/drawing-parser.d.ts +5 -3
- package/dist/esm/word/drawing-parser.js +56 -10
- package/dist/esm/word/font-embed.d.ts +30 -0
- package/dist/esm/word/font-embed.js +173 -0
- package/dist/esm/word/font-table.d.ts +10 -0
- package/dist/esm/word/font-table.js +13 -1
- package/dist/esm/word/index.js +1 -1
- package/dist/esm/word/numbering-parser.d.ts +3 -1
- package/dist/esm/word/numbering-parser.js +2 -1
- package/dist/esm/word/paragraph-properties.d.ts +7 -6
- package/dist/esm/word/paragraph-properties.js +16 -2
- package/dist/esm/word/run-properties.js +26 -0
- package/package.json +12 -5
|
@@ -41,3 +41,36 @@ export declare function outlineSource(program: Uint8Array): OutlineSource | unde
|
|
|
41
41
|
* states no names of its own (formats 1.0 and 3.0).
|
|
42
42
|
*/
|
|
43
43
|
export declare function postGlyphNames(program: Uint8Array): Map<string, number> | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* OS/2 `fsType` — the embedding a TrueType or OpenType program's licence allows
|
|
46
|
+
* (ISO/IEC 14496-22, OS/2 table).
|
|
47
|
+
*
|
|
48
|
+
* @param program The raw sfnt bytes.
|
|
49
|
+
* @returns The field, or `undefined` where the program carries no OS/2 table —
|
|
50
|
+
* a subsetter may drop it, and then the program states nothing.
|
|
51
|
+
*/
|
|
52
|
+
export declare function sfntFsType(program: Uint8Array): number | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* How far the pen moves after an sfnt program's space, in thousandths of an em:
|
|
55
|
+
* the glyph its `cmap` (or its `post` names) gives U+0020, measured in `hmtx`.
|
|
56
|
+
* A subset keeps the metrics of glyphs it dropped the outlines of, and the
|
|
57
|
+
* width a page's words were set apart by is the one a writer should give the
|
|
58
|
+
* space the page never showed.
|
|
59
|
+
*
|
|
60
|
+
* @param program The raw sfnt bytes.
|
|
61
|
+
* @returns The advance, or `undefined` where the program says nothing of a space.
|
|
62
|
+
*/
|
|
63
|
+
export declare function sfntSpaceAdvance(program: Uint8Array): number | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Every `cmap` subtable an sfnt program carries, keyed `platform,encoding` —
|
|
66
|
+
* `3,1` for Windows Unicode, `3,0` for Windows symbol, `1,0` for Mac Roman.
|
|
67
|
+
*
|
|
68
|
+
* A simple TrueType font reaches its glyphs through whichever of these it has,
|
|
69
|
+
* and which one decides what a code is looked up AS (§9.6.6.4): a character, a
|
|
70
|
+
* symbol code, a Mac Roman byte.
|
|
71
|
+
*
|
|
72
|
+
* @param program The raw sfnt bytes.
|
|
73
|
+
* @returns Subtable → code-to-glyph lookup (0 where it maps nothing). Formats
|
|
74
|
+
* 0, 4, 6 and 12 are read; any other is left out.
|
|
75
|
+
*/
|
|
76
|
+
export declare function cmapSubtables(program: Uint8Array): Map<string, (code: number) => number>;
|
|
@@ -29,8 +29,19 @@ function outlineSource(program) {
|
|
|
29
29
|
if (at + stride * 2 > loca.offset + loca.length) return void 0;
|
|
30
30
|
const read = (o) => longLoca ? safeUint32(view, o) : safeUint16(view, o) * 2;
|
|
31
31
|
const start = read(at);
|
|
32
|
-
|
|
33
|
-
if (end
|
|
32
|
+
let end = read(at + stride);
|
|
33
|
+
if (end === start) return void 0;
|
|
34
|
+
if (end < start) {
|
|
35
|
+
end = glyf.length;
|
|
36
|
+
for (let o = at + stride * 2; o + stride <= loca.offset + loca.length; o += stride) {
|
|
37
|
+
const next = read(o);
|
|
38
|
+
if (next > start) {
|
|
39
|
+
end = Math.min(next, glyf.length);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (end <= start) return void 0;
|
|
44
|
+
}
|
|
34
45
|
if (glyf.offset + end > program.length) return void 0;
|
|
35
46
|
return {
|
|
36
47
|
start: glyf.offset + start,
|
|
@@ -109,6 +120,140 @@ function postGlyphNames(program) {
|
|
|
109
120
|
}
|
|
110
121
|
return out.size > 0 ? out : void 0;
|
|
111
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* OS/2 `fsType` — the embedding a TrueType or OpenType program's licence allows
|
|
125
|
+
* (ISO/IEC 14496-22, OS/2 table).
|
|
126
|
+
*
|
|
127
|
+
* @param program The raw sfnt bytes.
|
|
128
|
+
* @returns The field, or `undefined` where the program carries no OS/2 table —
|
|
129
|
+
* a subsetter may drop it, and then the program states nothing.
|
|
130
|
+
*/
|
|
131
|
+
function sfntFsType(program) {
|
|
132
|
+
let tables;
|
|
133
|
+
try {
|
|
134
|
+
tables = sfntTables(program);
|
|
135
|
+
} catch {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const os2 = tables.get("OS/2");
|
|
139
|
+
if (!os2 || os2.length < 10 || os2.offset + 10 > program.length) return void 0;
|
|
140
|
+
return new DataView(program.buffer, program.byteOffset, program.byteLength).getUint16(os2.offset + 8);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* How far the pen moves after an sfnt program's space, in thousandths of an em:
|
|
144
|
+
* the glyph its `cmap` (or its `post` names) gives U+0020, measured in `hmtx`.
|
|
145
|
+
* A subset keeps the metrics of glyphs it dropped the outlines of, and the
|
|
146
|
+
* width a page's words were set apart by is the one a writer should give the
|
|
147
|
+
* space the page never showed.
|
|
148
|
+
*
|
|
149
|
+
* @param program The raw sfnt bytes.
|
|
150
|
+
* @returns The advance, or `undefined` where the program says nothing of a space.
|
|
151
|
+
*/
|
|
152
|
+
function sfntSpaceAdvance(program) {
|
|
153
|
+
let tables;
|
|
154
|
+
try {
|
|
155
|
+
tables = sfntTables(program);
|
|
156
|
+
} catch {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
const head = tables.get("head");
|
|
160
|
+
const hhea = tables.get("hhea");
|
|
161
|
+
const hmtx = tables.get("hmtx");
|
|
162
|
+
if (!head || !hhea || !hmtx) return void 0;
|
|
163
|
+
const view = new DataView(program.buffer, program.byteOffset, program.byteLength);
|
|
164
|
+
const cmaps = cmapSubtables(program);
|
|
165
|
+
const gid = [
|
|
166
|
+
cmaps.get("3,1")?.(32),
|
|
167
|
+
cmaps.get("0,3")?.(32),
|
|
168
|
+
cmaps.get("3,0")?.(61472),
|
|
169
|
+
cmaps.get("3,0")?.(32),
|
|
170
|
+
cmaps.get("1,0")?.(32)
|
|
171
|
+
].find((gid) => gid !== void 0 && gid > 0) ?? postGlyphNames(program)?.get("space");
|
|
172
|
+
if (gid === void 0 || gid <= 0) return void 0;
|
|
173
|
+
const unitsPerEm = safeUint16(view, head.offset + 18) || 1e3;
|
|
174
|
+
const metrics = safeUint16(view, hhea.offset + 34);
|
|
175
|
+
if (metrics === 0) return void 0;
|
|
176
|
+
const at = hmtx.offset + Math.min(gid, metrics - 1) * 4;
|
|
177
|
+
if (at + 2 > hmtx.offset + hmtx.length) return void 0;
|
|
178
|
+
const advance = safeUint16(view, at);
|
|
179
|
+
return advance > 0 ? advance / unitsPerEm * 1e3 : void 0;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Every `cmap` subtable an sfnt program carries, keyed `platform,encoding` —
|
|
183
|
+
* `3,1` for Windows Unicode, `3,0` for Windows symbol, `1,0` for Mac Roman.
|
|
184
|
+
*
|
|
185
|
+
* A simple TrueType font reaches its glyphs through whichever of these it has,
|
|
186
|
+
* and which one decides what a code is looked up AS (§9.6.6.4): a character, a
|
|
187
|
+
* symbol code, a Mac Roman byte.
|
|
188
|
+
*
|
|
189
|
+
* @param program The raw sfnt bytes.
|
|
190
|
+
* @returns Subtable → code-to-glyph lookup (0 where it maps nothing). Formats
|
|
191
|
+
* 0, 4, 6 and 12 are read; any other is left out.
|
|
192
|
+
*/
|
|
193
|
+
function cmapSubtables(program) {
|
|
194
|
+
const out = /* @__PURE__ */ new Map();
|
|
195
|
+
let tables;
|
|
196
|
+
try {
|
|
197
|
+
tables = sfntTables(program);
|
|
198
|
+
} catch {
|
|
199
|
+
return out;
|
|
200
|
+
}
|
|
201
|
+
const cmap = tables.get("cmap");
|
|
202
|
+
if (!cmap) return out;
|
|
203
|
+
const view = new DataView(program.buffer, program.byteOffset, program.byteLength);
|
|
204
|
+
const count = safeUint16(view, cmap.offset + 2);
|
|
205
|
+
for (let i = 0; i < count; i++) {
|
|
206
|
+
const at = cmap.offset + 4 + i * 8;
|
|
207
|
+
const key = `${safeUint16(view, at)},${safeUint16(view, at + 2)}`;
|
|
208
|
+
if (out.has(key)) continue;
|
|
209
|
+
const lookup = cmapLookup(view, cmap.offset + safeUint32(view, at + 4));
|
|
210
|
+
if (lookup) out.set(key, lookup);
|
|
211
|
+
}
|
|
212
|
+
return out;
|
|
213
|
+
}
|
|
214
|
+
/** One `cmap` subtable as a lookup, for the formats a simple font's program uses. */
|
|
215
|
+
function cmapLookup(view, at) {
|
|
216
|
+
const format = safeUint16(view, at);
|
|
217
|
+
if (format === 0) return (code) => code >= 0 && code < 256 ? safeUint8(view, at + 6 + code) : 0;
|
|
218
|
+
if (format === 6) {
|
|
219
|
+
const first = safeUint16(view, at + 6);
|
|
220
|
+
const entries = safeUint16(view, at + 8);
|
|
221
|
+
return (code) => code >= first && code < first + entries ? safeUint16(view, at + 10 + (code - first) * 2) : 0;
|
|
222
|
+
}
|
|
223
|
+
if (format === 4) {
|
|
224
|
+
const segments = safeUint16(view, at + 6) >> 1;
|
|
225
|
+
const ends = at + 14;
|
|
226
|
+
const starts = ends + segments * 2 + 2;
|
|
227
|
+
const deltas = starts + segments * 2;
|
|
228
|
+
const ranges = deltas + segments * 2;
|
|
229
|
+
return (code) => {
|
|
230
|
+
if (code < 0 || code > 65535) return 0;
|
|
231
|
+
for (let s = 0; s < segments; s++) {
|
|
232
|
+
if (safeUint16(view, ends + s * 2) < code) continue;
|
|
233
|
+
const start = safeUint16(view, starts + s * 2);
|
|
234
|
+
if (start > code) return 0;
|
|
235
|
+
const delta = safeUint16(view, deltas + s * 2);
|
|
236
|
+
const range = safeUint16(view, ranges + s * 2);
|
|
237
|
+
if (range === 0) return code + delta & 65535;
|
|
238
|
+
const gid = safeUint16(view, ranges + s * 2 + range + (code - start) * 2);
|
|
239
|
+
return gid === 0 ? 0 : gid + delta & 65535;
|
|
240
|
+
}
|
|
241
|
+
return 0;
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
if (format === 12) {
|
|
245
|
+
const groups = safeUint32(view, at + 12);
|
|
246
|
+
return (code) => {
|
|
247
|
+
for (let g = 0; g < groups; g++) {
|
|
248
|
+
const entry = at + 16 + g * 12;
|
|
249
|
+
const start = safeUint32(view, entry);
|
|
250
|
+
const end = safeUint32(view, entry + 4);
|
|
251
|
+
if (code >= start && code <= end) return safeUint32(view, entry + 8) + (code - start);
|
|
252
|
+
}
|
|
253
|
+
return 0;
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
}
|
|
112
257
|
/** `post` version 2.0 — the only one that states names of its own. */
|
|
113
258
|
var POST_NAMED = 131072;
|
|
114
259
|
/** How many names the Macintosh standard order holds (§post). */
|
|
@@ -348,4 +493,4 @@ function safeUint32(view, at) {
|
|
|
348
493
|
return at >= 0 && at + 4 <= view.byteLength ? view.getUint32(at) : 0;
|
|
349
494
|
}
|
|
350
495
|
//#endregion
|
|
351
|
-
export { outlineSource, postGlyphNames };
|
|
496
|
+
export { cmapSubtables, outlineSource, postGlyphNames, sfntFsType, sfntSpaceAdvance };
|
|
@@ -10,16 +10,19 @@ var GLYPHS = {
|
|
|
10
10
|
Adieresis: "Ä",
|
|
11
11
|
Adotaccent: "Ȧ",
|
|
12
12
|
Agrave: "À",
|
|
13
|
+
Alpha: "Α",
|
|
13
14
|
Amacron: "Ā",
|
|
14
15
|
Aogonek: "Ą",
|
|
15
16
|
Aring: "Å",
|
|
16
17
|
Atilde: "Ã",
|
|
17
18
|
Bdotaccent: "Ḃ",
|
|
19
|
+
Beta: "Β",
|
|
18
20
|
Cacute: "Ć",
|
|
19
21
|
Ccaron: "Č",
|
|
20
22
|
Ccedilla: "Ç",
|
|
21
23
|
Ccircumflex: "Ĉ",
|
|
22
24
|
Cdotaccent: "Ċ",
|
|
25
|
+
Chi: "Χ",
|
|
23
26
|
Dcaron: "Ď",
|
|
24
27
|
Dcedilla: "Ḑ",
|
|
25
28
|
Ddotaccent: "Ḋ",
|
|
@@ -34,11 +37,14 @@ var GLYPHS = {
|
|
|
34
37
|
Egrave: "È",
|
|
35
38
|
Emacron: "Ē",
|
|
36
39
|
Eogonek: "Ę",
|
|
40
|
+
Epsilon: "Ε",
|
|
41
|
+
Eta: "Η",
|
|
37
42
|
Eth: "Ð",
|
|
38
43
|
Etilde: "Ẽ",
|
|
39
44
|
Euro: "€",
|
|
40
45
|
Fdotaccent: "Ḟ",
|
|
41
46
|
Gacute: "Ǵ",
|
|
47
|
+
Gamma: "Γ",
|
|
42
48
|
Gbreve: "Ğ",
|
|
43
49
|
Gcaron: "Ǧ",
|
|
44
50
|
Gcedilla: "Ģ",
|
|
@@ -56,26 +62,32 @@ var GLYPHS = {
|
|
|
56
62
|
Icircumflex: "Î",
|
|
57
63
|
Idieresis: "Ï",
|
|
58
64
|
Idotaccent: "İ",
|
|
65
|
+
Ifractur: "ℑ",
|
|
59
66
|
Igrave: "Ì",
|
|
60
67
|
Imacron: "Ī",
|
|
61
68
|
Iogonek: "Į",
|
|
69
|
+
Iota: "Ι",
|
|
62
70
|
Itilde: "Ĩ",
|
|
63
71
|
Jcircumflex: "Ĵ",
|
|
64
72
|
Kacute: "Ḱ",
|
|
73
|
+
Kappa: "Κ",
|
|
65
74
|
Kcaron: "Ǩ",
|
|
66
75
|
Kcedilla: "Ķ",
|
|
67
76
|
Lacute: "Ĺ",
|
|
77
|
+
Lambda: "Λ",
|
|
68
78
|
Lcaron: "Ľ",
|
|
69
79
|
Lcedilla: "Ļ",
|
|
70
80
|
Lslash: "Ł",
|
|
71
81
|
Macute: "Ḿ",
|
|
72
82
|
Mdotaccent: "Ṁ",
|
|
83
|
+
Mu: "Μ",
|
|
73
84
|
Nacute: "Ń",
|
|
74
85
|
Ncaron: "Ň",
|
|
75
86
|
Ncedilla: "Ņ",
|
|
76
87
|
Ndotaccent: "Ṅ",
|
|
77
88
|
Ngrave: "Ǹ",
|
|
78
89
|
Ntilde: "Ñ",
|
|
90
|
+
Nu: "Ν",
|
|
79
91
|
OE: "Œ",
|
|
80
92
|
Oacute: "Ó",
|
|
81
93
|
Obreve: "Ŏ",
|
|
@@ -87,23 +99,32 @@ var GLYPHS = {
|
|
|
87
99
|
Ohungarumlaut: "Ő",
|
|
88
100
|
Omacron: "Ō",
|
|
89
101
|
Omega: "Ω",
|
|
102
|
+
Omicron: "Ο",
|
|
90
103
|
Oogonek: "Ǫ",
|
|
91
104
|
Oslash: "Ø",
|
|
92
105
|
Otilde: "Õ",
|
|
93
106
|
Pacute: "Ṕ",
|
|
94
107
|
Pdotaccent: "Ṗ",
|
|
108
|
+
Phi: "Φ",
|
|
109
|
+
Pi: "Π",
|
|
110
|
+
Psi: "Ψ",
|
|
95
111
|
Racute: "Ŕ",
|
|
96
112
|
Rcaron: "Ř",
|
|
97
113
|
Rcedilla: "Ŗ",
|
|
98
114
|
Rdotaccent: "Ṙ",
|
|
115
|
+
Rfractur: "ℜ",
|
|
116
|
+
Rho: "Ρ",
|
|
99
117
|
Sacute: "Ś",
|
|
100
118
|
Scaron: "Š",
|
|
101
119
|
Scedilla: "Ş",
|
|
102
120
|
Scircumflex: "Ŝ",
|
|
103
121
|
Sdotaccent: "Ṡ",
|
|
122
|
+
Sigma: "Σ",
|
|
123
|
+
Tau: "Τ",
|
|
104
124
|
Tcaron: "Ť",
|
|
105
125
|
Tcedilla: "Ţ",
|
|
106
126
|
Tdotaccent: "Ṫ",
|
|
127
|
+
Theta: "Θ",
|
|
107
128
|
Thorn: "Þ",
|
|
108
129
|
Uacute: "Ú",
|
|
109
130
|
Ubreve: "Ŭ",
|
|
@@ -114,6 +135,8 @@ var GLYPHS = {
|
|
|
114
135
|
Uhungarumlaut: "Ű",
|
|
115
136
|
Umacron: "Ū",
|
|
116
137
|
Uogonek: "Ų",
|
|
138
|
+
Upsilon: "Υ",
|
|
139
|
+
Upsilon1: "ϒ",
|
|
117
140
|
Uring: "Ů",
|
|
118
141
|
Utilde: "Ũ",
|
|
119
142
|
Vtilde: "Ṽ",
|
|
@@ -124,6 +147,7 @@ var GLYPHS = {
|
|
|
124
147
|
Wgrave: "Ẁ",
|
|
125
148
|
Xdieresis: "Ẍ",
|
|
126
149
|
Xdotaccent: "Ẋ",
|
|
150
|
+
Xi: "Ξ",
|
|
127
151
|
Yacute: "Ý",
|
|
128
152
|
Ycircumflex: "Ŷ",
|
|
129
153
|
Ydieresis: "Ÿ",
|
|
@@ -135,6 +159,7 @@ var GLYPHS = {
|
|
|
135
159
|
Zcaron: "Ž",
|
|
136
160
|
Zcircumflex: "Ẑ",
|
|
137
161
|
Zdotaccent: "Ż",
|
|
162
|
+
Zeta: "Ζ",
|
|
138
163
|
aacute: "á",
|
|
139
164
|
abreve: "ă",
|
|
140
165
|
acaron: "ǎ",
|
|
@@ -144,19 +169,46 @@ var GLYPHS = {
|
|
|
144
169
|
adotaccent: "ȧ",
|
|
145
170
|
ae: "æ",
|
|
146
171
|
agrave: "à",
|
|
172
|
+
aleph: "ℵ",
|
|
173
|
+
alpha: "α",
|
|
147
174
|
amacron: "ā",
|
|
148
175
|
ampersand: "&",
|
|
176
|
+
angbracketleft: "⟨",
|
|
177
|
+
angbracketright: "⟩",
|
|
178
|
+
angle: "∠",
|
|
179
|
+
angleleft: "〈",
|
|
180
|
+
angleright: "〉",
|
|
149
181
|
aogonek: "ą",
|
|
150
182
|
approxequal: "≈",
|
|
151
183
|
aring: "å",
|
|
184
|
+
arrowboth: "↔",
|
|
185
|
+
arrowbothv: "↕",
|
|
186
|
+
arrowdblboth: "⇔",
|
|
187
|
+
arrowdblbothv: "⇕",
|
|
188
|
+
arrowdbldown: "⇓",
|
|
189
|
+
arrowdblleft: "⇐",
|
|
190
|
+
arrowdblright: "⇒",
|
|
191
|
+
arrowdblup: "⇑",
|
|
192
|
+
arrowdown: "↓",
|
|
193
|
+
arrowleft: "←",
|
|
194
|
+
arrownortheast: "↗",
|
|
195
|
+
arrownorthwest: "↖",
|
|
196
|
+
arrowright: "→",
|
|
197
|
+
arrowsoutheast: "↘",
|
|
198
|
+
arrowsouthwest: "↙",
|
|
199
|
+
arrowup: "↑",
|
|
200
|
+
arrowupdn: "↕",
|
|
152
201
|
asciicircum: "^",
|
|
153
202
|
asciitilde: "~",
|
|
154
203
|
asterisk: "*",
|
|
204
|
+
asteriskmath: "∗",
|
|
155
205
|
at: "@",
|
|
156
206
|
atilde: "ã",
|
|
157
207
|
backslash: "\\",
|
|
158
208
|
bar: "|",
|
|
209
|
+
bardbl: "‖",
|
|
159
210
|
bdotaccent: "ḃ",
|
|
211
|
+
beta: "β",
|
|
160
212
|
braceleft: "{",
|
|
161
213
|
braceright: "}",
|
|
162
214
|
bracketleft: "[",
|
|
@@ -171,10 +223,22 @@ var GLYPHS = {
|
|
|
171
223
|
ccircumflex: "ĉ",
|
|
172
224
|
cdotaccent: "ċ",
|
|
173
225
|
cedilla: "¸",
|
|
226
|
+
ceilingleft: "⌈",
|
|
227
|
+
ceilingright: "⌉",
|
|
174
228
|
cent: "¢",
|
|
229
|
+
chi: "χ",
|
|
230
|
+
circlecopyrt: "◯",
|
|
231
|
+
circledivide: "⊘",
|
|
232
|
+
circledot: "⊙",
|
|
233
|
+
circleminus: "⊖",
|
|
234
|
+
circlemultiply: "⊗",
|
|
235
|
+
circleplus: "⊕",
|
|
175
236
|
circumflex: "ˆ",
|
|
237
|
+
club: "♣",
|
|
176
238
|
colon: ":",
|
|
177
239
|
comma: ",",
|
|
240
|
+
congruent: "≅",
|
|
241
|
+
coproduct: "⨿",
|
|
178
242
|
copyright: "©",
|
|
179
243
|
currency: "¤",
|
|
180
244
|
dagger: "†",
|
|
@@ -183,11 +247,16 @@ var GLYPHS = {
|
|
|
183
247
|
dcedilla: "ḑ",
|
|
184
248
|
ddotaccent: "ḋ",
|
|
185
249
|
degree: "°",
|
|
250
|
+
delta: "δ",
|
|
251
|
+
diamond: "♢",
|
|
252
|
+
diamondmath: "⋄",
|
|
186
253
|
dieresis: "¨",
|
|
187
254
|
divide: "÷",
|
|
188
255
|
dollar: "$",
|
|
189
256
|
dotaccent: "˙",
|
|
190
257
|
dotlessi: "ı",
|
|
258
|
+
dotlessj: "ȷ",
|
|
259
|
+
dotmath: "⋅",
|
|
191
260
|
eacute: "é",
|
|
192
261
|
ebreve: "ĕ",
|
|
193
262
|
ecaron: "ě",
|
|
@@ -197,17 +266,25 @@ var GLYPHS = {
|
|
|
197
266
|
edotaccent: "ė",
|
|
198
267
|
egrave: "è",
|
|
199
268
|
eight: "8",
|
|
269
|
+
element: "∈",
|
|
200
270
|
ellipsis: "…",
|
|
201
271
|
emacron: "ē",
|
|
202
272
|
emdash: "—",
|
|
273
|
+
emptyset: "∅",
|
|
203
274
|
endash: "–",
|
|
204
275
|
eogonek: "ę",
|
|
276
|
+
epsilon: "ε",
|
|
277
|
+
epsilon1: "ϵ",
|
|
205
278
|
equal: "=",
|
|
279
|
+
equivalence: "≡",
|
|
280
|
+
equivasymptotic: "≍",
|
|
281
|
+
eta: "η",
|
|
206
282
|
eth: "ð",
|
|
207
283
|
etilde: "ẽ",
|
|
208
284
|
euro: "€",
|
|
209
285
|
exclam: "!",
|
|
210
286
|
exclamdown: "¡",
|
|
287
|
+
existential: "∃",
|
|
211
288
|
fdotaccent: "ḟ",
|
|
212
289
|
ff: "ff",
|
|
213
290
|
ffi: "ffi",
|
|
@@ -215,10 +292,16 @@ var GLYPHS = {
|
|
|
215
292
|
fi: "fi",
|
|
216
293
|
five: "5",
|
|
217
294
|
fl: "fl",
|
|
295
|
+
flat: "♭",
|
|
296
|
+
floorleft: "⌊",
|
|
297
|
+
floorright: "⌋",
|
|
218
298
|
florin: "ƒ",
|
|
299
|
+
follows: "≻",
|
|
300
|
+
followsequal: "⪰",
|
|
219
301
|
four: "4",
|
|
220
302
|
fraction: "⁄",
|
|
221
303
|
gacute: "ǵ",
|
|
304
|
+
gamma: "γ",
|
|
222
305
|
gbreve: "ğ",
|
|
223
306
|
gcaron: "ǧ",
|
|
224
307
|
gcedilla: "ģ",
|
|
@@ -226,9 +309,11 @@ var GLYPHS = {
|
|
|
226
309
|
gdotaccent: "ġ",
|
|
227
310
|
germandbls: "ß",
|
|
228
311
|
gmacron: "ḡ",
|
|
312
|
+
gradient: "∇",
|
|
229
313
|
grave: "`",
|
|
230
314
|
greater: ">",
|
|
231
315
|
greaterequal: "≥",
|
|
316
|
+
greatermuch: "≫",
|
|
232
317
|
guillemotleft: "«",
|
|
233
318
|
guillemotright: "»",
|
|
234
319
|
guilsinglleft: "‹",
|
|
@@ -238,6 +323,7 @@ var GLYPHS = {
|
|
|
238
323
|
hcircumflex: "ĥ",
|
|
239
324
|
hdieresis: "ḧ",
|
|
240
325
|
hdotaccent: "ḣ",
|
|
326
|
+
heart: "♡",
|
|
241
327
|
hungarumlaut: "˝",
|
|
242
328
|
hyphen: "-",
|
|
243
329
|
iacute: "í",
|
|
@@ -249,36 +335,54 @@ var GLYPHS = {
|
|
|
249
335
|
infinity: "∞",
|
|
250
336
|
integral: "∫",
|
|
251
337
|
imacron: "ī",
|
|
338
|
+
intersection: "∩",
|
|
339
|
+
intersectionsq: "⊓",
|
|
252
340
|
iogonek: "į",
|
|
341
|
+
iota: "ι",
|
|
253
342
|
itilde: "ĩ",
|
|
254
343
|
jcaron: "ǰ",
|
|
255
344
|
jcircumflex: "ĵ",
|
|
256
345
|
kacute: "ḱ",
|
|
346
|
+
kappa: "κ",
|
|
257
347
|
kcaron: "ǩ",
|
|
258
348
|
kcedilla: "ķ",
|
|
259
349
|
lacute: "ĺ",
|
|
350
|
+
lambda: "λ",
|
|
351
|
+
latticetop: "⊤",
|
|
260
352
|
lcaron: "ľ",
|
|
261
353
|
lcedilla: "ļ",
|
|
262
354
|
less: "<",
|
|
263
355
|
lessequal: "≤",
|
|
356
|
+
lessmuch: "≪",
|
|
357
|
+
logicaland: "∧",
|
|
264
358
|
logicalnot: "¬",
|
|
359
|
+
logicalor: "∨",
|
|
265
360
|
lozenge: "◊",
|
|
361
|
+
lscript: "ℓ",
|
|
266
362
|
lslash: "ł",
|
|
267
363
|
macron: "¯",
|
|
268
364
|
macute: "ḿ",
|
|
365
|
+
mapsto: "↦",
|
|
269
366
|
mdotaccent: "ṁ",
|
|
270
367
|
minus: "−",
|
|
368
|
+
minusplus: "∓",
|
|
271
369
|
mu: "µ",
|
|
272
370
|
multiply: "×",
|
|
371
|
+
nabla: "∇",
|
|
273
372
|
nacute: "ń",
|
|
373
|
+
natural: "♮",
|
|
274
374
|
nbspace: "\xA0",
|
|
275
375
|
ncaron: "ň",
|
|
276
376
|
ncedilla: "ņ",
|
|
277
377
|
ndotaccent: "ṅ",
|
|
378
|
+
negationslash: "̸",
|
|
278
379
|
ngrave: "ǹ",
|
|
279
380
|
nine: "9",
|
|
381
|
+
notelement: "∉",
|
|
280
382
|
notequal: "≠",
|
|
383
|
+
notsubset: "⊄",
|
|
281
384
|
ntilde: "ñ",
|
|
385
|
+
nu: "ν",
|
|
282
386
|
numbersign: "#",
|
|
283
387
|
oacute: "ó",
|
|
284
388
|
obreve: "ŏ",
|
|
@@ -291,15 +395,20 @@ var GLYPHS = {
|
|
|
291
395
|
ograve: "ò",
|
|
292
396
|
ohungarumlaut: "ő",
|
|
293
397
|
omacron: "ō",
|
|
398
|
+
omega: "ω",
|
|
399
|
+
omega1: "ϖ",
|
|
400
|
+
omicron: "ο",
|
|
294
401
|
one: "1",
|
|
295
402
|
onehalf: "½",
|
|
296
403
|
onequarter: "¼",
|
|
297
404
|
onesuperior: "¹",
|
|
298
405
|
oogonek: "ǫ",
|
|
406
|
+
openbullet: "◦",
|
|
299
407
|
ordfeminine: "ª",
|
|
300
408
|
ordmasculine: "º",
|
|
301
409
|
oslash: "ø",
|
|
302
410
|
otilde: "õ",
|
|
411
|
+
owner: "∋",
|
|
303
412
|
pacute: "ṕ",
|
|
304
413
|
paragraph: "¶",
|
|
305
414
|
parenleft: "(",
|
|
@@ -309,11 +418,22 @@ var GLYPHS = {
|
|
|
309
418
|
percent: "%",
|
|
310
419
|
period: ".",
|
|
311
420
|
periodcentered: "·",
|
|
421
|
+
perpendicular: "⊥",
|
|
312
422
|
perthousand: "‰",
|
|
423
|
+
phi: "φ",
|
|
424
|
+
phi1: "ϕ",
|
|
313
425
|
pi: "π",
|
|
426
|
+
pi1: "ϖ",
|
|
314
427
|
plus: "+",
|
|
315
428
|
plusminus: "±",
|
|
429
|
+
precedes: "≺",
|
|
430
|
+
precedesequal: "⪯",
|
|
431
|
+
prime: "′",
|
|
316
432
|
product: "∏",
|
|
433
|
+
propersubset: "⊂",
|
|
434
|
+
propersuperset: "⊃",
|
|
435
|
+
proportional: "∝",
|
|
436
|
+
psi: "ψ",
|
|
317
437
|
question: "?",
|
|
318
438
|
questiondown: "¿",
|
|
319
439
|
quotedbl: "\"",
|
|
@@ -329,7 +449,11 @@ var GLYPHS = {
|
|
|
329
449
|
rcaron: "ř",
|
|
330
450
|
rcedilla: "ŗ",
|
|
331
451
|
rdotaccent: "ṙ",
|
|
452
|
+
reflexsubset: "⊆",
|
|
453
|
+
reflexsuperset: "⊇",
|
|
332
454
|
registered: "®",
|
|
455
|
+
rho: "ρ",
|
|
456
|
+
rho1: "ϱ",
|
|
333
457
|
ring: "˚",
|
|
334
458
|
sacute: "ś",
|
|
335
459
|
scaron: "š",
|
|
@@ -340,22 +464,42 @@ var GLYPHS = {
|
|
|
340
464
|
semicolon: ";",
|
|
341
465
|
seven: "7",
|
|
342
466
|
sfthyphen: "",
|
|
467
|
+
sharp: "♯",
|
|
468
|
+
sigma: "σ",
|
|
469
|
+
sigma1: "ς",
|
|
470
|
+
similar: "∼",
|
|
471
|
+
similarequal: "≃",
|
|
343
472
|
six: "6",
|
|
344
473
|
slash: "/",
|
|
345
474
|
softhyphen: "",
|
|
346
475
|
space: " ",
|
|
476
|
+
spade: "♠",
|
|
477
|
+
star: "⋆",
|
|
347
478
|
sterling: "£",
|
|
479
|
+
subsetsqequal: "⊑",
|
|
480
|
+
suchthat: "∋",
|
|
348
481
|
summation: "∑",
|
|
482
|
+
supersetsqequal: "⊒",
|
|
483
|
+
tau: "τ",
|
|
349
484
|
tcaron: "ť",
|
|
350
485
|
tcedilla: "ţ",
|
|
351
486
|
tdieresis: "ẗ",
|
|
352
487
|
tdotaccent: "ṫ",
|
|
488
|
+
therefore: "∴",
|
|
489
|
+
theta: "θ",
|
|
490
|
+
theta1: "ϑ",
|
|
353
491
|
thorn: "þ",
|
|
354
492
|
three: "3",
|
|
355
493
|
threequarters: "¾",
|
|
356
494
|
threesuperior: "³",
|
|
357
495
|
tilde: "˜",
|
|
358
496
|
trademark: "™",
|
|
497
|
+
triangle: "△",
|
|
498
|
+
triangleinv: "▽",
|
|
499
|
+
triangleleft: "◁",
|
|
500
|
+
triangleright: "▷",
|
|
501
|
+
turnstileleft: "⊢",
|
|
502
|
+
turnstileright: "⊣",
|
|
359
503
|
two: "2",
|
|
360
504
|
twosuperior: "²",
|
|
361
505
|
uacute: "ú",
|
|
@@ -367,7 +511,12 @@ var GLYPHS = {
|
|
|
367
511
|
uhungarumlaut: "ű",
|
|
368
512
|
umacron: "ū",
|
|
369
513
|
underscore: "_",
|
|
514
|
+
union: "∪",
|
|
515
|
+
unionmulti: "⊎",
|
|
516
|
+
unionsq: "⊔",
|
|
517
|
+
universal: "∀",
|
|
370
518
|
uogonek: "ų",
|
|
519
|
+
upsilon: "υ",
|
|
371
520
|
uring: "ů",
|
|
372
521
|
utilde: "ũ",
|
|
373
522
|
vtilde: "ṽ",
|
|
@@ -375,10 +524,13 @@ var GLYPHS = {
|
|
|
375
524
|
wcircumflex: "ŵ",
|
|
376
525
|
wdieresis: "ẅ",
|
|
377
526
|
wdotaccent: "ẇ",
|
|
527
|
+
weierstrass: "℘",
|
|
378
528
|
wgrave: "ẁ",
|
|
529
|
+
wreathproduct: "≀",
|
|
379
530
|
wring: "ẘ",
|
|
380
531
|
xdieresis: "ẍ",
|
|
381
532
|
xdotaccent: "ẋ",
|
|
533
|
+
xi: "ξ",
|
|
382
534
|
yacute: "ý",
|
|
383
535
|
ycircumflex: "ŷ",
|
|
384
536
|
ydieresis: "ÿ",
|
|
@@ -392,7 +544,8 @@ var GLYPHS = {
|
|
|
392
544
|
zcaron: "ž",
|
|
393
545
|
zcircumflex: "ẑ",
|
|
394
546
|
zdotaccent: "ż",
|
|
395
|
-
zero: "0"
|
|
547
|
+
zero: "0",
|
|
548
|
+
zeta: "ζ"
|
|
396
549
|
};
|
|
397
550
|
/**
|
|
398
551
|
* The text a glyph name stands for, or `undefined` when the name says nothing.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PathSeg } from './content.js';
|
|
2
|
+
/** A glyph's contours, and the box they fill, in the page's y-up space. */
|
|
3
|
+
export interface GlyphShape {
|
|
4
|
+
readonly segs: ReadonlyArray<PathSeg>;
|
|
5
|
+
readonly minX: number;
|
|
6
|
+
readonly minY: number;
|
|
7
|
+
readonly maxX: number;
|
|
8
|
+
readonly maxY: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The punctuation mark a glyph's shape is, where it can be only one.
|
|
12
|
+
*
|
|
13
|
+
* @param glyph The glyph as the page draws it.
|
|
14
|
+
* @param baseline The y of the line it stands on.
|
|
15
|
+
* @param size The size the line is set at, which the shape is measured in.
|
|
16
|
+
* @returns The character, or `undefined` where the shape does not say.
|
|
17
|
+
*/
|
|
18
|
+
export declare function punctuationOf(glyph: GlyphShape, baseline: number, size: number): string | undefined;
|