three-text 0.2.5 → 0.2.7

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/dist/index.d.ts CHANGED
@@ -62,10 +62,17 @@ interface LoadedFont {
62
62
  fontVariations?: {
63
63
  [key: string]: number;
64
64
  };
65
+ fontFeatures?: {
66
+ [tag: string]: boolean | number;
67
+ };
65
68
  isVariable?: boolean;
66
69
  variationAxes?: {
67
70
  [key: string]: VariationAxis;
68
71
  };
72
+ availableFeatures?: string[];
73
+ featureNames?: {
74
+ [tag: string]: string;
75
+ };
69
76
  _buffer?: ArrayBuffer;
70
77
  }
71
78
  interface HarfBuzzModule {
@@ -84,7 +91,7 @@ interface HarfBuzzAPI {
84
91
  createFace: (blob: HarfBuzzBlob, index: number) => HarfBuzzFace;
85
92
  createFont: (face: HarfBuzzFace) => HarfBuzzFont;
86
93
  createBuffer: () => HarfBuzzBuffer;
87
- shape: (font: HarfBuzzFont, buffer: HarfBuzzBuffer) => void;
94
+ shape: (font: HarfBuzzFont, buffer: HarfBuzzBuffer, features?: string) => void;
88
95
  }
89
96
  interface HarfBuzzBlob {
90
97
  destroy: () => void;
@@ -263,6 +270,9 @@ interface TextOptions {
263
270
  fontVariations?: {
264
271
  [key: string]: number;
265
272
  };
273
+ fontFeatures?: {
274
+ [tag: string]: boolean | number;
275
+ };
266
276
  maxTextLength?: number;
267
277
  removeOverlaps?: boolean;
268
278
  curveFidelity?: CurveFidelityConfig;
@@ -436,6 +446,13 @@ declare const DEFAULT_CURVE_FIDELITY: CurveFidelityConfig;
436
446
 
437
447
  declare class FontMetadataExtractor {
438
448
  static extractMetadata(fontBuffer: ArrayBuffer): ExtractedMetrics;
449
+ static extractFeatureTags(fontBuffer: ArrayBuffer): {
450
+ tags: string[];
451
+ names: {
452
+ [tag: string]: string;
453
+ };
454
+ } | undefined;
455
+ private static extractFeatureDataFromTable;
439
456
  private static extractAxisNames;
440
457
  private static getNameFromNameTable;
441
458
  static getVerticalMetrics(metrics: ExtractedMetrics): VerticalMetrics;