-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 Font too high compared to other terminals #7596
Comments
after you read this, see #7596 (comment) for a bit more information. I don't necessarily think Hack is incorrect. I'm keeping the original comment body for posterity. This is an unfortunate result of the way the Hack font is authored. There was, for a long time, a divide in font rendering technology on Windows and other platforms. Because of this, fonts had separate fields for "how big is a character?" on Windows and all other platforms. That disparity was fixed in approximately 2009 when Windows 7 shipped with DirectWrite, our modern font rendering technology. Because of that, the "Windows" measurements are considered legacy. Unfortunately, the Hack font contains the following measurements and flags:
Following the legacy measurements, a single cell in this font is 2384 units tall. Following the modern measurements, it is 2048 units tall. WT uses DirectWrite, which has a strict interpretation of this flag. It is following the legacy measurements because the font told it to. mintty's renderer seems to be behaving out-of-spec:
Emphasis mine. The line measurer in use in mintty appears to be disregarding the discouragement and it results in a tighter line spacing than it should. It looks like gvim also "follows the rules"; the line spacing matches Terminal, even though gvim uses GDI (legacy) for measurement: |
I had accidentally returned my font to Cascadia Code and tried to measure again. Hack is working as in my screenshot. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
This seems to be a miss-configuration of the font itself. I've opened an issue, but the project seems rather inactive at the moment. I'd welcome an option (maybe as temporary workaround) to switch the rendering engine to use legacy measurement --- similar to the way mintty handles it. However, I fully understand that this may not be technically feasible or desired by the devs as it is basically a hack. |
So, this might not work. If you want to give it a shot, it should result in a version of Hack named prerequisitesInstall fonttools (in WSL)
Move to a folder that contains steps
Here's what it looks line in my terminal. (before on the left, after on the right) This modification comes with no warranty; the font is MIT-licensed and does not appear to have a RFN; if it blows up in other applications, consider yourself warned. |
For our side, I'm gonna close this as a /duplicate of #3498. I'm no longer certain it's the font that's wrong. That "line gap" value actually makes it render exactly the same in [legacy] mode as it does in [modern] mode. An application that is ignoring the "line gap" value is, to a rough first approximation, incorrect. I do think it should be configurable, though. |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
Thank you for describing how to patch the font. |
Environment
Steps to reproduce
Use Hack font (size 10) in Windows Terminal and wsl-terminal and compare them side-by-side.
Expected behavior
Content of both terminals should look identical.
Actual behavior
The font seems to be out of proportion in Windows Terminal.
The following screenshot compares them side by side.
Here wsl-terminal's transparency setting is set to high and wsl-terminal was moved right over Windows Terminal for better comparison. In Windows Terminal, the characters are taller while having the same width.
The text was updated successfully, but these errors were encountered: