Better calculations for svg-lib-tag #12
Closed
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.
After some testing and what happened in rougier/svg-tag-mode/pull/14 I decided to continue my work in this repo, since it is like the 'updated' version of the other one. I have been able to make the tags have the same width as the rest of characters on the frame, something that (at least to me) didn't work.
I also have fixed that tags in different lines, one above another, had their border next to each other without any space in between.
WIP: Making the text stay at the center, actual code:
But it doesn't work as expected, it seems like the total width of the characters inside the tag is strangely big, take a look at the next output of a tag's svg-width and it's tag-txt-width:
And it looks like this:
Feels like it should be way less, like 50 instead of 70, because if I understood correctly
tag-char-width
is the width of the characters inside the tag.Edit: Actually, by measuring the image, it seems like the text is actually 48px (like 2/3 of the actual width it tells)
PS: My font is Iosevka Term, height 120