Skip to content

Commit

Permalink
Support font assets (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin authored Aug 16, 2023
1 parent e3e9aca commit c83d01d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/packager/packager.js
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,12 @@ cd "$(dirname "$0")"
return file.async('arraybuffer');
});` : `
storage.addWebStore(
[storage.AssetType.ImageVector, storage.AssetType.ImageBitmap, storage.AssetType.Sound],
[
storage.AssetType.ImageVector,
storage.AssetType.ImageBitmap,
storage.AssetType.Sound,
storage.AssetType.Font
].filter(i => i),
(asset) => new URL('./assets/' + asset.assetId + '.' + asset.dataFormat, location).href
);
return ${getProjectDataFunction};`}
Expand Down
3 changes: 2 additions & 1 deletion src/scaffolding/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class StorageWithProgress extends ScratchStorage {
const isAsset = (
assetType === this.AssetType.ImageBitmap ||
assetType === this.AssetType.ImageVector ||
assetType === this.AssetType.Sound
assetType === this.AssetType.Sound ||
assetType === this.AssetType.Font
);
if (isAsset) {
this._totalAssets++;
Expand Down

0 comments on commit c83d01d

Please sign in to comment.