-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Patcher reduces the spacing between lines making fonts difficult to read. #850
Comments
The same thing happens to me when patching comic code ligatures |
Edit:I found a quick and dirty fix, Just comment these lines in self.sourceFont.hhea_linegap = 0
self.sourceFont.os2_typolinegap = 0 The code is suppose to fix powerline related glyphs, however, if you don't care about them then commenting above lines should fix the issue. |
@tusharsnn 👍 I'm not sure the 🤔 Obviously I commented already some time back 😬 This needs some research in the This is the commit that added the lnes you mention: And probably it is right, but we have to keep the gap in another property then, we can not just silently remove it without replacement. |
I should point out that MonoLisa is aligned towards the top instead of being centered, which means there is more gap on the bottom then it is on the top. Is that fonts with this characteristic is effected by mentioned code or is there are other cases aswell ? |
Fonts that have a linegap set (only regular shown):
https://www.high-logic.com/font-editor/fontcreator/tutorials/font-metrics-vertical-line-spacing |
Maybe add option to 'keep line distance', but turned off for prepatched fonts? Edit: Both instanced in the Issue are self-patched fonts |
IMO the tool (or at least the |
But people will complain if the visuals of their beloved patched fonts change with an Nerd Font update. They do not care what is 'right' or 'wrong' as long as it is the same as before the update 😬 ;-) Thanks for the opinion! |
IF we use the line gap, there is another thing to decide on: You see that the Powerline Triangular Thing is exactly on the same height as the middle of
|
I agree with that, patched font should stay the same. And for self patching, 'keep line distance' flag should be enough. |
I don't pretend to understand |
AH! This font has no headroom! I have seen such patched fonts before, and they 'break' if people like to use diacritics like |
This looks ok-isch? I will clean up the commit and test with some of the other problematic (i.e. gap-having) fonts. |
Here is the issue where the headroom is too small for umlauts.. tested with text |
patched with equal gaps looks good to me 👍 |
[why] We just ignore specified gaps in the source fonts (i.e. set them to zero). This reduces the line spacing in the patched font (because the gap is missing). [how] Distribute the gap INTO the cell, so that we can work with zero gap (we need that for the powerline glyphs), and still keeping the powerline glyphs centered about the regular glyphs AND keeping the total line spacing. Idea-by: Tushar Singh <tusharvickey1999@gmail.com> Fixes: #850 Reported-by: Joe Bolts Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] We just ignore specified gaps in the source fonts (i.e. set them to zero). This reduces the line spacing in the patched font (because the gap is missing). [how] Distribute the gap INTO the cell, so that we can work with zero gap (we need that for the powerline glyphs), and still keeping the powerline glyphs centered about the regular glyphs AND keeping the total line spacing. Idea-by: Tushar Singh <tusharvickey1999@gmail.com> Fixes: #850 Reported-by: Joe Bolts Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Sorry for necroposting, but I just patched my Comic Code and spacing between the lines has diminished. I used
and
|
I have the same issue as @snpefk. I patched Comic Code with |
@paldepind @snpefk Sorry to hear of your problems. I introduced a bug in the line height calculations, and found that just a few days ago, let me check if your version(s) are what I believe fixed, or suffer that bug... That were these commits Here... Refs: 2.2.0-RC-466-g62b972b43
Author: Fini Jastrow <ulf.fini.jastrow@desy.de>
AuthorDate: Sun Feb 12 16:35:20 2023 +0100
Commit: Fini Jastrow <ulf.fini.jastrow@desy.de>
CommitDate: Sun Feb 12 17:06:18 2023 +0100
font-patcher: Fix: Use WIN metrics in all conflicting cases
[why]
With commit
621008773 font-patcher: Use WIN metrics in all conflicting cases
we intended to use the WIN metrics for the baseline to baseline
calculations for fonts that have contradicting (i.e. broken) metrices.
But we use the TYPO metrics instead.
[how]
This is obviously a typo in the code. To prevent such errors and improve
the readability we use Enums now. I believe we silently dropped support
for Python 2 some time back. And if not we drop it today :-}
[note]
Many thanks to Nathaniel Evan for again finding this bug!
Mentioned in: #1116
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
---
font-patcher | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/font-patcher b/font-patcher
index b0c451358..a00eb7f37 100755
--- a/font-patcher
+++ b/font-patcher
@@ -6,7 +6,7 @@
from __future__ import absolute_import, print_function, unicode_literals
# Change the script version when you edit this script:
-script_version = "3.5.6"
+script_version = "3.5.7"
version = "2.3.3"
projectName = "Nerd Fonts" So it should be re-fixed with version What do you use? Docker, zip-archive, ? |
|
I did not initiate a bugfix |
Thanks a lot for the quick reply @Finii 🙂 I got the patch script through the ZIP archive. How do I get |
@paldepind would be great if you could check this out 👍 Thanks to @b- (#1044) we have now not only a always-up-do-date docker image, but also a zip archive: https://github.com/ryanoasis/nerd-fonts/blob/-/FontPatcher.zip |
I just ran the script at version |
Sorry to hear that. Can you point me to the origin of the Comic Code Liga font? |
Hmm, you are on mac... It might be that the source font is one of the fonts with broken (i.e. contradicting) line spacing for windows and mac. If you can, maybe run https://github.com/source-foundry/font-line Can be installed via pip for example. |
You are not on Mac 🤦♀️ |
Yeah, I'm on linux (
|
Ah, yes. Different companies worked on the TrueType format, and they all had different ideas. That resulted in the baseline to baseline distance being encoded in 3 places. Apple's HHEA, Microsoft's WIN, and the newer TYPO.
Unfortunately the font you use has contradicting values. Different OS's and even applications use different line heights with that font. The one I tried is You could use |
Pardon me, but what is |
https://github.com/source-foundry/font-line Can be installed via pip for example.
Example usage |
I am was having similar problems. Here is my font-line report for the unpatched 'Comic Code Regular.otf'
I used this command on the unpatched files:
Then patched them with the docker container and the -c argument and it all looks okay now
Cheers for the pointer to font-line @Finii |
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference. |
[why] We just ignore specified gaps in the source fonts (i.e. set them to zero). This reduces the line spacing in the patched font (because the gap is missing). [how] Distribute the gap INTO the cell, so that we can work with zero gap (we need that for the powerline glyphs), and still keeping the powerline glyphs centered about the regular glyphs AND keeping the total line spacing. Idea-by: Tushar Singh <tusharvickey1999@gmail.com> Fixes: ryanoasis#850 Reported-by: Joe Bolts Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
🗹 Requirements
🎯 Subject of the issue
Experienced behavior:
After patching a font, the line height is reduced which makes
Expected behavior:
Line height should remain the same after patching.
Example symbols:
N/A
🔧 Your Setup
Anonymice Powerline Nerd Font Complete.ttf
)?Comic Code Regular Nerd Font Complete.otf
gnome-terminal
, Blackbox,gnome-text-editor
★ Screenshots (Optional)
Unpatched font:
Patched font:
The text was updated successfully, but these errors were encountered: