-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Added getter tests for dynamic fonts #81503
base: master
Are you sure you want to change the base?
Conversation
What is the font licensed under? I'd suggest copying the smallest font from this repository's |
b30cf00
to
1621920
Compare
I switched the test font to a font from |
Remember to remove |
1621920
to
bb192a7
Compare
Thanks for catching that. Appeared to be some git mistakes. Should be cleared up now :). |
Quick question. Are the docs correct in that for PRs we want to amend previous commits instead of pushing new ones? Just clarifying so I know the expected flow. |
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.
The same font is already included as the editor font, so there's no reason to do it again, just use thirdparty/fonts/NotoSansHebrew_Regular.woff2
.
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.
Or load it directly from the editor resources font->set_data_ptr(_font_NotoSansHebrew_Regular, _font_NotoSansHebrew_Regular_size);
, see tests/servers/test_text_server.h
and editor/editor_fonts.cpp → load_internal_font
for examples.
The docs are correct, you can make multiple commits if you need to track changes, but this is a small change so no reason, you will have to squash before it can be merged anyway if it gets approved |
bb192a7
to
7038589
Compare
7038589
to
3f83e18
Compare
3f83e18
to
d36c64f
Compare
Addressed all feedback |
A question on process, do I need to do anything else to finish this PR? |
I don't think so, we only need someone to perform a final review and it should be good to merge. |
Hi, I'd like to extend Font tests by adding testing for FontFile as per #43440 but it might make sense to have this merged first so that I can extend it. This PR has been open for a long time. Could we do something about it? Is there a protocol around pinging somebody/increasing visibility somehow when we are waiting a long time for a review? Alternatively, I could write FontFile unit tests in a separate file, but considering that Font and FontFile (and FontVariation for that matter) declarations are bundled together, maybe the tests for them should also be in the same place? |
#include "tests/test_utils.h" | ||
|
||
namespace TestFont { | ||
TEST_CASE("[String] Instantiation") { |
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.
Should it really be [String] here? If this is the tag that's used to filter which tests to run when running test suites, it would imo make more sense that it's something like [Font]. And same for other places in the file where we have [String].
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.
This is either a copy-pasting mistake or an oversight, so it should be [Font]
indeed.
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.
Tested locally (rebased on top of master
6c57928), it works as expected.
All instances of [String]
should be replaced with [Font]
before merging.
Added getter tests for
Font
when loading a dynamic font file as listed in #43440Used a free dynamic font file found at https://www.dafont.com for testing.
For the size based values I chose a small and large sized and used what was already outputted, to act as regression.