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

fl/fi Ligatures always appearing in patched Monaco font

Open timoxley opened this issue 6 years ago • 41 comments

I've even tried editing the patch script to remove all lookup tables, yet the damn ligatures continue to persist.

i.e.

  for table in sourceFont.gsub_lookups:
      symfont.removeLookup(table)

Any ideas on what's going on? I'm guessing there's some default ligature setting being inherited? Is there a way to turn that off in the generated font?

Turning off set macligatures in vim is my temporary workaround.

timoxley avatar Apr 01 '18 11:04 timoxley

@timoxley Hey sorry not that I know of.

The ligatures are present in the source font pre-patching right?

What is the name of the tables that get removed in the iteration?

By the way the font-patcher is setup with the ability to remove subtables (but not tables) via --removeligatures in conjunction with --configfile [json like config file]

config example: https://github.com/ryanoasis/nerd-fonts/blob/master/src/unpatched-fonts/Meslo/config.json

ryanoasis avatar Apr 01 '18 12:04 ryanoasis

The ligatures are present in the source font pre-patching right?

@ryanoasis There are some lookup tables in the font, but the ligatures seem to be disabled when using the font. The ligatures only appear when using the font after patching, even after removing all tables.

What is the name of the tables that get removed in the iteration?

'rtla' Right to Left Alternates lookup 0
<27,0> Canonical Decomposition in Latin lookup 1
<27,0> Canonical Decomposition lookup 2
<27,0> Canonical Decomposition lookup 3
<27,0> Canonical Decomposition in Latin lookup 4
<1,2> Common Ligatures in Latin lookup 5
<27,2>  in Latin lookup 6
<27,0> Canonical Decomposition lookup 7

The same tables appear after generating the font using unmodified font-patcher.

font-patcher is setup with the ability to remove subtables

Yep, I tried this first, but it didn't seem to have any effect, hence trying a nuclear "remove all tables" option.

timoxley avatar Apr 02 '18 08:04 timoxley

@timoxley Thanks for the details :+1: , that is strange. I would like to take a look but I cannot tell you when that'll be :sweat:

ryanoasis avatar Apr 03 '18 02:04 ryanoasis

@ryanoasis

No action required on your part, was hoping it would be something you knew off the top of your head.

Oh, also note that when I first patched the font using --complete, the fi and fl ligatures were remapped – one became an icon for a telephone. This was an entertaining surprise when I discovered it in my editor.

Source Font Monaco

image

After font-patcher --mono --powerline --fontawesome --powerlineextra

image

After font-patcher --mono --complete

image

🥇

Examining the lookup table via FontForge seems to reveal the issue:

image

timoxley avatar Apr 03 '18 09:04 timoxley

I have been having the problem with the phone symbol and such as well using the AUR nerd-fonts-complete package. Is there a way to get around this problem without patching all of the fonts by hand?

sirplatypos avatar Jul 20 '18 19:07 sirplatypos

@sirplatypos I just live with the phones

timoxley avatar Jul 21 '18 05:07 timoxley

I fixed the problem for myself by removing the subtable that replace the characters with the ligatures. It had been set to replace the normal ff and such with the phone, the priority low symbol, etc. If you're still having the problem, get font forge and remove the ligature subtable.

sirplatypos avatar Jul 21 '18 19:07 sirplatypos

ubuntu-regular.zip This is ubuntu nerd font regular with the table removed, in case anybody wants it. I don't know how many other fonts have this issue. The symbols in this file were replaced by the ligatures from the regular ubuntu font, so it is missing the phone and such. The problem is that despite the ubuntu font having the ligatures, whoever patched the font removed the ligatures and replaced them with other symbols.

Please fix this problem upstream, by either removing the ligature subtables, or preferably by putting the ligatures originally present in the font back and then placing the other symbols somewhere else.

sirplatypos avatar Jul 21 '18 19:07 sirplatypos

+1 hving the same problem with Ubuntu font

ykyuen avatar Sep 27 '18 13:09 ykyuen

I'm having the same problem with monaco font... and as @sirplatypos did I just remove the ligatures with fontforge and that is. I don't know if I've broken anything in the process but I hope I didn't. No more phones ☎️ .

luispuerto avatar Oct 03 '18 07:10 luispuerto

I'm having this problem also using the latest version of the Arch linux AUR package nerd-fonts-complete. In my case I'm using the "NotoSerif NerdFont". Here's an example:

image

It's sufficiently annoying that I'm about to revert back to the regular Noto font family and use the NerdFont version only in the terminal. Before I do that does anyone have a workaround (or better yet, a fix), other than manually editing the font in FontForge?

anelson avatar Mar 25 '19 14:03 anelson

The Ubuntu Condensed font also has this problem.

