meshwriter-cudu 3.0.0 → 3.0.3

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.
@@ -1,99 +0,0 @@
1
- /**
2
- * Load and parse a variable font from URL
3
- * @param {string} url - URL to TTF or WOFF2 file
4
- * @param {object} [options] - Loading options
5
- * @param {number} [options.cacheSize=5000] - Maximum glyph cache size
6
- * @param {number} [options.maxVariations=10] - Maximum cached weight variations
7
- * @returns {Promise<VariableFontHandle>}
8
- */
9
- export function loadVariableFont(url: string, options?: {
10
- cacheSize?: number;
11
- maxVariations?: number;
12
- }): Promise<VariableFontHandle>;
13
- export const DEFAULT_CHARSET: string;
14
- /**
15
- * Handle for a loaded variable font
16
- * Provides methods to generate FontSpec at different weights
17
- */
18
- export class VariableFontHandle {
19
- /**
20
- * @param {object} font - fontkit font object
21
- * @param {object} fontkit - fontkit module reference
22
- * @param {string} url - Source URL
23
- * @param {object} axisInfo - Axis information
24
- * @param {boolean} isVariable - Whether font is actually variable
25
- * @param {number} cacheSize - Maximum glyph cache size
26
- * @param {number} maxVariations - Maximum cached weight variations
27
- */
28
- constructor(font: object, fontkit: object, url: string, axisInfo: object, isVariable: boolean, cacheSize: number, maxVariations: number);
29
- _baseFont: any;
30
- _fontkit: any;
31
- _url: string;
32
- _axisInfo: any;
33
- _isVariable: boolean;
34
- _glyphCache: GlyphCache;
35
- _kerningCache: Map<any, any>;
36
- _fontCache: Map<any, any>;
37
- _maxVariations: number;
38
- _reverseShapes: boolean;
39
- _reverseHoles: boolean;
40
- /**
41
- * Get axis information for this font
42
- * @returns {object} - Axis info with weight min/max/default
43
- */
44
- getAxisInfo(): object;
45
- /**
46
- * Get the source URL
47
- * @returns {string}
48
- */
49
- getUrl(): string;
50
- /**
51
- * Check if this is actually a variable font
52
- * @returns {boolean}
53
- */
54
- isVariable(): boolean;
55
- /**
56
- * Get or create a font instance at the specified weight
57
- * @param {number} weight - Weight value
58
- * @returns {object} - fontkit font instance
59
- */
60
- _getFontAtWeight(weight: number): object;
61
- /**
62
- * Generate FontSpec for a specific weight
63
- * @param {number} weight - Weight value (100-900 for most fonts)
64
- * @param {string} [charset] - Characters to include (default: Latin + symbols)
65
- * @returns {object} - FontSpec compatible with MeshWriter
66
- */
67
- generateFontSpec(weight: number, charset?: string): object;
68
- /**
69
- * Get or create a cached glyph specification
70
- * @param {object} font - fontkit font instance at specific weight
71
- * @param {string} char - Character
72
- * @param {number} weight - Weight value
73
- * @returns {object|null} - GlyphSpec or null if glyph not found
74
- */
75
- _getOrCreateGlyph(font: object, char: string, weight: number): object | null;
76
- /**
77
- * Clear all cached glyphs and font instances
78
- * Call this when changing weight frequently to free memory
79
- */
80
- clearCache(): void;
81
- /**
82
- * Get current cache statistics
83
- * @returns {{ glyphCount: number, kerningCount: number, fontCount: number, maxSize: number, maxVariations: number }}
84
- */
85
- getCacheStats(): {
86
- glyphCount: number;
87
- kerningCount: number;
88
- fontCount: number;
89
- maxSize: number;
90
- maxVariations: number;
91
- };
92
- /**
93
- * Ensure a cache map respects the max variations limit (simple LRU)
94
- * @param {Map} map
95
- * @private
96
- */
97
- private _evictIfNeeded;
98
- }
99
- import { GlyphCache } from './variableFontCache.js';