pr05 Visual Regression Testing #2: Adding More Tests by Vaivaswat2244 · Pull Request #1315 · processing/processing4
Add Visual Tests for Typography and Shape Modes
Summary
This PR adds comprehensive visual tests for two core Processing features:
- Typography - Text rendering, alignment, sizing, and font handling
- Shape Modes - Rectangle, ellipse, and arc rendering with different coordinate modes (CORNERS, CORNER, CENTER, RADIUS)
Typography Tests
Tests cover:
- Font rendering (default, monospace, system fonts)
- Text alignment (9 combinations of horizontal/vertical alignment)
- Text sizing and leading
- Text width calculations
- PFont methods (ascent, descent, glyph availability)
- Complex rendering (rotation, transparency, colors, multi-line text)
Shape Modes Tests
Tests cover:
- All 4 modes (CORNERS, CORNER, CENTER, RADIUS) for each of 3 shapes (ellipse, arc, rect)
- 16 coordinate configurations per test (testing positive/negative coordinate combinations)
- Negative dimension handling for each shape type
Known Issue
Arc rendering inconsistency: Arc tests are currently not generating screenshots as expected due to what I think might be a discrepancy in how Processing handles negative dimensions compared to p5.js.
For Processing the screenshot getting generated is

and for p5, same test generates image

In p5.js, arc() converts negative width/height to absolute values while maintaining position. Processing's arc() appears to handle this differently, causing some arcs not to render or render at incorrect positions. I would like some thoughts as to why this may be happening.