stellarhoof avatar Mar 28 '19 01:03 stellarhoof

Sorry for the late reply, yeah I think the real solution will involve not clobbering the ligatures but that will involve moving some of the codepoints of some glyphs. That would probably result in a 3.0 release (breaking change).

There is another workaround worth mentioning (if one patches themselves). that is using the --careful flag. That will ensure existing glyphs don't get clobbered, for example:

left: original font center: straight up patch right: patch with the --careful flag VictorMono-Regular-patching-comparisons

Ref: https://github.com/ryanoasis/nerd-fonts/issues/57#issuecomment-515654441

ryanoasis avatar Aug 02 '19 02:08 ryanoasis

In the mean time, is there any chance of getting sirplatypos's fixed version of Ubuntu on the readme list or releases page for easy discoverability, or do we not want that as an official version since it's missing some glyphs?

adinklotz avatar Aug 21 '19 19:08 adinklotz

@ryanoasis's solution isn't entirely complete (though this might be related to terminal). Using "Share Tech Mono", the ligature overlaps with the next character:

image ^^ This flaflofle

Note this is on Konsole 2.14.2, which is fairly old. Edit: This also occurs on Konsole 19.08.2, which is much newer

Edit2: Just to confirm, removing the fi and fl ligatures from the font via FontForge fixes the issue for both Konsole 2.14.2 and 19.08.2

jrwrigh avatar Nov 06 '19 20:11 jrwrigh

Also having this problem with the downloaded version of Inconsolata Nerd Fonts Mono

revarcline avatar Dec 27 '19 06:12 revarcline

has there been any progress? I don't know much about fonts so I don't really know how to :phone:x it for myself and the telephones are very annoying...

PonasKovas avatar May 10 '20 12:05 PonasKovas

@PonasKovas eventually you'll learn to love the telephones and it will look wrong to not have them. In these trying times, it's imperative to be able to ☎nd ways to accept things for what they are and move on, always better and stronger.

timoxley avatar May 10 '20 15:05 timoxley

@PonasKovas It's a fairly easy manual fix that I briefly mentioned in my second edit here. You essentially:

  1. Open the font in font forge
  2. Find the offending characters (fb01 and fb02)
  3. Delete the offending characters
  4. Save the font

I had no experience in working with fonts before I did this and it didn't take too long.

jrwrigh avatar May 10 '20 17:05 jrwrigh

Same issue with Inconsolata Nerd Font from the AUR package

demfabris avatar May 12 '20 14:05 demfabris

@PonasKovas It's a fairly easy manual fix that I briefly mentioned in my second edit here. You essentially:

  1. Open the font in font forge
  2. Find the offending characters (fb01 and fb02)
  3. Delete the offending characters
  4. Save the font

I had no experience in working with fonts before I did this and it didn't take too long.

im trying to do that but the font breaks when exporting.. how do i save it properly?

demfabris avatar May 18 '20 06:05 demfabris

im trying to do that but the font breaks when exporting.. how do i save it properly?

Just went through this process.. Find the ligatures and clear the ones you don't want then File>Generate fonts>Choose the font type (ttf or CFF (which is OTF)) and leave all the options alone.

Don't know if it matters but they suggest running it as administrator

0xRainy avatar Jun 25 '20 06:06 0xRainy

Clearing these glyphs actually introduce a new character overlapping bug. Now triple equal sign glyph ('===') is eating following characters and the whole line of text becomes wierd.

demfabris avatar Jul 17 '20 17:07 demfabris

Ring, ring... Also happening with Overpass.. any progress on this besides patching it myself?

pinpox avatar Jan 04 '21 14:01 pinpox

Is there a fork with the fixed fonts for someone who doesn't want to patch manually?

ibraheemdev avatar Mar 18 '21 12:03 ibraheemdev

Having the same phone problem on NixOS. I personally do not like the phones. fi

stelcodes avatar May 17 '21 18:05 stelcodes

I just ended up using the non-patched font as main font and defining the patched one as fallback in my terminal emulator. But I have since moved to a different font as I was starting to get bad dreams about ringing phones. I just stay subscribed to the issue because it makes me laugh every time I get a notification.

pinpox avatar May 18 '21 11:05 pinpox

I just ended up using the non-patched font as main font and defining the patched one as fallback in my terminal emulator

That's a great idea! Didn't think about that one...

jef avatar Jun 25 '21 17:06 jef

~I had several different font versions floating around and solved the problem by flushing the font caches and reinstalling the latest version.~

arminbw avatar Dec 09 '21 18:12 arminbw

It's been a long time but I think I've got a better solution now.

Comment with screenshots here: https://github.com/ryanoasis/nerd-fonts/issues/509#issuecomment-992141907

ryanoasis avatar Dec 13 '21 06:12 ryanoasis