Skip to content

Instantly share code, notes, and snippets.

@izzqz
Last active March 14, 2024 08:45
Show Gist options
  • Save izzqz/af36c5bbde67ffff0f7614cf738d75a5 to your computer and use it in GitHub Desktop.
Save izzqz/af36c5bbde67ffff0f7614cf738d75a5 to your computer and use it in GitHub Desktop.
How to setup JetBrains Mono Nerd Font with ligatures to use is inside crostini terminal #guide

Setup Nerd Fonts in Chrome OS terminal

⚠️ This seems outdated and does not work for the latest version of ChromeOS. But feel free to try.

Setup

Press Ctr + Shift + j to open devtools console in crostini terminal.

Paste this to use Jetbrais Mono with ligatures:

term_.prefs_.set('font-family', 'JetBrains Mono Nerd Font, monospace');
term_.prefs_.set('user-css-text', '@font-face {font-family: "JetBrains Mono Nerd Font"; src: url("https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/JetBrainsMono/Ligatures/Regular/JetBrainsMonoNerdFont-Regular.ttf)"); font-weight: normal; font-style: normal;} x-row {text-rendering: optimizeLegibility;font-variant-ligatures: normal;}')
  1. To change font, replace url path to raw .ttf file with your font in Nerd Fonts repository.
  2. To remove ligatures, delete x-row class in user-css-text parameter.
@izzqz
Copy link
Author

izzqz commented Jan 13, 2024

There's no need to tinker with an arcane series of hacks or open the inspect tool. Use Fontconfig. The Debian image comes preinstalled with all the fc-* tools. Just put your font files into ~/.local/share/fonts/ and setup the font config you want, globally or just for your linux user.

Currently AFAIK you can't use any fonts customization natively without development mode. So buying chromebook you are in powerline fonts jail. And you can use fonts only in linux apps inside crostini container, as you mention.

There's very old and staled Issue 320364 about font installation. Hopefully(hah), someone will bring it to life.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment