Search code examples
fontsgoogle-chrome-oschromebook

Nerd Fonts not working correctly on ChromeOS terminal


I've been following along chris@machine's YouTube tutorial for NeoVim. In episode 6 "Neovim - Completion Tutorial 100% Lua" he showed some custom kind icons.
enter image description here

But for me it looked like this instead:
enter image description here

So I searched the web and came across this code snippet:

term_.prefs_.set('font-family', '"FiraCode Nerd Font", monospace');
term_.prefs_.set('user-css', 'https://mshaugh.github.io/nerdfont-webfonts/build/firacode-nerd-font.css');

So I pasted it into the terminal that popped up when I entered Ctrl+Shift+J and it added the icons. Well almost... You see it added half of the icons:
enter image description here

So I searched the internet for results in over 2 hours but I found nothing for my specific situation. I've tried switching fonts but nothing seems to work. It's a bit tricky because I am doing all this on a Chromebook so it is very poorly documented. But as I understand it, the ChromeOS terminal can be customized with simple web HTML/CSS/JS. So I tried to search for NerdFonts in web context but nothing.

I even tried specifying the specific unicode ranges for the fonts.

term_.prefs_.set('font-family', 'MesloLGM Nerd Font');
term_.prefs_.set('user-css-text', '@font-face {font-family: "MesloLGM Nerd Font"; src: url("https://raw.githubusercontent.com/ye-rm/MesloNerdFont-in-chrome-OS/main/MesloLGMNerdFont-Regular.ttf"); font-weight: normal; font-style: normal; unicode-range: U+23fb-23fe, U+2665, U+26a1, U+2b58, U+e000-e00a, U+e0a0-e0a2, U+e0a3, U+e0b0-e0b3, U+e0b4-e0c8, U+e0ca, U+e0cc-e0d4, U+e200-e2a9, U+e300-e3e3, U+e5fa-e6b1, U+e5fa-e6b1, U+e700-e7c5, U+ea60-ebeb, U+f000-f2e0, U+f300-f372, U+f400-f532, U+f500-fd46, U+f0001-f1f0;}');

(observate above I am using another snippet that "half-worked")

Any help appreciated.


Solution

  • Today I logged into my computer and I opened NeoVim, turns out now all my kinds show correctly. I don't know how this happened, I don't know what caused the initial problem. All I know is that chromebooks tend to be buggy.
    enter image description here