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/README.md +67 -27
- package/dist/index.cjs +431 -70
- package/dist/index.d.ts +18 -1
- package/dist/index.js +431 -70
- package/dist/index.min.cjs +2 -2
- package/dist/index.min.js +2 -2
- package/dist/index.umd.js +431 -70
- package/dist/index.umd.min.js +2 -2
- package/dist/p5/index.cjs +4 -8
- package/dist/p5/index.js +4 -8
- package/dist/three/react.d.ts +11 -1
- package/dist/types/core/cache/GlyphGeometryBuilder.d.ts +1 -0
- package/dist/types/core/font/FontMetadata.d.ts +7 -0
- package/dist/types/core/font/constants.d.ts +10 -0
- package/dist/types/core/shaping/fontFeatures.d.ts +3 -0
- package/dist/types/core/types.d.ts +11 -1
- package/dist/types/utils/LRUCache.d.ts +38 -0
- package/dist/types/utils/{DebugLogger.d.ts → Logger.d.ts} +2 -2
- package/dist/types/utils/PerformanceLogger.d.ts +1 -0
- package/package.json +2 -1
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;
|