-
-
Notifications
You must be signed in to change notification settings - Fork 809
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
core: Fix text culling check #18418
core: Fix text culling check #18418
Conversation
|
||
[image_comparisons."output"] | ||
trigger = 1 | ||
tolerance = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what value this should have
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but wanna make sure kjarosh approves too :)
Thank you for your contribution! There are several pitfalls that we can encounter in text-based tests. It's important to make sure the test produces the same output as Flash Player. Unfortunately that's not the case for This is specifically caused by the fact that device fonts are used to render the text. It's the case despite having a font set, because In general, I recommend using fonts that are vastly different from the default ones. I personally use my own crafted fonts and commit them (which you can also just embed to the SWF), see for instance: https://github.com/ruffle-rs/ruffle/blob/e9926f9a2e4f518a4095d9c1643440031033f14f/tests/tests/swfs/visual/fonts/leading_define_font/TestFont.ttf. I recommend doing that because of several reasons:
Regarding the output, it's best if the output comes from the Flash Player, and not Ruffle. It's enough to screenshot FP and replace the |
Thanks for the info, I'm sorry if I missed that anywhere else. I do have a few questions though, if you don't mind
Do you mean the
I'm sorry if I've misunderstood what image tests are for, but I thought they were moreso regression tests for Ruffle specifically rather than accuracy tests?
So it'd be alright if I used that font you linked, or should I make a different one for this? |
Yes, I'm sorry, I meant
Well, I guess there's no universal definition. Some tests in fact do that due to the fact that it's often extremely hard to get pixel-perfect output in Ruffle. In the case of simple text tests, I've put a lot of effort into making text near-pixel-perfect, so it should be fairly easy. Not to mention that we won't have to update the test when something changes in Ruffle, it should automatically pass (provided that something changes in the right direction ;) ).
Sure thing, you can simply embed this TTF in JPEXS and you're good to go. No need to create a custom font. Creating a custom font would be beneficial if you wanted to test something specific related to that font, but here we just want to check whether the text renders. Just remember that this font defines only 4 characters if I remember correctly (a, b, c, d). If you need some help with something just let me know, I can polish up the test :) |
ca44e3d
to
9c1e967
Compare
The check relied on `y_max` being the same as `height`, which isn't the case since `y_max` can be negative (close ruffle-rs#16877)
9c1e967
to
c59a4b7
Compare
@kjarosh don't know if the force pushes sent a notification, but if not, this should finally be ready now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! Thank you!
The check relied on
y_max
being the same asheight
, which isn't the case sincey_max
can be negative(close #16877)