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] Cannot load font from HTTP URL using Assets.load #5

Open
UlyssesZh opened this issue Jul 26, 2023 · 0 comments
Open

[Bug] Cannot load font from HTTP URL using Assets.load #5

UlyssesZh opened this issue Jul 26, 2023 · 0 comments

Comments

@UlyssesZh
Copy link

UlyssesZh commented Jul 26, 2023

npm i @pixi/node
node -e "require('@pixi/node').Assets.load('https://fastly.jsdelivr.net/gh/dictcp/wangfonts/TrueType/wt071.ttf')"
/home/ulysses/temp/pixi-node-test/node_modules/@pixi/assets/lib/loader/Loader.js:93
          throw new Error(`[Loader.load] Failed to load ${url}.
                ^

Error: [Loader.load] Failed to load https://fastly.jsdelivr.net/gh/dictcp/wangfonts/TrueType/wt071.ttf.
Error: ENOENT: no such file or directory, lstat '/home/ulysses/temp/pixi-node-test/https:'
    at /home/ulysses/temp/pixi-node-test/node_modules/@pixi/assets/lib/loader/Loader.js:93:17
    at async Promise.all (index 0)
    at async Loader.load (/home/ulysses/temp/pixi-node-test/node_modules/@pixi/assets/lib/loader/Loader.js:98:5)
    at async AssetsClass._mapLoadToResolve (/home/ulysses/temp/pixi-node-test/node_modules/@pixi/assets/lib/Assets.js:170:26)
    at async AssetsClass.load (/home/ulysses/temp/pixi-node-test/node_modules/@pixi/assets/lib/Assets.js:95:17)

Node.js v18.16.0

However, loading from local files is fine:

npm i @pixi/node
wget https://fastly.jsdelivr.net/gh/dictcp/wangfonts/TrueType/wt071.ttf
node -e "require('@pixi/node').Assets.load('wt071.ttf')"

The cause of the bug is because registerFont() can only accept local file paths instead of any HTTP URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant