unburn / musicard

Musicard is a futuristic music card canvas library
GNU General Public License v3.0
81 stars 22 forks source link

The text cannot be used for text other than the English text #7

Closed AsameJP closed 1 year ago

AsameJP commented 1 year ago

I have created a Discord Bot that allows users to select songs using Slash Commands. Most of my friends are from Japan and Korea. When my friends enter song titles into the bot, they appear as garbled characters similar to not supporting special characters. However, artist names still appear in the English language. I apologize for not having much knowledge about coding, and I'm wondering what steps I should take to address this issue.

KBYSHanahira commented 1 year ago

Same

KBYSHanahira commented 1 year ago

@AsameJP , I'm resolve it by use font type ".otf" japanese or some font support japanese word to fix this

add file in directory res : node_modules/musicard/res/< - You font files ->.otf

and fix code in : node_modules/musicard/build/index.d.ts

from : canvas.GlobalFonts.registerFromPath(`${devmod ? "" : "node_modules/musicard/"}res/momcakebold.ttf`, 'momcakebold');

to : canvas.GlobalFonts.registerFromPath(`${devmod ? "" : "node_modules/musicard/"}res/< - You font file - >.otf`, 'momcakebold');

Result : image

Recommend : Arial Unicode MS

Have Fun :)

flameface commented 1 year ago

Added language support in 1.4.2