fix bmp_lbl for ascenders and descenders #213
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@ladyada
Resolves: #201
I tested on PyPortal Titano with the font specified in the issue and confirmed with this change bitmap label no longer cuts off the top and bot of ascenders and descenders.
I looked into the position offset between Label and Bitmap label mentioned in the issue as well. The root cause of that the code using anchor point and anchor position which take into account the width and height of the bounding box. It turns out that Label and Bitmap label differ in the size that they come up for the height when
background_tight=False
(which is the default value). That difference in size results in a difference of location when placed with the relative anchors. If you usebackground_tight=True
for both types then the height will end up the same and thus placement will also match. I think that is worthy of it's own separate issue as it seems unrelated specifically to the cutting off of ascenders and descenders.