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

Is there any strokeText option? #292

Closed
Ardyey opened this issue Jan 13, 2025 · 5 comments · Fixed by #293
Closed

Is there any strokeText option? #292

Ardyey opened this issue Jan 13, 2025 · 5 comments · Fixed by #293

Comments

@Ardyey
Copy link

Ardyey commented Jan 13, 2025

Even on the original canvas-txt, I don't see any support for strokeText. Is there perhaps an option I'm not aware to stroke a text?

@stefcameron
Copy link
Owner

@Ardyey Not at the moment, but it looks like this would be easy to add by adding strokeColor and strokeWidth format options to control the CanvasRenderingContext2D.strokeStyle and CanvasRenderingContext2D.lineWidth properties when painting the text.

Would have to also paint the text using CanvasRenderingContext2D.strokeText() after the existing fillText() call so that the stroke (outline) appears above the filled text.

I'll see if I can get this added soon.

@stefcameron
Copy link
Owner

@Ardyey Checkout #293 😄

@Ardyey
Copy link
Author

Ardyey commented Jan 15, 2025

Amazing! Thanks for the prompt solution!

@stefcameron
Copy link
Owner

Amazing! Thanks for the prompt solution!

My pleasure! 😄

@stefcameron
Copy link
Owner

Published in v1.2.0 just now.

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 a pull request may close this issue.

2 participants