nerd-fonts icon indicating copy to clipboard operation
nerd-fonts copied to clipboard

Iosevka font glyphs broken

Open jmederosalvarado opened this issue 2 years ago • 14 comments

🎯 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)

Screenshot (44) Screenshot (45)

jmederosalvarado avatar Jan 06 '22 21:01 jmederosalvarado

Glyphs

  • U_E34B  (different from report, but close enough ;)
  • U_E714
  • U_F0E7
  • U_E0B6

Did not find this earth with moon ;) glyph

image

All glyphs in font are correct (wider than one advance width (500), because this is the non-mono font):

image

  • 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.

Finii avatar Jan 07 '22 09:01 Finii

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

Finii avatar Jan 07 '22 09:01 Finii

Forgot the image:

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
 

Finii avatar Jan 07 '22 09:01 Finii

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.

So the problem is in the windows terminal, not nerd fonts. Right?

jmederosalvarado avatar Jan 08 '22 13:01 jmederosalvarado

Forgot the image:

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

jmederosalvarado avatar Jan 08 '22 13:01 jmederosalvarado

The branch and additionaly edit font-patcher like shown in the diff above?

Finii avatar Jan 08 '22 15:01 Finii

i.e. move the line with set_glyph_wifth_mono() behind remove_glyph_neg_bearings()...

Finii avatar Jan 08 '22 15:01 Finii

Worked like a charm. Thank you so much for your help.

jmederosalvarado avatar Jan 08 '22 21:01 jmederosalvarado

I reopen this, because - although it is fixed for you - it is not in general, and I wanted to create a MR ;)

Finii avatar Jan 09 '22 05:01 Finii

I hope that this already existing Bug Ticket arround this Font suites my problem:

image image image

OS: Win 11 Pro - Evaluation Copy - Build 2258.ni_release.220318-1623

Chaoschaot232 avatar Apr 03 '22 14:04 Chaoschaot232

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.

Finii avatar Apr 03 '22 14:04 Finii

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)

Chaoschaot232 avatar Apr 03 '22 14:04 Chaoschaot232

Please raise a (new) feature request / issue about the PS script; here it will be lost.

Finii avatar Apr 03 '22 14:04 Finii

@kaykhancheckpoint Screenshot? Which OS and console / terminal application? Which font (filename) downloaded from where (link)? Some fixes are given above, tried any?

Finii avatar May 01 '22 14:05 Finii

Facing the issue with latest 2.2 iosevka drop. Windows terminal on WIndows 11.

saumyajyoti avatar Aug 29 '22 05:08 saumyajyoti

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?

Finii avatar Aug 29 '22 06:08 Finii

image I tried 2.2.1. The powerline symbols are better now, but still the glyphs are shown very small. image

The Terminal with v 2.2.1: image

Terminal with old 2.1 font. image

saumyajyoti avatar Aug 29 '22 12:08 saumyajyoti

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.

Finii avatar Aug 29 '22 12:08 Finii

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?

saumyajyoti avatar Aug 29 '22 12:08 saumyajyoti

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.

saumyajyoti avatar Aug 29 '22 12:08 saumyajyoti

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:

Finii avatar Aug 29 '22 13:08 Finii

Implemented in v2.2.2.

Finii avatar Sep 07 '22 06:09 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.

github-actions[bot] avatar Mar 12 '23 22:03 github-actions[bot]