Skip to content

fix: complete WebGL text.js TODO implementations and replace console.log with FES (fixes #8579)#8580

Open
MASTERsj01 wants to merge 1 commit intoprocessing:mainfrom
MASTERsj01:fix/webgl-text-todo-implementation
Open

fix: complete WebGL text.js TODO implementations and replace console.log with FES (fixes #8579)#8580
MASTERsj01 wants to merge 1 commit intoprocessing:mainfrom
MASTERsj01:fix/webgl-text-todo-implementation

Conversation

@MASTERsj01
Copy link

Summary

Completes unfinished TODO implementations and replaces raw console.log() calls with p5._friendlyError() in src/webgl/text.js.

Resolves #8579

Changes

Location What Changed
_applyTextProperties() Removed orphaned @TODO comments, added return this._pInst matching the 2D renderer pattern
textWidth() Added FES warning for non-OpenType fonts instead of silently returning 0 with // TODO: error
_renderText() 2 console.logp5._friendlyError() for missing/incompatible font warnings
Error messages Fixed capitalization: Opentype → OpenType, TruetypeTrueType

Notes

  • All existing tests pass (1848 passing, 0 failing)
  • Only 1 file changed: 27 insertions, 20 deletions

…log with FES

- Complete _applyTextProperties(): removed orphaned TODO comments, added
  proper return value (this._pInst) matching the 2D renderer pattern
- Add FES warning in textWidth() for non-OpenType fonts instead of
  silently returning 0
- Replace 2 console.log() in _renderText() with p5._friendlyError()
  for missing font and non-OpenType font warnings
- Fix capitalization: 'Opentype' -> 'OpenType', 'Truetype' -> 'TrueType'
@welcome
Copy link

welcome bot commented Mar 1, 2026

🎉 Thanks for opening this pull request! For guidance on contributing, check out our contributor guidelines and other resources for contributors!
🤔 Please ensure that your PR links to an issue, which has been approved for work by a maintainer; otherwise, there might already be someone working on it, or still ongoing discussion about implementation. You are welcome to join the discussion in an Issue if you're not sure!
🌸 Once your PR is merged, be sure to add yourself to the list of contributors on the readme page !

Thank You!

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.

WebGL text.js: complete TODO implementations and replace console.log with FES

1 participant