Skip to content

show how to use Nerd Fonts in chromebook, how can terminal on chromebook display icons&emoji.(即如何让你的chromebook终端用上nerd font)

Notifications You must be signed in to change notification settings

ye-rm/Use-Meslo-Nerd-Font-on-chromebook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 

Repository files navigation

MesloNerdFont-in-chrome-OS

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

  1. open your terminal
  2. pressCTRL+SHIFT+J
  3. 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;}')

image-20231115131624887

Now the terminal can display icon&emoji

image-20231115131343510

How to use other Nerd Fonts?

  1. download your preferred fonts.
  2. upload it on a repository.(like this repo)
  3. 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:

image-20231115133020747

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.

How to config Nerd Font in visual studio code(vscode) on chromebook.

To be done..

About

show how to use Nerd Fonts in chromebook, how can terminal on chromebook display icons&emoji.(即如何让你的chromebook终端用上nerd font)

Resources

Stars

Watchers

Forks