This repository show how to use Meslo Nerd Font in chrome OS terminal.
I got this method at Chrome / Chrome OS support · Issue #345 · ryanoasis/nerd-fonts (github.com)
If you want to use lunarvim or starship ... on your chromebook, you are supposed to use Nerd Font to correctly display icon&emoji.
tested on chrome 118.0.0.0
- open your terminal
- press
CTRL+SHIFT+J
- copy&run
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;}')
Now the terminal can display icon&emoji
- download your preferred fonts.
- upload it on a repository.(like this repo)
- edit 👇🏻
term_.prefs_.set('font-family', '<replace by font-family-name>');
term_.prefs_.set('user-css-text', '@font-face {font-family: "<replace by font=family-name>"; src: url("replace by font url"); font-weight: normal; font-style: normal;}')
for example:
replace 'github.com' with 'raw.githubusercontent.com' in https://github.com/ye-rm/MesloNerdFont-in-chrome-OS/blob/main/MesloLGMNerdFont-Regular.ttf then you got the font url.
To test the font url whether correct, you can paste it in your browser, then the font file can be downloaded.
To be done..