-
-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Description
With Cache Buster, Compression and Mipmaps turned on, Bitmap font cannot be correctly phrased in the manifest. This causes error when loading the bundle.
Steps to Reproduce
- Taking Pixi's Bitmap Text example with Desyel font, put them into a
game-screenbundle folder.
- Some basic pipes settings as:
pipes: [
...pixiPipes({
resolutions: { high: 3, default: 2, low: 1 },
manifest: {
trimExtensions: true
},
}),
],
- Run asset pack
- Load the generated manifest and bundle, Pixi should pickup and load the Bitmap font from the XML
await PIXI.Assets.init({
basePath: 'public/assets',
manifest,
texturePreference: { resolution: [window.devicePixelRatio, 1], format: ['webp', 'png'] },
});
await PIXI.Assets.loadBundle('game-screen');
Current Behaviour
desyel.png got phrased correctly, exported as all resolutions and formats with hashes, but desyel.xml was not phrased and simply got renamed and copied to the output folder.

In desyel-xxxxx.png.xml, it still reference the desyel.png:
<font>
<info ... />
<common .../>
<pages>
<page id="0" file="desyrel.png"/>
</pages>
When running PIXI.Assets.loadBundle('game-screen'), PIXI cannot find desyrel.png (because it's phrased to desyrel-xxxxx.png etc), 404 error occurs.
Expected Behaviour
desyel.xml should get phrased into all resolutions, formats with hashes, and each reference to its corresponding texture. Similar to how the spine atlas gets phrased.

Checking the Pixi.js Bitmap test-assets, each bitmap texture has its own data file (XML, FNT, etc), although the data files should be almost the same, but with different filename and size values.

Pixi's Side Solution?
I think this can also be fixed on Pixi's side. We always have ONE XML with different textures. When Pixi reads the XML and sees desyel.png, for example, it should reference back to the manifest and try to load the correct texture from the manifest.