Skip to content

Instantly share code, notes, and snippets.

@sigoden
Created September 30, 2018 02:30
Show Gist options
  • Save sigoden/d01ad118da677f796bab01781b7eae23 to your computer and use it in GitHub Desktop.
Save sigoden/d01ad118da677f796bab01781b7eae23 to your computer and use it in GitHub Desktop.
wget -O /tmp/YaHei.Consolas.1.12.zip https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/uigroupcode/YaHei.Consolas.1.12.zip
unzip /tmp/YaHei.Consolas.1.12.zip
sudo mkdir -p /usr/share/fonts/consolas
sudo mv YaHei.Consolas.1.12.ttf /usr/share/fonts/consolas/
sudo chmod 644 /usr/share/fonts/consolas/YaHei.Consolas.1.12.ttf
cd /usr/share/fonts/consolas
sudo mkfontscale && sudo mkfontdir && sudo fc-cache -fv
@onatkarabulut
Copy link

Tested on Ubuntu 22.04.02 LTS
works perfectly!

@Preet-Sojitra
Copy link

How can I add this to Visual Studio Code.. "Consolas" is not working.

Try adding "YaHei Consolas Hybrid"

Worked even in 2023!! Thanks ❤️

@LarsHLunde
Copy link

LarsHLunde commented Nov 6, 2023

Fun fact, if you are on RHEL, Rocky, Fedora or Oracle Linux,
the same commands work as long as you run :
sudo yum install xorg-x11-font-utils

@Fabxx
Copy link

Fabxx commented Dec 31, 2023

How do i apply this on xfce4-terminal? the terminal only shows fc-list :mono fonts

@siposm
Copy link

siposm commented Mar 8, 2024

Working is confirmed on Ubuntu 22.04 LTS
VSCode should have 'YaHei Consolas Hybrid' not 'consolas' as font setting.

@YugandharrPatil
Copy link

the tilde character looks bad :( switched off because of it...
not the same in the regular consolas font though.

@edgar1437
Copy link

Works perfectly fine on Ubuntu 22.04 LTS. Thanks a lot!

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