Load Custom Font Error
See original GitHub issueHi Everyone!
When i try to load custom font (font.fnt), it gives me an error like “no such file or directory, … font.png”. Even if it is not a .png file, error says it is an .png file.
Could anyone help me to overcome this problem please?
CODE
Jimp.loadFont('font.fnt').then(function (font) {
baseImage.print(font, 10, 10, "Hello World!");
baseImage.write("output.png");
});
ERROR (node:6476) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open ‘C:\Users\USERNAME\Desktop\jimp-ex\font.png’ (node:6476) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
Why does the android studio gives me an error when I add the ...
Try this: You have to create a folder named font inside the res folder and copy your font inside the new folder.
Read more >Custom font is failing to load for existing project #2374 - GitHub
Steps to reproduce the behavior: Create a document with a custom font; Update the page; The texts that used the custom font are...
Read more >How to load web fonts to avoid performance issues and speed ...
Use the correct font format; Preload fonts; Use the correct font-face declaration; Avoid invisible text during font loading. Let's break down ...
Read more >Error loading custom font? : r/godot - Reddit
I tried that and found where it shows the custom font in the project.godot file, and then deleted that line. But, fascinating to...
Read more >Custom Fonts Not Displaying On Front End - Elementor
In order to fix this issue, you can use the Generator tool from Font Squirrel. From there, you can check options as shown...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Future Jimp users . Don’t use BMFont generator cuz that i converted my ttf and otf fonts with it and result was not good . Font converted but with black background frame .
İnstead of BMFont generator use Hiero converter it is much better .
Documenting this in the hope of helping someone in the future.
If you’re using BMFont generator from angelcode, go into the ‘Export options’ menu via Options -> Export Options or by pressing
T
.Then:
And all should be good!