Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
furic opened this issue Sep 6, 2024 · 3 comments
Open

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

furic opened this issue Sep 6, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@furic
Copy link
Contributor

furic commented Sep 6, 2024

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

raw-assets-game-screen-bundle
  • 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 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 should be almost the same, but with different filename and size values.
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.

@furic furic changed the title Bug: Bitmap font not getting phrased correctly Bug: Bitmap font XML not getting phrased correctly Sep 6, 2024
@furic furic changed the title Bug: Bitmap font XML not getting phrased correctly Bug: Bitmap font XML not phrased correctly Sep 8, 2024
@furic furic changed the title Bug: Bitmap font XML not phrased correctly Bug: Bitmap font XML not phrased and exported correctly Sep 8, 2024
@Zyie Zyie added the bug Something isn't working label Sep 9, 2024
@furic
Copy link
Contributor Author

furic commented Sep 24, 2024

@Zyie Any plan to fix it? As it's the only bug that keeps us from using Asset Pack.

@Zyie
Copy link
Member

Zyie commented Sep 24, 2024

Hey @furic yes i do plan to fix this, sorry it's taken a while, will hopefully get to this soon

@sarahgaucimizzi
Copy link

Hi :) any update on this please? @Zyie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants