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
Make hypertext[] respect font size settings #13858
Conversation
A proper solution would be to use multipliers (e.g. 0 ... 5) to scale the font based on the client's settings. The API is marked as unstable in the docs, hence this behaviour could in theory be changed. However, I am sure several mods already rely on the Opinions? |
If I understand your proposal correctly, doesn't that just mean replacing the current 0...16 range with a 0...5 range? |
@grorp No, the proposed change is to have a multiplier (edited the comment accordingly) in place of the current absolute font size. |
Added to milestone as written on IRC: https://irc.minetest.net/minetest-dev/2023-10-08#i_6120697 I think the approach of this PR is good enough, but I'd also be fine if someone implemented a different solution. |
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.
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.
srifqi appears to use a noticeably bigger mono font size (setting value) to test this change. The hypertext element does look "more correct" when two similar or identical scales are chosen.
Works.
Correct. I used the values in the first post to test it.
|
While testing #13850 on Android, I noticed that the text rendered by
hypertext[]
was larger than other text.hypertext[]
has a hardcoded default font size of 16 and doesn't respectfont_size
andmono_font_size
, which are set to 14 on Android by default.Since modders can specify absolute font size values for
hypertext[]
, just using the mentioned settings as default values instead isn't enough. What this PR does is this:To do
This PR is a Ready for Review.
How to test
Set
font_size
to 10, setmono_font_size
to 30. Execute/test_formspec
in a Devtest world, go to the "Hypertext" tab and see that your font size settings are applied.