@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.
@@ -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
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlightcad/mtext-renderer",
3
- "version": "0.12.9",
3
+ "version": "0.12.11",
4
4
  "description": "AutoCAD MText renderer based on Three.js",
5
5
  "license": "MIT",
6
6
  "author": "MLight Lee <mlight.lee@outlook.com>",