cseelus / monego

The beloved Monaco monospaced font, recreated with a bold and italic variant. Finally.
399 stars 36 forks source link

Fixed vertical aligment and underline alignment of nerd font #4

Closed matteematt closed 2 years ago

matteematt commented 2 years ago

Checking in the fonts that I have fixed #3

Before this PR the Font has an issue with vertical alignment of some symbols. Here are two images which show that issue. 156939449-f552c3a3-5824-4edc-b3b9-d122ade91db4 156939453-7112f2a6-8a21-4694-9886-11007cce24ca

On the yaml file the placeholder symbol for spaces are very obviously misalgined. So are the . and the # in the haskell file (but you can notice the issue with other symbols too). Once this fix is applied these same two files look like: 156939513-b59c0d6a-533e-479e-b5fc-2cb78a7ec613 156939516-4b484af5-6385-4ef1-bc9e-b4e852095a08

Once I was fixing the issue I noticed another issue - the underlining of the text didn't seem right, it was intersecting the text itself. See below 156940473-6f2add1b-a2a2-41b0-bf4f-cb0f3426b0dd I was able to fix this too, so now the text with underline looks like this

156940712-d4d58b79-401c-42be-8c78-34641878c80a

I have since been able to test the font on the following systems and it works fine for what I need:

Arch Linux + Alacritty MacOS + Alacritty + tmux MacOS + Iterm2

However, one think I have noticed is that if you use ligatures, they still have the alignment issue unfortunately. Screenshot 2022-03-07 at 07 45 44 The issue is with all of the ligatures but I think it is especially noticeable on the ... ligature

I personally don't use ligatures and from all my fixing yesterday I don't really know what to do to fix it. I don't know if it is worth merging this anyway and then if someone wants to take up the work to fix that in another PR then they can?

cseelus commented 2 years ago

Hi @matteematt,

great work that really does improve the Nerd Font version. I'm currently using/testing it at work in my Terminal and Editor :-)

There seems to be a problem with the ligatures though, especially with the ellipsis sign, as you correctly pointed out:

Before: Screen Shot 2022-03-07 at 14 23 58

After: Screen Shot 2022-03-07 at 14 24 16

I will try to created a version with reduced ligature width and upload it here.

Which tools did you use to fix the spacing and underlining issue? If you did it with just the Nerd Font tools, can use paste your config.json here, so it can be used for future updates?

matteematt commented 2 years ago

@cseelus Thanks for that, glad you are finding success with it! It is a shame about the ligatures, the ... looks even worse on your screenshot than on mine 😓

Unfortunately I didn't do it a nice programatically way that we can easily reproduce, though if I explain what I did then maybe it'll help you realise what you need to set with the config.json?

  1. Downloaded and installed fontforge
  2. Open the font in fontforge
  3. Select all and then vertically align them
  4. In the settings menu change the underline hint to -242, 141 (found those values looking at a font with underline that seemed to work)
  5. Export again as .otf
  6. Repeat for the other 4 variations
cseelus commented 2 years ago

@matteematt While testing the font, I found no problems so far, except for the Ligatures and some double wides, great work!

I wanted to reproduce the steps you describe, but Step 3 "Select all and then vertically align them" is a bit unclear to me. Can you describe in more detail?

matteematt commented 2 years ago

@cseelus Thanks, glad you're seeing success with it too!

Ok so when I open the font in fontforge it comes up with a gui that contains every symbolin the font. I select all (Ctrl-A or Cmd-A) and then right click on one of the symbols. On the dropdown menu that comes up there is an option for aligning the symbols

Let me know if that makes sense, if not I will try to get you some screenshots of what I mean

cseelus commented 2 years ago

Don't seem to have this option. I use the current version from Homebrew (Version 20220308), which one do you use?

Screen Shot 2022-03-19 at 21 51 05

matteematt commented 2 years ago

@cseelus Yeah sorry I was trying to remember the option off the top of my head. I have just double checked and the option you need is Center in Width

cseelus commented 2 years ago

Could reproduce it, looks fine, applied to the normal font (w/o Nerd Icons).

Still waiting for feedback from another user and another issue, but I've decided to merge your PR anyway, so your improvements to the font are generally available. Thanks again.

matteematt commented 2 years ago

@cseelus happy to help! At some point if I get time I'll try look into the ligatures issue

cseelus commented 2 years ago

❤️