Skip to content
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

Better calculations for svg-lib-tag #12

Closed
wants to merge 3 commits into from
Closed

Conversation

aruZeta
Copy link
Contributor

@aruZeta aruZeta commented Dec 18, 2021

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:

(text-x (+ tag-x
           padding
           (/ (- tag-width
                 (* padding 2)
                 tag-txt-width)
              2.0)))

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:

80 svg-width, 70 tag-txt-width

And it looks like this:
Sat-18-Dec-2021_21-41-42
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

@aruZeta
Copy link
Contributor Author

aruZeta commented Dec 23, 2021

Not really sure how should the calcultions take into account the new stuff; crop-left, crop-right and alignment

@aruZeta aruZeta closed this Dec 27, 2021
@aruZeta aruZeta deleted the develop branch December 27, 2021 16:53
@aruZeta aruZeta restored the develop branch December 27, 2021 16:54
@aruZeta aruZeta deleted the develop branch December 27, 2021 17:00
@aruZeta aruZeta restored the develop branch December 27, 2021 17:01
@aruZeta
Copy link
Contributor Author

aruZeta commented Dec 27, 2021

Seems like you cant rename the branch, dont mind it.

@aruZeta aruZeta reopened this Dec 27, 2021
@rougier
Copy link
Owner

rougier commented Jan 3, 2022

The size correspondence between emacs and svg is wrong for some reason that need yet to be identified.

@aruZeta aruZeta closed this Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants