Git Product home page Git Product logo

Comments (5)

paramsinghvc avatar paramsinghvc commented on September 26, 2024 1

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.

patorjk avatar patorjk commented on September 26, 2024

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.

paramsinghvc avatar paramsinghvc commented on September 26, 2024

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.

patorjk avatar patorjk commented on September 26, 2024

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.

patorjk avatar patorjk commented on September 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.