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

Update rankCard.js #37

Merged
merged 1 commit into from
Oct 23, 2021
Merged

Update rankCard.js #37

merged 1 commit into from
Oct 23, 2021

Conversation

Only-Moon
Copy link
Contributor

Replace all the symbol globally from the usernam and return symbol free username

Replace all the symbol globally from the usernam and return symbol free username
@A-K-O-R-A
Copy link
Contributor

Can't we just change the font to a font that supports all characters?

@Only-Moon
Copy link
Contributor Author

Can't we just change the font to a font that supports all characters?

Literally not any font doesnt that, and you can find that in canvas issue, everyone is crying for canvas to do something but no font have all symbols

@A-K-O-R-A
Copy link
Contributor

A-K-O-R-A commented Oct 23, 2021

As far as I know there are fonts that support the symbols and u add them as fall back fonts but I don't known if this works in Node-canvas, but u could just use the font that discord uses bcs it seems to have all the symbols.

Edit:
I found a Issue on the node-canvas repository regarding the problem, u can render these characters with the default fonts:

ctx.font = '20px sans-serif, segoe-ui-emoji';

Or when you want to use a custom font(/custom fonts) you can use a font family to specify fallback fonts:

registerFont("path/to/preferred_font.ttf", {family: "allfonts"});
registerFont("path/to/japanese.ttf", {family: "allfonts"});
registerFont("path/to/chinese.ttf", {family: "allfonts"});
ctx.font = "12px allfonts";

@Rahuletto
Copy link
Owner

so what to do then

@Rahuletto Rahuletto merged commit f67f3ff into Rahuletto:dev Oct 23, 2021
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

Successfully merging this pull request may close these issues.

3 participants