-
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
Hack characters stretched when font size is <= 11 #612
Comments
I have the same exact issue too. It seem that the patched fonts size is actually 11.5 instead of 11. |
Also strange, why does the Nerd Font show up as 'Regular' 'Bold' etc in the chooser and the original Hack isn't? |
It is indeed strange that When recording my original gif, I probably had other original Hack variants deleted to make animation easier. |
Let me search for a 'new' Hack Nerd Font that you could try... I believe I have some in a branch. |
Could it be DPI related? |
Btw, did you use the original Hack from this repo? i.e. https://github.com/ryanoasis/nerd-fonts/blob/master/src/unpatched-fonts/Hack/Regular/Hack-Regular.ttf If you have a different original version that could also be an explanation. So I installed that file (in this comment, top) and the patched one I put here: Maybe you want to compare these two. These are exactly the files I used. |
Yes the original I tried with the one you linked, and issue is exactly the same. Attaching output of font-manager's font-viewer:
I vaguely remember trying to repatch these myself, but just getting Hack through font-forge was enough to mess them up, so I eventually gave up. |
It's strange that you don't see this issue. Also, the patched fonts from this repo built in recent days do not work for me at all, probably something's wrong with them. |
Maybe try if greyscale antialising fixes this? Could be that the subpixel LCD antialising assumes the wrong colour sequence? The the antialising would make it worse not better. In former times there was a way to select the colour sequence? Hmm. |
Yes, hinting it is! |
It is the head.flags:
If I force it to be 6 in the generated font, the Issue is gone. diff --git a/fontforge/tottf.c b/fontforge/tottf.c
index 811711e67..dbfd1bc6d 100644
--- a/fontforge/tottf.c
+++ b/fontforge/tottf.c
@@ -3565,7 +3565,7 @@ static void redohead(struct alltabs *at) {
putlong(at->headf,at->head.revision);
putlong(at->headf,at->head.checksumAdj);
putlong(at->headf,at->head.magicNum);
- putshort(at->headf,at->head.flags);
+ putshort(at->headf, 6);
putshort(at->headf,at->head.emunits);
putlong(at->headf,at->head.createtime[1]);
putlong(at->headf,at->head.createtime[0]); Let's see how we can influence the flags in an official way ;-) |
Maybe something like this? from fontTools import ttLib
originalTTF = ttLib.TTFont("Hack-Regular.ttf")
patchedTTF = ttLib.TTFont("Hack Regular Nerd Font Complete.ttf")
patchedTTF['head'].flags = originalTTF['head'].flags
patchedTTF.save("Hack Regular Nerd Font Complete Fixed.ttf") |
Yes, almost. And we also need to copy the Rather something like this ;) source = TableHEADWriter(sys.argv[1])
source.calc_table_checksum(True)
source.close()
dest = TableHEADWriter(sys.argv[2])
dest.calc_table_checksum(True)
dest.calc_full_checksum(True)
if source.flags & 0x08 == 0 and dest.flags & 0x08 != 0:
print("Changing flags from 0x{:X} to 0x{:X}".format(dest.flags, dest.flags & ~0x08))
dest.putshort(dest.flags & ~0x08, 'flags') # clear 'ppem_to_int'
if source.lowppem != dest.lowppem:
print("Changing lowestRecPPEM from {} to {}".format(dest.lowppem, source.lowppem))
dest.putshort(source.lowppem, 'lowestRecPPEM')
if dest.modified:
print("Correcting checksums")
dest.reset_table_checksum()
dest.reset_full_checksum()
else:
print("Nothing to be done")
dest.close() Where After the holdidays today normal work begun so time dwindles away... 🙄 |
Autoclosing by the PR #761 did not work, doing manually now. |
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. |
🎯 Subject of the issue
When font size is below or equal to 11 the patched
Hack
font is stretched and noticeably differs from original font.Happens in terminals and native (probably gtk) font picker, but not in
libre-office
🔧 Your Setup
Hack Regular Nerd Font Complete.ttf
xfce4-terminal
andtilda
★ Optional
I attach a gif displaying this behavior:
Thanks!
The text was updated successfully, but these errors were encountered: