three-text 0.3.0 → 0.3.2
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 +5 -34
- package/dist/index.cjs +336 -112
- package/dist/index.d.ts +17 -1
- package/dist/index.js +336 -112
- package/dist/index.min.cjs +638 -592
- package/dist/index.min.js +623 -577
- package/dist/index.umd.js +336 -112
- package/dist/index.umd.min.js +619 -573
- package/dist/three/react.d.ts +0 -1
- package/dist/types/core/font/FontMetadata.d.ts +17 -0
- package/dist/types/core/types.d.ts +0 -1
- package/package.json +1 -1
- package/dist/types/utils/LRUCache.d.ts +0 -38
package/dist/three/react.d.ts
CHANGED
|
@@ -255,7 +255,6 @@ interface TextOptions {
|
|
|
255
255
|
geometryOptimization?: GeometryOptimizationOptions;
|
|
256
256
|
layout?: LayoutOptions;
|
|
257
257
|
color?: [number, number, number] | ColorOptions;
|
|
258
|
-
maxCacheSizeMB?: number;
|
|
259
258
|
}
|
|
260
259
|
interface HyphenationPatternsMap {
|
|
261
260
|
[language: string]: HyphenationTrieNode;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { ExtractedMetrics, FontMetrics, VerticalMetrics } from '../types';
|
|
2
|
+
export interface FontDataExtraction {
|
|
3
|
+
metrics: ExtractedMetrics;
|
|
4
|
+
features: {
|
|
5
|
+
tags: string[];
|
|
6
|
+
names: {
|
|
7
|
+
[tag: string]: string;
|
|
8
|
+
};
|
|
9
|
+
} | undefined;
|
|
10
|
+
}
|
|
2
11
|
export declare class FontMetadataExtractor {
|
|
3
12
|
static extractMetadata(fontBuffer: ArrayBuffer): ExtractedMetrics;
|
|
4
13
|
static extractFeatureTags(fontBuffer: ArrayBuffer): {
|
|
@@ -10,6 +19,14 @@ export declare class FontMetadataExtractor {
|
|
|
10
19
|
private static extractFeatureDataFromTable;
|
|
11
20
|
private static extractAxisNames;
|
|
12
21
|
private static getNameFromNameTable;
|
|
22
|
+
static extractAll(fontBuffer: ArrayBuffer): FontDataExtraction;
|
|
23
|
+
private static buildNameIndex;
|
|
24
|
+
private static getNameFromIndex;
|
|
25
|
+
private static extractMetricsWithIndex;
|
|
26
|
+
private static extractAxisNamesWithIndex;
|
|
27
|
+
private static extractFeaturesWithIndex;
|
|
28
|
+
private static extractFeatureData;
|
|
29
|
+
private static tagToString;
|
|
13
30
|
static getVerticalMetrics(metrics: ExtractedMetrics): VerticalMetrics;
|
|
14
31
|
static getFontMetrics(metrics: ExtractedMetrics): FontMetrics;
|
|
15
32
|
}
|
|
@@ -318,7 +318,6 @@ export interface TextOptions {
|
|
|
318
318
|
geometryOptimization?: GeometryOptimizationOptions;
|
|
319
319
|
layout?: LayoutOptions;
|
|
320
320
|
color?: [number, number, number] | ColorOptions;
|
|
321
|
-
maxCacheSizeMB?: number;
|
|
322
321
|
}
|
|
323
322
|
export interface HyphenationPatternsMap {
|
|
324
323
|
[language: string]: HyphenationTrieNode;
|
package/package.json
CHANGED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export interface LRUCacheOptions<K, V> {
|
|
2
|
-
maxEntries?: number;
|
|
3
|
-
maxMemoryBytes?: number;
|
|
4
|
-
calculateSize?: (value: V) => number;
|
|
5
|
-
onEvict?: (key: K, value: V) => void;
|
|
6
|
-
}
|
|
7
|
-
export interface CacheStats {
|
|
8
|
-
hits: number;
|
|
9
|
-
misses: number;
|
|
10
|
-
evictions: number;
|
|
11
|
-
size: number;
|
|
12
|
-
memoryUsage: number;
|
|
13
|
-
}
|
|
14
|
-
export declare class LRUCache<K, V> {
|
|
15
|
-
private cache;
|
|
16
|
-
private head;
|
|
17
|
-
private tail;
|
|
18
|
-
private stats;
|
|
19
|
-
private options;
|
|
20
|
-
constructor(options?: LRUCacheOptions<K, V>);
|
|
21
|
-
get(key: K): V | undefined;
|
|
22
|
-
has(key: K): boolean;
|
|
23
|
-
set(key: K, value: V): void;
|
|
24
|
-
delete(key: K): boolean;
|
|
25
|
-
clear(): void;
|
|
26
|
-
getStats(): CacheStats & {
|
|
27
|
-
hitRate: number;
|
|
28
|
-
memoryUsageMB: number;
|
|
29
|
-
};
|
|
30
|
-
keys(): K[];
|
|
31
|
-
get size(): number;
|
|
32
|
-
private evictIfNeeded;
|
|
33
|
-
private evictTail;
|
|
34
|
-
private addToHead;
|
|
35
|
-
private removeNode;
|
|
36
|
-
private removeTail;
|
|
37
|
-
private moveToHead;
|
|
38
|
-
}
|