Introduce text_size_info and change back where text is positioned#692
Closed
vbfox wants to merge 4 commits intoimage-rs:mainfrom
Closed
Introduce text_size_info and change back where text is positioned#692vbfox wants to merge 4 commits intoimage-rs:mainfrom
vbfox wants to merge 4 commits intoimage-rs:mainfrom
Conversation
text_size_info can give both the box where the font wants to be logically placed to form a line (But depending on the font it might draw pixels out of this box) and the pixel-bounding box where pixels were really placed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
text_size_infocan give both the box where the font wants to be logically placed to form a line (But depending on the font it might draw pixels out of this box) and the pixel-bounding box where pixels were really placed.I know that it'll be controversial as it changes some details from #689 but I think it's the right choice:
By providing both, the consumer can take correct decisions.
I'm not sure what
text_sizeshould return, as the logical size is bound to be a bit surprising (some pixels would go out of there) but the pixel size is useless to position text relative to other text...I'm opening this PR more as a discussion starter, as I think whatever design ends up being the final one the coordinate system and it's relation with the sizing methods need to be documented in the draw methods.