harfbuzzjs 0.10.3 → 1.0.0-beta.1

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.
@@ -0,0 +1,610 @@
1
+ //#region src/types.d.ts
2
+ interface FontExtents {
3
+ ascender: number;
4
+ descender: number;
5
+ lineGap: number;
6
+ }
7
+ interface GlyphExtents {
8
+ xBearing: number;
9
+ yBearing: number;
10
+ width: number;
11
+ height: number;
12
+ }
13
+ interface GlyphInfo {
14
+ /** Either a Unicode code point (before shaping) or a glyph index (after shaping). */
15
+ codepoint: number;
16
+ /** The cluster index of the glyph. */
17
+ cluster: number;
18
+ }
19
+ interface GlyphPosition {
20
+ /** The x advance of the glyph. */
21
+ xAdvance: number;
22
+ /** The y advance of the glyph. */
23
+ yAdvance: number;
24
+ /** The x offset of the glyph. */
25
+ xOffset: number;
26
+ /** The y offset of the glyph. */
27
+ yOffset: number;
28
+ }
29
+ interface JsonGlyph {
30
+ /** The glyph ID. */
31
+ g: number;
32
+ /** The cluster ID. */
33
+ cl: number;
34
+ /** Advance width (width to advance after this glyph is painted). */
35
+ ax: number;
36
+ /** Advance height (height to advance after this glyph is painted). */
37
+ ay: number;
38
+ /** X displacement (adjustment in X dimension when painting this glyph). */
39
+ dx: number;
40
+ /** Y displacement (adjustment in Y dimension when painting this glyph). */
41
+ dy: number;
42
+ /** Glyph flags, a combination of {@link GlyphFlag} values. */
43
+ fl: number;
44
+ }
45
+ interface SvgPathCommand {
46
+ type: string;
47
+ values: number[];
48
+ }
49
+ interface AxisInfo {
50
+ min: number;
51
+ default: number;
52
+ max: number;
53
+ }
54
+ interface NameEntry {
55
+ nameId: number;
56
+ language: string;
57
+ }
58
+ interface FeatureNameIds {
59
+ uiLabelNameId: number | null;
60
+ uiTooltipTextNameId: number | null;
61
+ sampleTextNameId: number | null;
62
+ paramUiLabelNameIds: number[];
63
+ }
64
+ interface TraceEntry {
65
+ m: string;
66
+ t: unknown[];
67
+ glyphs: boolean;
68
+ }
69
+ /** EmscriptenModule extended with MODULARIZE runtime methods. */
70
+ interface HarfBuzzModule extends EmscriptenModule {
71
+ wasmExports: Record<string, (...args: any[]) => any>;
72
+ addFunction(func: (...args: any[]) => any, signature: string): number;
73
+ removeFunction(funcPtr: number): void;
74
+ stackSave(): number;
75
+ stackAlloc(size: number): number;
76
+ stackRestore(ptr: number): void;
77
+ }
78
+ declare const GlyphFlag: {
79
+ readonly UNSAFE_TO_BREAK: 1;
80
+ readonly UNSAFE_TO_CONCAT: 2;
81
+ readonly SAFE_TO_INSERT_TATWEEL: 4;
82
+ readonly DEFINED: 7;
83
+ };
84
+ type GlyphFlag = (typeof GlyphFlag)[keyof typeof GlyphFlag];
85
+ //#endregion
86
+ //#region src/blob.d.ts
87
+ /**
88
+ * An object representing a {@link https://harfbuzz.github.io/harfbuzz-hb-blob.html | HarfBuzz blob}.
89
+ * A blob wraps a chunk of binary data, typically the contents of a font file.
90
+ */
91
+ declare class Blob {
92
+ readonly ptr: number;
93
+ /**
94
+ * @param data Binary font data.
95
+ */
96
+ constructor(data: ArrayBuffer);
97
+ }
98
+ //#endregion
99
+ //#region src/face.d.ts
100
+ declare const GlyphClass: {
101
+ readonly UNCLASSIFIED: 0;
102
+ readonly BASE_GLYPH: 1;
103
+ readonly LIGATURE: 2;
104
+ readonly MARK: 3;
105
+ readonly COMPONENT: 4;
106
+ };
107
+ type GlyphClass = (typeof GlyphClass)[keyof typeof GlyphClass];
108
+ /**
109
+ * An object representing a {@link https://harfbuzz.github.io/harfbuzz-hb-face.html | HarfBuzz face}.
110
+ * A face represents a single face in a binary font file and is the
111
+ * foundation for creating Font objects used in text shaping.
112
+ */
113
+ declare class Face {
114
+ readonly ptr: number;
115
+ readonly upem: number;
116
+ /**
117
+ * @param blob A Blob containing font data.
118
+ * @param index The index of the font in the blob. (0 for most files,
119
+ * or a 0-indexed font number if the `blob` came from a font collection file.)
120
+ */
121
+ constructor(blob: Blob, index?: number);
122
+ /**
123
+ * Return the binary contents of an OpenType table.
124
+ * @param table Table name
125
+ * @returns A Uint8Array of the table data, or undefined if the table is not found.
126
+ */
127
+ referenceTable(table: string): Uint8Array | undefined;
128
+ /**
129
+ * Return variation axis infos.
130
+ * @returns A dictionary mapping axis tags to {min, default, max} values.
131
+ */
132
+ getAxisInfos(): Record<string, AxisInfo>;
133
+ /**
134
+ * Return unicodes the face supports.
135
+ * @returns A Uint32Array of supported Unicode code points.
136
+ */
137
+ collectUnicodes(): Uint32Array;
138
+ /**
139
+ * Return all scripts enumerated in the specified face's
140
+ * GSUB table or GPOS table.
141
+ * @param table The table to query, either "GSUB" or "GPOS".
142
+ * @returns An array of 4-character script tag strings.
143
+ */
144
+ getTableScriptTags(table: string): string[];
145
+ /**
146
+ * Return all features enumerated in the specified face's
147
+ * GSUB table or GPOS table.
148
+ * @param table The table to query, either "GSUB" or "GPOS".
149
+ * @returns An array of 4-character feature tag strings.
150
+ */
151
+ getTableFeatureTags(table: string): string[];
152
+ /**
153
+ * Return language tags in the given face's GSUB or GPOS table, underneath
154
+ * the specified script index.
155
+ * @param table The table to query, either "GSUB" or "GPOS".
156
+ * @param scriptIndex The index of the script to query.
157
+ * @returns An array of 4-character language tag strings.
158
+ */
159
+ getScriptLanguageTags(table: string, scriptIndex: number): string[];
160
+ /**
161
+ * Return all features in the specified face's GSUB table or GPOS table,
162
+ * underneath the specified script and language.
163
+ * @param table The table to query, either "GSUB" or "GPOS".
164
+ * @param scriptIndex The index of the script to query.
165
+ * @param languageIndex The index of the language to query.
166
+ * @returns An array of 4-character feature tag strings.
167
+ */
168
+ getLanguageFeatureTags(table: string, scriptIndex: number, languageIndex: number): string[];
169
+ /**
170
+ * Get the GDEF class of the requested glyph.
171
+ * @param glyph The glyph to get the class of.
172
+ * @returns The {@link GlyphClass} of the glyph.
173
+ */
174
+ getGlyphClass(glyph: number): GlyphClass;
175
+ /**
176
+ * Return all names in the specified face's name table.
177
+ * @returns An array of {nameId, language} entries.
178
+ */
179
+ listNames(): NameEntry[];
180
+ /**
181
+ * Get the name of the specified face.
182
+ * @param nameId The ID of the name to get.
183
+ * @param language The language of the name to get.
184
+ * @returns The name string.
185
+ */
186
+ getName(nameId: number, language: string): string;
187
+ /**
188
+ * Get the name IDs of the specified feature.
189
+ * @param table The table to query, either "GSUB" or "GPOS".
190
+ * @param featureIndex The index of the feature to query.
191
+ * @returns An object with name IDs, or null if not found.
192
+ */
193
+ getFeatureNameIds(table: string, featureIndex: number): FeatureNameIds | null;
194
+ }
195
+ //#endregion
196
+ //#region src/font-funcs.d.ts
197
+ /**
198
+ * An object representing {@link https://harfbuzz.github.io/harfbuzz-hb-font.html | HarfBuzz font functions}.
199
+ * Font functions define the methods used by a Font for lower-level queries
200
+ * like glyph advances and extents. HarfBuzz provides built-in default
201
+ * implementations which can be selectively overridden.
202
+ */
203
+ declare class FontFuncs {
204
+ readonly ptr: number;
205
+ constructor();
206
+ /**
207
+ * Set the font's glyph extents function.
208
+ * @param func The callback receives a Font and glyph ID. It should return
209
+ * an object with xBearing, yBearing, width, and height, or null on failure.
210
+ */
211
+ setGlyphExtentsFunc(func: (font: Font, glyph: number) => GlyphExtents | null): void;
212
+ /**
213
+ * Set the font's glyph from name function.
214
+ * @param func The callback receives a Font and glyph name. It should return
215
+ * the glyph ID, or null on failure.
216
+ */
217
+ setGlyphFromNameFunc(func: (font: Font, name: string) => number | null): void;
218
+ /**
219
+ * Set the font's glyph horizontal advance function.
220
+ * @param func The callback receives a Font and glyph ID. It should return
221
+ * the horizontal advance of the glyph.
222
+ */
223
+ setGlyphHAdvanceFunc(func: (font: Font, glyph: number) => number): void;
224
+ /**
225
+ * Set the font's glyph vertical advance function.
226
+ * @param func The callback receives a Font and glyph ID. It should return
227
+ * the vertical advance of the glyph.
228
+ */
229
+ setGlyphVAdvanceFunc(func: (font: Font, glyph: number) => number): void;
230
+ /**
231
+ * Set the font's glyph horizontal origin function.
232
+ * @param func The callback receives a Font and glyph ID. It should return
233
+ * the [x, y] horizontal origin of the glyph, or null on failure.
234
+ */
235
+ setGlyphHOriginFunc(func: (font: Font, glyph: number) => [number, number] | null): void;
236
+ /**
237
+ * Set the font's glyph vertical origin function.
238
+ * @param func The callback receives a Font and glyph ID. It should return
239
+ * the [x, y] vertical origin of the glyph, or null on failure.
240
+ */
241
+ setGlyphVOriginFunc(func: (font: Font, glyph: number) => [number, number] | null): void;
242
+ /**
243
+ * Set the font's glyph horizontal kerning function.
244
+ * @param func The callback receives a Font, first glyph ID, and second glyph ID.
245
+ * It should return the horizontal kerning of the glyphs.
246
+ */
247
+ setGlyphHKerningFunc(func: (font: Font, firstGlyph: number, secondGlyph: number) => number): void;
248
+ /**
249
+ * Set the font's glyph name function.
250
+ * @param func The callback receives a Font and glyph ID. It should return
251
+ * the name of the glyph, or null on failure.
252
+ */
253
+ setGlyphNameFunc(func: (font: Font, glyph: number) => string | null): void;
254
+ /**
255
+ * Set the font's nominal glyph function.
256
+ * @param func The callback receives a Font and unicode code point. It should
257
+ * return the nominal glyph of the unicode, or null on failure.
258
+ */
259
+ setNominalGlyphFunc(func: (font: Font, unicode: number) => number | null): void;
260
+ /**
261
+ * Set the font's variation glyph function.
262
+ * @param func The callback receives a Font, unicode code point, and variation
263
+ * selector. It should return the variation glyph, or null on failure.
264
+ */
265
+ setVariationGlyphFunc(func: (font: Font, unicode: number, variationSelector: number) => number | null): void;
266
+ /**
267
+ * Set the font's horizontal extents function.
268
+ * @param func The callback receives a Font. It should return an object with
269
+ * ascender, descender, and lineGap, or null on failure.
270
+ */
271
+ setFontHExtentsFunc(func: (font: Font) => FontExtents | null): void;
272
+ /**
273
+ * Set the font's vertical extents function.
274
+ * @param func The callback receives a Font. It should return an object with
275
+ * ascender, descender, and lineGap, or null on failure.
276
+ */
277
+ setFontVExtentsFunc(func: (font: Font) => FontExtents | null): void;
278
+ }
279
+ //#endregion
280
+ //#region src/font.d.ts
281
+ /**
282
+ * An object representing a {@link https://harfbuzz.github.io/harfbuzz-hb-font.html | HarfBuzz font}.
283
+ * A font represents a face at a specific size and with certain other
284
+ * parameters (pixels-per-em, variation settings) specified. Fonts are the
285
+ * primary input to the shaping process.
286
+ */
287
+ declare class Font {
288
+ readonly ptr: number;
289
+ private drawPtrs;
290
+ /**
291
+ * @param face A Face to create the font from.
292
+ */
293
+ constructor(face: Face);
294
+ /** @internal Wrap an existing font pointer. */
295
+ constructor(existingPtr: number);
296
+ /**
297
+ * Create a sub font that inherits this font's properties.
298
+ * @returns A new Font object representing the sub font.
299
+ */
300
+ subFont(): Font;
301
+ /**
302
+ * Return font horizontal extents.
303
+ * @returns Object with ascender, descender, and lineGap properties.
304
+ */
305
+ hExtents(): FontExtents;
306
+ /**
307
+ * Return font vertical extents.
308
+ * @returns Object with ascender, descender, and lineGap properties.
309
+ */
310
+ vExtents(): FontExtents;
311
+ /**
312
+ * Return glyph name.
313
+ * @param glyphId ID of the requested glyph in the font.
314
+ * @returns The glyph name string.
315
+ */
316
+ glyphName(glyphId: number): string;
317
+ /**
318
+ * Return a glyph as an SVG path string.
319
+ * @param glyphId ID of the requested glyph in the font.
320
+ * @returns SVG path data string.
321
+ */
322
+ glyphToPath(glyphId: number): string;
323
+ /**
324
+ * Return glyph horizontal advance.
325
+ * @param glyphId ID of the requested glyph in the font.
326
+ * @returns The horizontal advance width.
327
+ */
328
+ glyphHAdvance(glyphId: number): number;
329
+ /**
330
+ * Return glyph vertical advance.
331
+ * @param glyphId ID of the requested glyph in the font.
332
+ * @returns The vertical advance height.
333
+ */
334
+ glyphVAdvance(glyphId: number): number;
335
+ /**
336
+ * Return glyph horizontal origin.
337
+ * @param glyphId ID of the requested glyph in the font.
338
+ * @returns [x, y] origin coordinates, or null if not available.
339
+ */
340
+ glyphHOrigin(glyphId: number): [number, number] | null;
341
+ /**
342
+ * Return glyph vertical origin.
343
+ * @param glyphId ID of the requested glyph in the font.
344
+ * @returns [x, y] origin coordinates, or null if not available.
345
+ */
346
+ glyphVOrigin(glyphId: number): [number, number] | null;
347
+ /**
348
+ * Return glyph extents.
349
+ * @param glyphId ID of the requested glyph in the font.
350
+ * @returns An object with xBearing, yBearing, width, and height, or null.
351
+ */
352
+ glyphExtents(glyphId: number): GlyphExtents | null;
353
+ /**
354
+ * Return glyph ID from name.
355
+ * @param name Name of the requested glyph in the font.
356
+ * @returns The glyph ID, or null if not found.
357
+ */
358
+ glyphFromName(name: string): number | null;
359
+ /**
360
+ * Return a glyph as a JSON path string
361
+ * based on format described on https://svgwg.org/specs/paths/#InterfaceSVGPathSegment
362
+ * @param glyphId ID of the requested glyph in the font.
363
+ * @returns An array of path segment objects with type and values.
364
+ */
365
+ glyphToJson(glyphId: number): SvgPathCommand[];
366
+ /**
367
+ * Set the font's scale factor, affecting the position values returned from
368
+ * shaping.
369
+ * @param xScale Units to scale in the X dimension.
370
+ * @param yScale Units to scale in the Y dimension.
371
+ */
372
+ setScale(xScale: number, yScale: number): void;
373
+ /**
374
+ * Set the font's variations.
375
+ * @param variations Dictionary of variations to set.
376
+ */
377
+ setVariations(variations: Record<string, number>): void;
378
+ /** Set the font's font functions. */
379
+ setFuncs(fontFuncs: FontFuncs): void;
380
+ }
381
+ //#endregion
382
+ //#region src/buffer.d.ts
383
+ declare const BufferContentType: {
384
+ readonly INVALID: 0;
385
+ readonly UNICODE: 1;
386
+ readonly GLYPHS: 2;
387
+ };
388
+ type BufferContentType = (typeof BufferContentType)[keyof typeof BufferContentType];
389
+ declare const BufferSerializeFlag: {
390
+ readonly DEFAULT: 0;
391
+ readonly NO_CLUSTERS: 1;
392
+ readonly NO_POSITIONS: 2;
393
+ readonly NO_GLYPH_NAMES: 4;
394
+ readonly GLYPH_EXTENTS: 8;
395
+ readonly GLYPH_FLAGS: 16;
396
+ readonly NO_ADVANCES: 32;
397
+ readonly DEFINED: 63;
398
+ };
399
+ type BufferSerializeFlag = (typeof BufferSerializeFlag)[keyof typeof BufferSerializeFlag];
400
+ declare const BufferFlag: {
401
+ readonly DEFAULT: 0;
402
+ readonly BOT: 1;
403
+ readonly EOT: 2;
404
+ readonly PRESERVE_DEFAULT_IGNORABLES: 4;
405
+ readonly REMOVE_DEFAULT_IGNORABLES: 8;
406
+ readonly DO_NOT_INSERT_DOTTED_CIRCLE: 16;
407
+ readonly VERIFY: 32;
408
+ readonly PRODUCE_UNSAFE_TO_CONCAT: 64;
409
+ readonly PRODUCE_SAFE_TO_INSERT_TATWEEL: 128;
410
+ readonly DEFINED: 255;
411
+ };
412
+ type BufferFlag = (typeof BufferFlag)[keyof typeof BufferFlag];
413
+ declare const Direction: {
414
+ readonly INVALID: 0;
415
+ readonly LTR: 4;
416
+ readonly RTL: 5;
417
+ readonly TTB: 6;
418
+ readonly BTT: 7;
419
+ };
420
+ type Direction = (typeof Direction)[keyof typeof Direction];
421
+ declare const BufferSerializeFormat: {
422
+ readonly INVALID: 0;
423
+ readonly TEXT: number;
424
+ readonly JSON: number;
425
+ };
426
+ type BufferSerializeFormat = (typeof BufferSerializeFormat)[keyof typeof BufferSerializeFormat];
427
+ /**
428
+ * An object representing a {@link https://harfbuzz.github.io/harfbuzz-hb-buffer.html | HarfBuzz buffer}.
429
+ * A buffer holds the input text and its properties before shaping, and the
430
+ * output glyphs and their information after shaping.
431
+ */
432
+ declare class Buffer {
433
+ readonly ptr: number;
434
+ constructor();
435
+ /** @internal Wrap an existing buffer pointer. */
436
+ constructor(existingPtr: number);
437
+ /**
438
+ * Add text to the buffer.
439
+ * @param text Text to be added to the buffer.
440
+ * @param itemOffset The offset of the first character to add to the buffer.
441
+ * @param itemLength The number of characters to add to the buffer, or null for the end of text.
442
+ */
443
+ addText(text: string, itemOffset?: number, itemLength?: number | null): void;
444
+ /**
445
+ * Add code points to the buffer.
446
+ * @param codePoints Array of code points to be added to the buffer.
447
+ * @param itemOffset The offset of the first code point to add to the buffer.
448
+ * @param itemLength The number of code points to add to the buffer, or null for the end of the array.
449
+ */
450
+ addCodePoints(codePoints: number[], itemOffset?: number, itemLength?: number | null): void;
451
+ /**
452
+ * Set buffer script, language and direction.
453
+ *
454
+ * This needs to be done before shaping.
455
+ */
456
+ guessSegmentProperties(): void;
457
+ /**
458
+ * Set buffer direction explicitly.
459
+ * @param dir A {@link Direction} value.
460
+ */
461
+ setDirection(dir: Direction): void;
462
+ /**
463
+ * Set buffer flags explicitly.
464
+ * @param flags A combination of {@link BufferFlag} values (OR them together).
465
+ */
466
+ setFlags(flags: number): void;
467
+ /**
468
+ * Set buffer language explicitly.
469
+ * @param language The buffer language
470
+ */
471
+ setLanguage(language: string): void;
472
+ /**
473
+ * Set buffer script explicitly.
474
+ * @param script The buffer script
475
+ */
476
+ setScript(script: string): void;
477
+ /**
478
+ * Set the HarfBuzz clustering level.
479
+ *
480
+ * Affects the cluster values returned from shaping.
481
+ * @param level Clustering level. See the HarfBuzz manual chapter on Clusters.
482
+ */
483
+ setClusterLevel(level: number): void;
484
+ /** Reset the buffer to its initial status. */
485
+ reset(): void;
486
+ /**
487
+ * Similar to reset(), but does not clear the Unicode functions and the
488
+ * replacement code point.
489
+ */
490
+ clearContents(): void;
491
+ /**
492
+ * Set message func.
493
+ * @param func The function to set. It receives the buffer, font, and message
494
+ * string as arguments. Returning false will skip this shaping step and move
495
+ * to the next one.
496
+ */
497
+ setMessageFunc(func: (buffer: Buffer, font: Font, message: string) => boolean): void;
498
+ /**
499
+ * Get the the number of items in the buffer.
500
+ * @returns The buffer length.
501
+ */
502
+ getLength(): number;
503
+ /**
504
+ * Get the glyph information from the buffer.
505
+ * @returns An array of {@link GlyphInfo} objects.
506
+ */
507
+ getGlyphInfos(): GlyphInfo[];
508
+ /**
509
+ * Get the glyph positions from the buffer.
510
+ * @returns An array of {@link GlyphPosition} objects.
511
+ */
512
+ getGlyphPositions(): GlyphPosition[];
513
+ /**
514
+ * Get the glyph information and positions from the buffer.
515
+ * @returns The glyph information and positions.
516
+ *
517
+ * The glyph information is returned as an array of objects with the
518
+ * properties from getGlyphInfos and getGlyphPositions combined.
519
+ */
520
+ getGlyphInfosAndPositions(): (GlyphInfo & Partial<GlyphPosition>)[];
521
+ /**
522
+ * Update the glyph positions in the buffer.
523
+ * WARNING: Do not use unless you know what you are doing.
524
+ */
525
+ updateGlyphPositions(positions: GlyphPosition[]): void;
526
+ /**
527
+ * Serialize the buffer contents to a string.
528
+ * @param font The font to use for serialization.
529
+ * @param start The starting index of the glyphs to serialize.
530
+ * @param end The ending index of the glyphs to serialize.
531
+ * @param format The {@link BufferSerializeFormat} to serialize the buffer contents to.
532
+ * @param flags A combination of {@link BufferSerializeFlag} values (OR them together).
533
+ *
534
+ * @returns The serialized buffer contents.
535
+ */
536
+ serialize(font?: Font | null, start?: number, end?: number | null, format?: BufferSerializeFormat, flags?: number): string;
537
+ /**
538
+ * Return the buffer content type.
539
+ *
540
+ * @returns The buffer content type as a {@link BufferContentType} value.
541
+ */
542
+ getContentType(): BufferContentType;
543
+ /**
544
+ * Return the buffer contents as a JSON object.
545
+ * @returns An array of {@link JsonGlyph} objects.
546
+ */
547
+ json(): JsonGlyph[];
548
+ }
549
+ //#endregion
550
+ //#region src/shape.d.ts
551
+ declare const TracePhase: {
552
+ readonly DONT_STOP: 0;
553
+ readonly GSUB: 1;
554
+ readonly GPOS: 2;
555
+ };
556
+ type TracePhase = (typeof TracePhase)[keyof typeof TracePhase];
557
+ /**
558
+ * Shape a buffer with a given font.
559
+ *
560
+ * Converts the Unicode text in the buffer into positioned glyphs.
561
+ * The buffer is modified in place.
562
+ *
563
+ * @param font The Font to shape with.
564
+ * @param buffer The Buffer containing text to shape, suitably prepared
565
+ * (text added, segment properties set).
566
+ * @param features A string of comma-separated OpenType features to apply.
567
+ */
568
+ declare function shape(font: Font, buffer: Buffer, features?: string): void;
569
+ /**
570
+ * Shape a buffer with a given font, returning a JSON trace of the shaping process.
571
+ *
572
+ * This function supports "partial shaping", where the shaping process is
573
+ * terminated after a given lookup ID is reached.
574
+ *
575
+ * @param font The Font to shape with.
576
+ * @param buffer The Buffer containing text to shape, suitably prepared.
577
+ * @param features A string of comma-separated OpenType features to apply.
578
+ * @param stop_at A lookup ID at which to terminate shaping.
579
+ * @param stop_phase The {@link TracePhase} at which to stop shaping.
580
+ * @returns An array of trace entries, each with a message, serialized glyphs, and phase info.
581
+ */
582
+ declare function shapeWithTrace(font: Font, buffer: Buffer, features: string, stop_at: number, stop_phase: TracePhase): TraceEntry[];
583
+ /**
584
+ * Return the HarfBuzz version.
585
+ * @returns An object with major, minor, and micro version numbers.
586
+ */
587
+ declare function version(): {
588
+ major: number;
589
+ minor: number;
590
+ micro: number;
591
+ };
592
+ /**
593
+ * Return the HarfBuzz version as a string.
594
+ * @returns A version string in the form "major.minor.micro".
595
+ */
596
+ declare function versionString(): string;
597
+ /**
598
+ * Convert an OpenType script tag to HarfBuzz script.
599
+ * @param tag The tag to convert.
600
+ * @returns The script.
601
+ */
602
+ declare function otTagToScript(tag: string): string;
603
+ /**
604
+ * Convert an OpenType language tag to HarfBuzz language.
605
+ * @param tag The tag to convert.
606
+ * @returns The language.
607
+ */
608
+ declare function otTagToLanguage(tag: string): string;
609
+ //#endregion
610
+ export { AxisInfo, Blob, Buffer, BufferContentType, BufferFlag, BufferSerializeFlag, BufferSerializeFormat, Direction, Face, FeatureNameIds, Font, FontExtents, FontFuncs, GlyphClass, GlyphExtents, GlyphFlag, GlyphInfo, GlyphPosition, HarfBuzzModule, JsonGlyph, NameEntry, SvgPathCommand, TraceEntry, TracePhase, otTagToLanguage, otTagToScript, shape, shapeWithTrace, version, versionString };