route-graphics 1.28.1 → 1.30.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "route-graphics",
3
- "version": "1.28.1",
3
+ "version": "1.30.0",
4
4
  "description": "A 2D graphics rendering interface that takes JSON input and renders pixels using PixiJS",
5
5
  "main": "dist/RouteGraphics.js",
6
6
  "type": "module",
@@ -273,15 +273,21 @@ const collectAssetReferences = ({ states, assetAliases }) => {
273
273
  }
274
274
  }
275
275
 
276
- if (
277
- FONT_ASSET_KEYS.has(key) &&
278
- typeof value === "string" &&
279
- assetAliases.has(value)
280
- ) {
281
- registerReference({
282
- alias: value,
283
- fallbackType: "font/ttf",
284
- nodePath: nextPath,
276
+ if (FONT_ASSET_KEYS.has(key)) {
277
+ const fontFamilies = Array.isArray(value) ? value : [value];
278
+
279
+ fontFamilies.forEach((fontFamily, index) => {
280
+ if (typeof fontFamily !== "string" || !assetAliases.has(fontFamily)) {
281
+ return;
282
+ }
283
+
284
+ registerReference({
285
+ alias: fontFamily,
286
+ fallbackType: "font/ttf",
287
+ nodePath: Array.isArray(value)
288
+ ? getNextNodePath(nextPath, index)
289
+ : nextPath,
290
+ });
285
291
  });
286
292
  }
287
293