-
-
Notifications
You must be signed in to change notification settings - Fork 11
Percent command does not properly calculate line spacing when fonts define TypoAscender + TypoDescender > UPM #6
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
Comments
Will modify the calculations to address this issue. We had a discussion about the line spacing approaches in #2 and the Fira approach is one that was discussed (and recommended) there. I will be able to support modifications in fonts that use these metrics. Should be a reasonably simple fix. Will let you know when it is available in this thread. |
Ah, yes, I saw that thread. I didn't realize how complicated and non-cross-platform line-spacing metrics are. Web fonts don't help the situation, do they? haha Thanks for your work on this. I was particularly inspired when you said:
It's refreshing to hear a knowledgeable and capable developer express such a user-focused point of view today. It seems to be more and more rare, with most software being inclined to capture users rather than empower them. Let me know if you ever decide to start a Web browser project... (half kidding...) |
Yes! Frustratingly so...
I make tools that I want/need and use everything that I make so I am very user-focused :)
lol 😊🔫 |
Your issue is fixed as of v0.6.0. It is now live on PyPI and in the master branch of the repository. You can upgrade with:
I tested the changes on FiraMono which has the same metrics as FiraCode. You should be able to increase and decrease line spacing by the %UPM value defined on the command line now. Let me know if you still see any problems after the update. Enjoy! |
Hi Chris, I tested the new version and the metric adjustments work fine. It's nice to have those few extra lines! However, I noticed that the glyphs look a bit different in the modified font. They don't look bad, but they appear thinner. Is this expected? I've attached screenshots. Here's the original: And here's the modified 1.15 version: I also noticed that the line-spacing appears inconsistent. For example, in the Is this something like a rounding error or a lack of precision? Would using different metrics adjust more cleanly? Thanks for your work on this. |
Will take a look this weekend. Will let you know. |
I am having a difficult time making out the issues that you describe in the screenshots. Unclear to me why you would be seeing thinner strokes in the glyphs with these changes. As for the line spacing issue, I wonder if emacs accounts for spacing between lines based upon the size of glyphs in a given line. This might be a way to prevent clipping of parts of the glyphs that span across your tighter line spacing. Does this seem to be happening only in cases where there are glyphs present that extend below the baseline? Have a look for lines that include the lowercase Are you seeing these issues in other editors? |
Actually, just noticed that this does not seem to be the same typeface in the two images! Check the lowercase |
Wow, that's a facepalm-fail on my part. Apparently, after installing the new font and restarting Emacs, I forgot to actually select the new font in Emacs. And then I didn't look closely enough at the screenshots I took to notice. Sorry for wasting your time on this. :( |
No worries! Let me know if it worked out in the modified fonts. |
Hey Chris, I just tested it again and it's looking great! I modified Fira Code from the default 1.2 to 1.15, and I gained 4 extra lines of text in Emacs, and all the glyphs appear to look the same. I've attached screenshots. Thanks for your work on this! This will make several fonts usable for me, ones where the default line spacing simply is too large. |
great to hear that! enjoy it |
Will close this. Feel free to reopen if you have any other problems with it. |
reported by @alphapapa in source-foundry/Hack#191 (comment):
Hey Chris,
I just tried the 15% command, but it increased the line spacing instead of reducing it:
Then I uninstalled the original version of the fonts, installed the new fonts, and restarted Emacs, and the line spacing is indeed increased.
The text was updated successfully, but these errors were encountered: