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

Font Error #5

Closed
Puggy8893 opened this issue Jul 8, 2021 · 3 comments
Closed

Font Error #5

Puggy8893 opened this issue Jul 8, 2021 · 3 comments

Comments

@Puggy8893
Copy link

Whenever A user joins it shows the image, but the words arent there...

@Puggy8893
Copy link
Author

image
image

@Tomato6966
Copy link
Owner

Thats because replit is a free hosting company which doesnt have a complete os aka no default fonts, so use the canvas function registerFont to register a custom Font

const { registerFont, createCanvas } = require('canvas')
registerFont('comicsans.ttf', { family: 'Comic Sans' })

const canvas = createCanvas(500, 500)
const ctx = canvas.getContext('2d')

ctx.font = '12px "Comic Sans"'
ctx.fillText('Everyone hates this font :(', 250, 10)

U have to have the Font-File (here comicsans.ttf) in the Same Directory as where u register the Font

I suggest you to do that on the BOT START

@Puggy8893
Copy link
Author

image

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