@mlightcad/mtext-renderer 0.12.9 → 0.12.11
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.js +754 -645
- package/dist/index.umd.cjs +9 -9
- package/dist/mtext-renderer-worker.js +522 -422
- package/lib/font/defaultFontLoader.d.ts +12 -0
- package/lib/font/fontManager.d.ts +22 -0
- package/lib/worker/unifiedRenderer.d.ts +2 -0
- package/package.json +1 -1
|
@@ -15,6 +15,12 @@ export declare class DefaultFontLoader implements FontLoader {
|
|
|
15
15
|
* each hit `fonts.json` independently.
|
|
16
16
|
*/
|
|
17
17
|
private _availableFontsPromise;
|
|
18
|
+
/**
|
|
19
|
+
* At most one forced `fonts.json` revalidation per baseUrl. Used when a
|
|
20
|
+
* requested face is missing from a possibly stale HTTP-cached catalog
|
|
21
|
+
* (e.g. jsDelivr `@main` with a long max-age).
|
|
22
|
+
*/
|
|
23
|
+
private _catalogRefreshAttempted;
|
|
18
24
|
/**
|
|
19
25
|
* Creates a new instance of DefaultFontLoader
|
|
20
26
|
*/
|
|
@@ -51,6 +57,12 @@ export declare class DefaultFontLoader implements FontLoader {
|
|
|
51
57
|
* @returns Promise that resolves to an array of FontLoadStatus objects
|
|
52
58
|
*/
|
|
53
59
|
load(fontNames: readonly string[]): Promise<FontLoadStatus[]>;
|
|
60
|
+
private clearAvailableFontsCache;
|
|
61
|
+
/**
|
|
62
|
+
* Drops the in-memory catalog and refetches `fonts.json`, bypassing the HTTP
|
|
63
|
+
* cache so CDN updates are visible after a miss.
|
|
64
|
+
*/
|
|
65
|
+
private refreshAvailableFontsFromNetwork;
|
|
54
66
|
/**
|
|
55
67
|
* Fetches and caches remote font metadata for the given base URL.
|
|
56
68
|
*/
|
|
@@ -352,6 +352,28 @@ export declare class FontManager {
|
|
|
352
352
|
* @param scheduleLoad - When true (default), also {@link requestFont} on first miss if lazy loading is on
|
|
353
353
|
*/
|
|
354
354
|
private recordMissedFonts;
|
|
355
|
+
/**
|
|
356
|
+
* Adds catalog / `fonts.json` names onto a font instance.
|
|
357
|
+
*/
|
|
358
|
+
private applyCatalogNames;
|
|
359
|
+
/**
|
|
360
|
+
* Ensures an already-loaded primary face is also addressable under the
|
|
361
|
+
* current catalog names. Needed when IndexedDB still has an older alias
|
|
362
|
+
* list (e.g. `noto-sans-kr` cached before `malgun` was added) or when the
|
|
363
|
+
* binary was loaded under the file basename first.
|
|
364
|
+
*/
|
|
365
|
+
private ensureCatalogAliases;
|
|
366
|
+
/**
|
|
367
|
+
* Merges catalog / primary names into an existing IndexedDB alias list so
|
|
368
|
+
* cold starts after `getAllFontsFromCache` pick up newly added style names.
|
|
369
|
+
*/
|
|
370
|
+
private persistCatalogAliases;
|
|
371
|
+
/**
|
|
372
|
+
* Clears miss / failed-request bookkeeping for a primary name and aliases
|
|
373
|
+
* so a later alias request is not permanently blocked after the binary
|
|
374
|
+
* loaded under a different key.
|
|
375
|
+
*/
|
|
376
|
+
private clearRequestStateForNames;
|
|
355
377
|
/**
|
|
356
378
|
* Loads a single font
|
|
357
379
|
* @param fontInfo - The matadata of the font to be loaded
|
|
@@ -19,6 +19,8 @@ export declare class UnifiedRenderer {
|
|
|
19
19
|
private workerLazyFontLoading;
|
|
20
20
|
/** Last awaitFontsBeforeDraw value pushed to the worker pool, if any. */
|
|
21
21
|
private workerAwaitFontsBeforeDraw;
|
|
22
|
+
/** Last font base URL pushed to the worker pool, if any. */
|
|
23
|
+
private workerFontUrl;
|
|
22
24
|
/**
|
|
23
25
|
* Constructor
|
|
24
26
|
*
|