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

Text seems to squashed up with NodeJS #1671

Open
ali-asghar5 opened this issue Nov 15, 2023 · 3 comments
Open

Text seems to squashed up with NodeJS #1671

ali-asghar5 opened this issue Nov 15, 2023 · 3 comments

Comments

@ali-asghar5
Copy link

ali-asghar5 commented Nov 15, 2023

I have an NodeJS app that load up the json data and save it as an image.

When Text gets loaded up as part of a group, the text gets squashed up (see attached).

I have tried to register font family but nothings seems to work. Any idea what could it be.
Test node already has a width and height values and it worked fine in React App.

// register fonts
registerFont('C:/Windows/Fonts/arial.ttf', { family: 'Arial' });
registerFont('C:/Windows/Fonts/calibri.ttf', { family: 'Calibri' });
registerFont('C:/Windows/Fonts/comic.ttf', { family: 'Comic Sans MS' });
registerFont('C:/Windows/Fonts/times.ttf', { family: 'Times New Roman' });
registerFont('C:/Windows/Fonts/verdana.ttf', { family: 'Verdana' });

image

@lavrton
Copy link
Member

lavrton commented Nov 15, 2023

Make a demo, please.

@ali-asghar5
Copy link
Author

ali-asghar5 commented Nov 15, 2023

konva.zip

That's tricky. As the sample code works fine locally. But when on Windows based Server less instance, it results in this weird behaviour.

@ali-asghar5
Copy link
Author

Seems like its related to node-canvas

Automattic/node-canvas#2272

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