xixi52 / discord-canvas

A package to simplifie the usage of canvas for Discord !
87 stars 44 forks source link

return Canvas._registerFont(fs.realpathSync(src), fontFace) #21

Open euandrelucas opened 3 years ago

euandrelucas commented 3 years ago

return Canvas._registerFont(fs.realpathSync(src), fontFace) ^

Error: Could not parse font file at Object.registerFont (C:\Users\Home\Desktop\Secretaria\Discord\Programação\Bots\star\star-developer\node_modules\canvas\index.js:48:17)
at Object. (C:\Users\Home\Desktop\Secretaria\Discord\Programação\Bots\star\star-developer\node_modules\discord-canvas\index.js:3:8)
at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Module.require (internal/modules/cjs/loader.js:1025:19) at require (internal/modules/cjs/helpers.js:72:18) at Object. (C:\Users\Home\Desktop\Secretaria\Discord\Programação\Bots\star\star-developer\src\commands\Others\fnshop.js:3:16) at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Module.require (internal/modules/cjs/loader.js:1025:19) at require (internal/modules/cjs/helpers.js:72:18) at C:\Users\Home\Desktop\Secretaria\Discord\Programação\Bots\star\star-developer\bot.js:100:21 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! star@1.0.0 start: node bot.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the star@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Home\AppData\Roaming\npm-cache_logs\2021-01-07T15_18_05_141Z-debug.log

Shadyyey commented 3 years ago

code????? -.-

euandrelucas commented 3 years ago

no, it only gave this error when I downloaded the npm

Shadyyey commented 3 years ago

@yADGithub Try re-installing discord-canvas and canvas.

Vozmak commented 3 years ago

i have it problem too

imyanice commented 3 years ago

Ok send me your code pls

imyanice commented 3 years ago

@Vozmak

Vozmak commented 3 years ago

Ok send me your code pls

Hi. The error appears immediately upon require Const Canvas = require("discord-canvas") @xixi52

imyanice commented 3 years ago

Try npm uninstall discord-Canvas then npm i discord-canvas

Vozmak commented 3 years ago

Try npm uninstall discord-Canvas then npm i discord-canvas

Anyway @Yan-Jobs

Vozmak commented 3 years ago

Full error

return Canvas._registerFont(fs.realpathSync(src), fontFace) ^

Error: Could not parse font file at Object.registerFont (C:\Users\HP\Desktop\Текст и войс\node_modules\canvas\index.js:48:17) at Object. (C:\Users\HP\Desktop\Текст и войс\node_modules\discord-canvas\index.js:3:8) at Module._compile (node:internal/modules/cjs/loader:1108:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10) at Module.load (node:internal/modules/cjs/loader:973:32) at Function.Module._load (node:internal/modules/cjs/loader:813:14) at Module.require (node:internal/modules/cjs/loader:997:19) at require (node:internal/modules/cjs/helpers:92:18) at Object. (C:\Users\HP\Desktop\Текст и войс\commands!profile.js:2:16) at Module._compile (node:internal/modules/cjs/loader:1108:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10) at Module.load (node:internal/modules/cjs/loader:973:32) at Function.Module._load (node:internal/modules/cjs/loader:813:14) at Module.require (node:internal/modules/cjs/loader:997:19) at require (node:internal/modules/cjs/helpers:92:18) at C:\Users\HP\Desktop\Текст и войс\index.js:38:21

imyanice commented 3 years ago

2s

imyanice commented 3 years ago

Do u have this file ? : /assets/fonts/theboldfont.ttf

Vozmak commented 3 years ago

sec

Vozmak commented 3 years ago

in canvas or discord-canvas?

Vozmak commented 3 years ago

Do u have this file ? : /assets/fonts/theboldfont.ttf

image Yes, have

imyanice commented 3 years ago

Is it empty ?

Vozmak commented 3 years ago

no

imyanice commented 3 years ago

Ah

Vozmak commented 3 years ago

font in my language in this file

Vozmak commented 3 years ago

sry for my english

imyanice commented 3 years ago

Try copy all your files in a new directory but don’t copy this files: package-lock.json or yarn.lock node_modules folder

imyanice commented 3 years ago

sry for my english

I don’t care I am french 13 yrs old lmao

imyanice commented 3 years ago

Try copy all your files in a new directory but don’t copy this files: package-lock.json or yarn.lock node_modules folder

And reinstall dependency with npm init -y Or yarn (I think) and npm install or yarn install

Vozmak commented 3 years ago

ok, i try it later, thx

Vozmak commented 3 years ago

Anyway, i create absolutly new project and anyway error @Yan-Jobs

imyanice commented 3 years ago

Ah euh that’s not a good thing

Vozmak commented 3 years ago

yes( very good npm, but dont work, ah

imyanice commented 3 years ago

xD

imyanice commented 3 years ago

Tomorrow I will dm the creator and ask him your problem

Vozmak commented 3 years ago

Ok, thx

imyanice commented 3 years ago

DMed @Vozmak

Vozmak commented 3 years ago

DMed @Vozmak

Ok, I wait @Yan-Jobs

imyanice commented 3 years ago

@xixi52 c’est là xD

imyanice commented 3 years ago

Enfin tu peux aussi voir les autres lmao

OfficialRDB commented 2 years ago

(process:12152): Pango-WARNING **: 18:08:16.010: couldn't load font "Keep Calm Medium Not-Rotated 37px", falling back to "Sans Medium Not-Rotated 37px", expect ugly output.

The fonts don't load. Even while they are in the right place. I even installed the fonts on my windows server just in case.

EDIT: I just turned off the font register and installed the fonts on my windows servers, changed the names how they are seen by windows. Works fine now.