Improve WebGL font error message to suggest textFont() usage#8494
Improve WebGL font error message to suggest textFont() usage#8494davepagurek merged 2 commits intoprocessing:mainfrom
Conversation
|
🎉 Thanks for opening this pull request! For guidance on contributing, check out our contributor guidelines and other resources for contributors! Thank You! |
|
If the test runs, then this sounds reasonable and helpful! I checked the failing test and I'm not sure what was up, I reran. If it fails, then code would need to be updated so tests do pass. Minor wording revision to keep the message same length:
|
|
@ksen0 all tests are passing now. |
davepagurek
left a comment
There was a problem hiding this comment.
Thanks! Would you be interested in making a similar update to the dev-2.0 branch, which p5 2.x builds are made from?
Improves the error message when rendering text in WebGL mode without properly setting a font.
Problem:
The current error "only Opentype (.otf) and Truetype (.ttf) fonts are supported" is misleading when users have loaded a valid font but forgot to call textFont().
Solution:
Added clarification: "Make sure to set the font using textFont() before drawing text."
PR Checklist
npm run lintpasses