pixijs / assetpack

A configurable asset pipeline for the web
http://pixijs.io/assetpack/
MIT License
96 stars 19 forks source link

Bug: Bitmap font XML not phrased and exported correctly #88

Open furic opened 1 week ago

furic commented 1 week ago

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

Current Behaviour

desyel.png got phrased correctly, exported as all resolutions and formats with hashes, but desyel.xml was not phrased and simply got copied to the output folder.

public-assets-game-screen-bundle-current

In desyel.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-F3uydg.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.

public-assets-game-screen-bundle-expected

Checking the Pixi.js Bitmap test-assets, each bitmap texture has its own data file (XML, FNT, etc), although the data files are exactly the same, only the texture filename changed.

pixijs-bitmap-test-files

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.