-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Describe difference between font size and bbox #7806
Conversation
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.
That's better, thank you!
docs/deprecations.rst
Outdated
offset. | ||
|
||
.. image:: ./example/size_vs_bbox.png | ||
:alt: Demonstration of size height vs bbox top and bottom |
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.
Rather than saying what the image is, could you describe what the image conveys?
Imagine it read aloud to you when you can't see the image.
https://accessibility.huit.harvard.edu/describe-content-images
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.
I've pushed a commit.
In bbox methods, top measures the vertical distance above the text, while bottom measures that plus the vertical distance of the text itself. In size methods, height also measures the vertical distance above the text plus the vertical distance of the text itself.
I don't really like it, but it was a struggle to explain the meaning of 'height', 'top' and 'bottom' without using those words in the definitions of those terms themselves.
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.
Thanks! It can be a challenge to write good alt text.
I read it through and understood the difference without looking at the image. 👍
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.
I've created radarhere#23 to also show how anchors can be used to align text, which I have seen to be a common source of confusion with this change.
I originally wanted to write this back when these functions were being deprecated, but I didn't have time to get to it then and forgot to get back to it until now.
Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
Show how to use anchors to align text in ImageFont deprecations
Resolves #7802
The user in the issue thinks that the documentation could use further detail about the transition from
font.getsize()
tofont.getbbox()
.I've amended the deprecations and release notes documentation with the following
While here, I also noticed that some of the example code didn't use the font declared earlier, so I've fixed that.