Skip to content

Add visual regression test for leading tabs in text#8534

Open
Omar-2718 wants to merge 1 commit intoprocessing:dev-2.0from
Omar-2718:dev-2.0
Open

Add visual regression test for leading tabs in text#8534
Omar-2718 wants to merge 1 commit intoprocessing:dev-2.0from
Omar-2718:dev-2.0

Conversation

@Omar-2718
Copy link

@Omar-2718 Omar-2718 commented Feb 16, 2026

Addresses #8469

Changes:
Added screen shots for the required result in \test\unit\visual\screenshots\Typography\textFont\Preserve leading tabs
and added regression test to test if the tap renders in a text with text('test\n\ttest', 0, 0, p5.width, p5.height)

Screenshots of the change:

PR Checklist

@dhowe dhowe requested review from davepagurek and dhowe and removed request for dhowe February 17, 2026 03:54
visualTest('Preserve leading tabs',function (p5, screenshot){
p5.createCanvas(100, 100);
p5.textSize(35);
p5.text('test\n\ttest', 0, 0, p5.width, p5.height);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! This wasn't generated with @dhowe's changes in, right? I'm wondering why the screenshot shows the tab having an effect, when it's the buggy code still generating the visual. @Omar-2718 in your browser this was still showing incorrect behaviour right? If you mirror that test more closely here (e.g. with a space before the \n? not sure if that's significant) do you see the screenshot starting to show the incorrect behaviour?

In general I'd expect to see the screenshot show incorrect results, and then only after @dhowe's code is merged, would we be able to lock in the correct behaviour in a screenshot.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used @dhowe's code to generate the screenshot (as that is the supposed correct answer for the test case) so that my version (the one that isnt working) fails that test. My bad,
So I'm supposed to push the screenshot of my failing code(it fails with 'test\n\ttest' ) before @dhowe's changes, right? And only after @dhowe's pull is merged, update the screenshot

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, that makes sense then! although I'm also curious why CI says that the tests are paying even though this PR doesn't include the fixes yet... in any case, we should merge this after the fix is in.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image Yeah thats weird, this image is from the CI visual-test-report and somehow passes. When I run it locally, it fails normally. I'm not sure if this behaviour is because of font differences between Ubuntu on the CI and Windows that generated the test image. Or the difference threshold to make the test pass is too big. I can look into it

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.

2 participants

Comments