Comments (5)
Working fine now. Thanks a lot. Btw, may I know what was the issue and how did you solve it. Because I too tried to debug it by comparing the JS file with the FLF file in diffcecker, there were exactly same. Where was the issue precisely?
from figlet.js.
Thank you for reporting this, the second way you mentioned is how you're meant to use the library for Node.js apps. If your app is running in Node, you also don't need to import the fonts, see the "Basic Usage - Node.js" section of the README.md. The "importable-fonts" folder was something I created as a way for webpack-based front-end libraries to use the app (I'll be adding official documentation for it later on, but was letting it sit while I think about it).
However, I am interested in why this would be happening. What version of Node are you using and how are you running your code? I tried mocking up an example using your example code, but I can't get it to run.
from figlet.js.
It's working in my dev environment, but on the production environment I'm using Docker to build the image using multi-stage build. In the end, I'm only storing the build files in the image, discarding everything else like node_modules and stuff for small image size.
Now, since the path for the flf files is being evaluated in the runtime, it comes in the production as ../../../node_modules/figlet/fonts/xyz.flf
which resolves to nothing as throws error.
from figlet.js.
I just published a new version of the library - 1.2.4. I've updated the importable-fonts. They should now display correctly for you. The feature had been undocumented since I haven't had much time to try it out. I think I solved the issue you were seeing above as I was able to replicate it in a webpack setup. So doing it that way is probably best for your setup.
from figlet.js.
The issue was the escaping of the Blackslash character for the importable-fonts. The feedback I got on the idea seem to be positive in the React thread - #32 (comment), however, I just noticed that someone in the other thread mentioned the fonts were slightly off (which was due to the Blackslash character not appearing). When I some time I'll add some tests for the importable-fonts and then add this method to the documentation.
from figlet.js.
Related Issues (20)
- Examples directory of the repository is part of the NPM package HOT 3
- can't find font file HOT 3
- Slant front weird rendering HOT 13
- How to use different colors HOT 3
- [ PLS HELP ] want to change the header text , but in bash.bashrc file there is no written text HOT 1
- Possibility to add one empty line at the top/beginning HOT 2
- Can this library be used in ES without webpack? HOT 4
- Cannot read property 'reduce' of undefined HOT 2
- Can blank lines be preserved?
- Problem with code that pollute array prototype
- small slant.flf does not work in Ubuntu HOT 2
- TypeError: Cannot read properties of undefined (reading 'reduce') HOT 6
- Typo in README.md
- Readability issues in README.md
- TTF -> FLF? HOT 2
- Cannot find module figlet HOT 1
- [README] Build Status Shield Button Not Working HOT 1
- Question: Why doesn't figlet return the new text and why is error the first parameter of the callback? HOT 1
- [Suggestion] Way to import every font using Webpack
- Error: Cannot find module 'figlet'(已经重新安装依赖还是如此)node v16.20.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from figlet.js.