Skip to content
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

Iosevka font glyphs broken #754

Closed
jmederosalvarado opened this issue Jan 6, 2022 · 23 comments
Closed

Iosevka font glyphs broken #754

jmederosalvarado opened this issue Jan 6, 2022 · 23 comments

Comments

@jmederosalvarado
Copy link

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

@Finii
Copy link
Collaborator

Finii commented Jan 7, 2022

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
Copy link
Collaborator

Finii commented Jan 7, 2022

Will be fixed by a combination of

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
Copy link
Collaborator

Finii commented Jan 7, 2022

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
 

@jmederosalvarado
Copy link
Author

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
Copy link
Author

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

@Finii
Copy link
Collaborator

Finii commented Jan 8, 2022

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

@Finii
Copy link
Collaborator

Finii commented Jan 8, 2022

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

@jmederosalvarado
Copy link
Author

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

@Finii
Copy link
Collaborator

Finii commented Jan 9, 2022

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

@Chaoschaot232
Copy link

Chaoschaot232 commented Apr 3, 2022

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

@Finii
Copy link
Collaborator

Finii commented Apr 3, 2022

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.

@Chaoschaot232
Copy link

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)

@Finii
Copy link
Collaborator

Finii commented Apr 3, 2022

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

@Finii
Copy link
Collaborator

Finii commented May 1, 2022

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

@saumyajyoti
Copy link

saumyajyoti commented Aug 29, 2022

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

@Finii
Copy link
Collaborator

Finii commented Aug 29, 2022

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?

@saumyajyoti
Copy link

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

@Finii
Copy link
Collaborator

Finii commented Aug 29, 2022

but still the glyphs are shown very small.

See #898

I do not know how Nerd Fonts should proceed here.

@saumyajyoti
Copy link

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
Copy link

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.

@Finii
Copy link
Collaborator

Finii commented Aug 29, 2022

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 👍

@Finii
Copy link
Collaborator

Finii commented Sep 7, 2022

Implemented in v2.2.2.

@Finii Finii closed this as completed Sep 7, 2022
@github-actions
Copy link
Contributor

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 github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants