nerd-fonts
nerd-fonts copied to clipboard
Iosevka font glyphs broken
🎯 Subject of the issue
I just downloaded Iosevka from the patched-fonts folder and I'm getting this weird glyph size. It's like they scaled incorrectly. It looks to me as if they were monospaced but without being centered. I'm trying to use the non-mono version, so I'm expecting glyphs to have double width.
🔧 Your Setup
-
Iosevka Nerd Font Complete Windows Compatible.ttf
)_ - Windows Terminal
- Windows11
★ Screenshots (Optional)
Glyphs
-
U_E34B
(different from report, but close enough ;) -
U_E714
-
U_F0E7
-
U_E0B6
Did not find this earth with moon ;) glyph
All glyphs in font are correct (wider than one advance width (500), because this is the non-mono font):
-
U_E34B
1240 -
U_E714
698 -
U_F0E7
500 -
U_E0B6
590
Although they are in an 'Ambiguous' range (https://github.com/microsoft/terminal/blob/main/src/types/CodepointWidthDetector.cpp#L246) Terminal rescales the glyphs as one-width.
I do not want to additionally also dive into Terminal's code :-( and why it thinks some glyphs have to be scaled down.
Will be fixed by a combination of
- #748
- https://github.com/ryanoasis/nerd-fonts/issues/731#issuecomment-1003071050
Maybe we should have a dedicated Issue for 'need non-mono with mono advance' (i.e. Nerd Font MonoBigIcons
) as a lot people want that and not the Nerd Font Mono
but Nerd Font (nonmono)
does not work for them.
And Nerd Font (nonmono)
used to be Nerd Font MonoBigIcons
... until this strangely nonreferenced and bad documented Arch Issue sigh
Forgot the image:
Created in this way:
$ git checkout feature/allow-downscaling-nonmono
$ echo move one line, see following diff
$ fontforge font-patcher --complete --windows src/unpatched-fonts/Iosevka/Regular/iosevka-regular.ttf
diff --git a/font-patcher b/font-patcher
index f9c17689..c73337cd 100755
--- a/font-patcher
+++ b/font-patcher
@@ -817,11 +817,11 @@ class font_patcher:
# also ensures the font is considered monospaced on Windows by setting the
# same width for all character glyphs. This needs to be done for all glyphs,
# even the ones that are empty and didn't go through the scaling operations.
- self.set_glyph_width_mono(self.sourceFont[currentSourceFontGlyph])
# Ensure after horizontal adjustments and centering that the glyph
# does not overlap the bearings (edges)
self.remove_glyph_neg_bearings(self.sourceFont[currentSourceFontGlyph])
+ self.set_glyph_width_mono(self.sourceFont[currentSourceFontGlyph])
# end for
All glyphs in font are correct (wider than one advance width (500), because this is the non-mono font):
....
U_E34B
1240U_E714
698U_F0E7
500U_E0B6
590Although they are in an 'Ambiguous' range (https://github.com/microsoft/terminal/blob/main/src/types/CodepointWidthDetector.cpp#L246) Terminal rescales the glyphs as one-width.
So the problem is in the windows terminal, not nerd fonts. Right?
Forgot the image:
Created in this way:
$ git checkout feature/allow-downscaling-nonmono $ echo move one line, see following diff $ fontforge font-patcher --complete --windows src/unpatched-fonts/Iosevka/Regular/iosevka-regular.ttf
diff --git a/font-patcher b/font-patcher index f9c17689..c73337cd 100755 --- a/font-patcher +++ b/font-patcher @@ -817,11 +817,11 @@ class font_patcher: # also ensures the font is considered monospaced on Windows by setting the # same width for all character glyphs. This needs to be done for all glyphs, # even the ones that are empty and didn't go through the scaling operations. - self.set_glyph_width_mono(self.sourceFont[currentSourceFontGlyph]) # Ensure after horizontal adjustments and centering that the glyph # does not overlap the bearings (edges) self.remove_glyph_neg_bearings(self.sourceFont[currentSourceFontGlyph]) + self.set_glyph_width_mono(self.sourceFont[currentSourceFontGlyph]) # end for
I tested patching with this branch and still got the same result. Maybe I'm missing something
The branch and additionaly edit font-patcher
like shown in the diff above?
i.e. move the line with set_glyph_wifth_mono()
behind remove_glyph_neg_bearings()
...
Worked like a charm. Thank you so much for your help.
I reopen this, because - although it is fixed for you - it is not in general, and I wanted to create a MR ;)
I hope that this already existing Bug Ticket arround this Font suites my problem:
OS: Win 11 Pro - Evaluation Copy - Build 2258.ni_release.220318-1623
I hope that this already existing Bug Ticket arround this Font suites my problem:
I guess #694 is your issues.
I fixed the bug in fontforge
but nerd-fonts
does not use the new ff
release yet. You need to self patch with a Match 2022 fontforge, or I need to upload a newly patched font set for you somewhere.
Eiter this or I am just fine with it :)
Sidenote: Maybe you can edit your script slightly so that it automaticly overwrites or not already existing fonts (PS Script for windows)
Please raise a (new) feature request / issue about the PS script; here it will be lost.
@kaykhancheckpoint Screenshot? Which OS and console / terminal application? Which font (filename) downloaded from where (link)? Some fixes are given above, tried any?
Facing the issue with latest 2.2 iosevka drop. Windows terminal on WIndows 11.
Facing the issue with latest 2.2 iosevka drop. Windows terminal on WIndows 11.
Could you provide a screenshot? And a screenshot of the settings?
Which of the many Iosevkas do you use?
Which version? 2.2.1?
I tried 2.2.1. The powerline symbols are better now, but still the glyphs are shown very small.
The Terminal with v 2.2.1:
Terminal with old 2.1 font.
but still the glyphs are shown very small.
See https://github.com/ryanoasis/nerd-fonts/issues/898
I do not know how Nerd Fonts should proceed here.
Thanks for quick update. Yes, looks like option 3 mentioned there would be needed for terminal. As there is a term variant of the font, can that variant use option 3?
Also, as there are varied requirements, maybe it would be better if there can be reference to patcher command line to be used for each of the use cases/terminals. Then we can easily patch the fonts as per need.
Ah, a good idea to make that a command line switch for font-patcher
. There is one for Mono
, but one can not decide between the other two. This would be a good first step :+1:
Implemented in v2.2.2
.
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.