Code Monkey home page Code Monkey logo

Comments (4)

Shashank3736 avatar Shashank3736 commented on May 27, 2024

Check issue #31 the problem is with skia-canvas, use v2 for now. v2.4.0 (#34) will have all the features of v3 in node-canvas.

from captcha-canvas.

Wizmoore avatar Wizmoore commented on May 27, 2024

same problem after i use v2.4.0
https://prnt.sc/2461xlq
how i can use external font using font path
like this

      const { registerFont } = require('canvas')
       registerFont('./Structures/fonts/Genta.ttf', { family: 'Genta' })

this is my code

const captcha = new CaptchaGenerator()

          .setDimension(150, 450)
          .setCaptcha({font: "Genta", size: 60, color: "deeppink" })
          .setDecoy({ opacity: 0.5 })
          .setTrace({ color: "deeppink" });

        const captchaAttachment = captcha.generateSync(
          await captcha.png, 
          "captcha.png"
          );
        interaction.reply({ files: [captchaAttachment], content: `Code: ${captcha.text}` });

from captcha-canvas.

Shashank3736 avatar Shashank3736 commented on May 27, 2024

check version correctly. v2.4.0 is not yet released it's still a draft. BTW the way you use registerFont() is correct so the only issue is custom font do not support in your system.

from captcha-canvas.

Shashank3736 avatar Shashank3736 commented on May 27, 2024

Close because of inactivity I am going to assume that problem is resolved.

from captcha-canvas.

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.