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

Fontconfig error: Cannot load default config file #38

Closed
Wizmoore opened this issue Dec 21, 2021 · 4 comments
Closed

Fontconfig error: Cannot load default config file #38

Wizmoore opened this issue Dec 21, 2021 · 4 comments

Comments

@Wizmoore
Copy link

hello iam using Replit and iam getting this error any idea how i can fix it

there is not Letters on the photo
Preview https://imgur.com/Pedn0gd

@Shashank3736
Copy link
Owner

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.

@Wizmoore
Copy link
Author

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}` });

@Shashank3736
Copy link
Owner

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.

@Shashank3736
Copy link
Owner

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

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

2 participants