microsoft / cascadia-code

This is a fun, new monospaced font that includes programming ligatures and is designed to enhance the modern look and feel of the Windows Terminal.
Other
25.75k stars 804 forks source link

does cascadia code support nerd fonts icons? #612

Closed bryant-the-coder closed 2 years ago

bryant-the-coder commented 2 years ago

hi there. the title says it all... does it supports nerd fonts icons? cause windows terminal tends to not render italics properly in neovim. how can i solve that?

mfocko commented 2 years ago

I patch the latest Cascadia Code with Nerd Font patcher and it seems to work fine

bryant-the-coder commented 2 years ago

will try thx

bryant-the-coder commented 2 years ago

it does not work image image

mfocko commented 2 years ago

are you sure that you're using the patched font? cause I don't have any problems with that…

btw the name of the font changes

„Cascadia Code“ → „CaskaydiaCove Nerd Font“

and the basename is without spaces, e.g. PL version of Cascadia becomes: CaskaydiaCovePL

(Cascadia Mono without ligatures, doesn't change to caskaydia, not sure why, but I also may have an old version of patcher)

bryant-the-coder commented 2 years ago

send me the download link please

gusbemacbe commented 2 years ago

send me the download link please

Go to https://github.com/ryanoasis/nerd-fonts, go to the folder patched-fonts and go to CascadiaCode.

bryant-the-coder commented 2 years ago

btw how to enable font ligatures in windows terminal? italics too

gusbemacbe commented 2 years ago

You need to take the non-mono and non-Windows-compatible fonts:

Take:

@ryanoasis of Nerd Fonts do not patch the italic fonts, but I can patch for you. Please wait that I am going to patch.

bryant-the-coder commented 2 years ago

y otf instead of ttf?

gusbemacbe commented 2 years ago

Yes, I am patching the OTF Code (not Mono) and Code PL fonts.

bryant-the-coder commented 2 years ago

ok... so should i download the zip from @ryanoasis ?

gusbemacbe commented 2 years ago

Yes, but it does not come with italic fonts you want. I finished the patcher. I'll send the compressed file to you here.

gusbemacbe commented 2 years ago

Ready. Get patched-fonts.zip.

bryant-the-coder commented 2 years ago

how do u patch it?

bryant-the-coder commented 2 years ago

i dun think it really work with some stuff. image

bryant-the-coder commented 2 years ago

only caskaydiacove nerd font renders everything properly... but the words to shiny lol

gusbemacbe commented 2 years ago

You need to have Docker installed.

  1. Pull @ryanoasis' original image from :

    docker pull nerdfonts/patcher
  2. Create a folder where you want to save the original fonts and a subfolder where you'll save the patched fonts. See like (observe that I am a Linux user, if you are a Windows user, you may use WSL or PowerShell):

    docker run --rm -v '$HOME/.local/share/fonts/Cascadia Code':/in -v '$HOME/.local/share/fonts/Cascadia Code/patched':/out nerdfonts/patcher -c --careful
bryant-the-coder commented 2 years ago

y need docker?

gusbemacbe commented 2 years ago

only caskaydiacove nerd font renders everything properly... but the words to shiny lol

If you find too shiny, you need to change the ANSI codes and colours. I never tried to modify it in Neovim at PowerShell. Maybe you should ask Neovim forum.

y need docker?

Yes, you can get Docker from https://docs.docker.com/get-docker/. It is totally free and easy.

bryant-the-coder commented 2 years ago

i know y i need to use docker?

gusbemacbe commented 2 years ago

i know y i need to use docker?

Yes, because these commands, I gave you, depend on Docker. If you have WSL installed, you can install quick Docker and run the commands normally.

If you do not want to install Docker for Windows or on WSL, you need to download @ryanoasis' repository and run the font-patcher file. But it needs to run on WSL because it is a Shell script. You also need to install FontForge.

If you do not want to install a lot of stuff, you can use just Docker. It is lightweight, and you are not forced to download his repository and FontForge. Docker already has and does it.

After, you can uninstall Docker if you want.

bryant-the-coder commented 2 years ago

can u show me how? newbie lol

gusbemacbe commented 2 years ago

Do you have WSL installed? If no, you can get the small and quick command. Open PowerShell as administrator and run the only command:

wsl --install

It will enable WSL and its features, then it will install automatically Ubuntu. Restart your PC. Ubuntu will open itself and will ask you to create your Unix user and password. Your Windows Terminal will add automatically Ubuntu to the list.

After that, run the commands at WSL at Windows Terminal:

# It will update and upgrade Ubuntu system
sudo apt update && sudo apt upgrade

# Install some tools for Docker
sudo apt install apt-transport-https ca-certificates curl gnupg software-properties-common

# Add Docker's GPG to be authorised by Ubuntu
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# As the Ubuntu version is 20.04 as WSL chose automatically
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"

# It will update to detect new packages as Docker
sudo apt update

# Set Docker's repo as default instead of Ubuntu's repo
apt-cache policy docker-ce

# Finally, you can install Docker
sudo apt install docker-ce

# But you need to start Docker before running those commands I gave you. Verify if the dot is green. 
sudo systemctl status docker

# To run Docker without sudo to run the commands normally
sudo usermod -aG docker ${USER}

Ready, you can run those Nerd Fonts' font-patcher commands I gave below.

bryant-the-coder commented 2 years ago

i dun have wsl :(

bryant-the-coder commented 2 years ago

can u teach me how u patch those fonts?

gusbemacbe commented 2 years ago

If you do not have WSL, you can download and install a Windows version of Docker: https://docs.docker.com/desktop/windows/install/

  1. Install Docker.
  2. Restart your PC.
  3. Start Docker.

Choose any original monospaced fonts, including Cascadia Code.

Now open Windows Terminal and select PowerShell:

  1. Create a folder and a subfolder:
mkdir -p ~/fonts/patched
  1. Move the original fonts you picked to the ~/fonts. If you do not know where the folder fonts is in Explorer, then run the command:
explorer.exe .
  1. Pull the image:
docker pull nerdfonts/patcher
  1. Now run the commands:
docker run --rm -v ~/fonts/:/in -v ~/fonts/patched:/out nerdfonts/patcher -c --careful

It will begin to patch the fonts. It may take a lot of time. Once concluded patch, run the command:

cd ~/fonts/pacthed && explorer.exe .

Voilà!

bryant-the-coder commented 2 years ago

it will install all font? but i want fonts that supports italics and icons. sorry if i m kinda annoying :((

gusbemacbe commented 2 years ago

it will install all font? but i want fonts that supports italics and icons. sorry if i m kinda annoying :((

It will not install automatically the fonts into Windows fonts. You who will install manually the fonts. It only will create the fonts, patching all Nerd Fonts icons. It also will create the italic version of those fonts, with all Nerd Fonts icon.

But do not waste time. I have already patched for you. Get that zipped file I sent below. It came with the italic fonts, you can see:

image

It is an italic font. It also came with Nerd Fonts icons:

image

bryant-the-coder commented 2 years ago

wait how u edit those fonts? curious

gusbemacbe commented 2 years ago

wait how u edit those fonts? curious

I patched all the fonts with Nerd Fonts' font-patcher. I have already taught you those commands. Remember that last command patches ALL the fonts, including the italic fonts, with ALL Nerd Fonts icons. It was exactly what you asked.

If you mean this second image to view the font, I use the extension Font Preview on VSCode.

bryant-the-coder commented 2 years ago

If you do not have WSL, you can download and install a Windows version of Docker: https://docs.docker.com/desktop/windows/install/

  1. Install Docker.
  2. Restart your PC.
  3. Start Docker.

Choose any original monospaced fonts, including Cascadia Code.

Now open Windows Terminal and select PowerShell:

  1. Create a folder and a subfolder:
mkdir -p ~/fonts/patched
  1. Move the original fonts you picked to the ~/fonts. If you do not know where the folder fonts is in Explorer, then run the command:
explorer.exe .
  1. Pull the image:
docker pull nerdfonts/patcher
  1. Now run the commands:
docker run --rm -v ~/fonts/:/in -v ~/fonts/patched:/out nerdfonts/patcher -c --careful

It will begin to patch the fonts. It may take a lot of time. Once concluded patch, run the command:

cd ~/fonts/pacthed && explorer.exe .

Voilà!

i wanna ask. this will patch including italics? i wanna patch agave as i found it working just fine for me

bryant-the-coder commented 2 years ago

what is the original fonts u picked? the folder and subfolder can be created at anywhere?

kinda hard to understand lol. mayb a recording might help as i m a visual learner

gusbemacbe commented 2 years ago

i wanna ask. this will patch including italics? i wanna patch agave as i found it working just fine for me

Yes, this will. It always will patch everything IN A FOLDER.

what is the original fonts u picked?

I picked from this repo. You can check the releases list at this repo: https://github.com/microsoft/cascadia-code/releases/. In the zipped file, you find the sub folder otf you may want. Unzip only Code and Code PL, but do not unzip the Mono versions as you want the ligatures that are available only in the Code and Code PL versions.

the folder and subfolder can be created at anywhere?

Yes, and remember to change the path in those commands that I gave you.

kinda hard to understand lol. mayb a recording might help as i m a visual learner

Well, I am a Linux user. I do not use Windows. But I can boot into Windows to record how I do if you want.

bryant-the-coder commented 2 years ago

u can boot to windows. i m not really an intermediate or an expert

bryant-the-coder commented 2 years ago

(◡ ω ◡)

gusbemacbe commented 2 years ago

Hello.

Sorry, I had to update Windows because the terminal did not work. I did not update it for months. But I recorded. I posted the GIF images here. If you prefer watching and pausing the videos, I'll send you the compressed files at the end.

  1. I download and install Docker. I must restart:

1 - Downloading and installing Docker

  1. After restarting the computer, Docker will start itself and I may set a bit:

2 - Setting Docker

  1. After closing Docker, I open the Windows Explorer and go to the Downloads folder, where I'll create a new Fonts. After I am going to GitHub page and Microsoft repository, in which I click the releases list. I download it and place on the folder Fonts. I chose only 4 fonts because the font patcher will take a bit of time. I created the subfolder patched:

3 - Downloading fonts and creating folders

  1. Open Windows Terminal, with the mouse right click to select PowerShell. On PowerShell, I am going to pull the image from Docker, and after I copy and paste the command, and change the paths that appoints to the folder Fonts that I created at the folderDownloads`. Then I begin to patch. It may take a lot of time:

4 - Pulling the images from Docker and patching the fonts

Finally, voilà.

If you prefer watching and pausing the videos, here is the compressed file of videos: Videos.zip

bryant-the-coder commented 2 years ago

i will try. if i got any problem i will get back to u. is there any easier way to contact u?

gusbemacbe commented 2 years ago

You can just leave the problems here.

bryant-the-coder commented 2 years ago

noted with thanks

bryant-the-coder commented 2 years ago

wait i need wsl or is it optional?

bryant-the-coder commented 2 years ago

any other good fonts with ligatures and italics besides jetbrains?

gusbemacbe commented 2 years ago

wait i need wsl or is it optional?

It is optional. Only if you want. But WSL is a very good tool for developers. It is a native embed Linux system for Windows.

any other good fonts with ligatures and italics besides jetbrains?

Free fonts:

Paid fonts:

$ docker run -rm -v D:\Fira_Code_v6 2\tff:/in -v D:\fonts\patched\firacode patched:/out nerdfonts/patcher -c --careful docker: invalid reference format See 'docker run --help'

There was a space in the folders names. It should be like:

# Incorrect
# \Fira_Code_v6 2\
# \firacode patched

# Correct
# \'Fira_Code_v6 2'\
# "\'firacode patched'

# The presence of space requires quotes "" or ''. 
# Now
docker run -rm -v D:\'Fira_Code_v6 2'\tff:/in -v D:\fonts\patched\'firacode patched':/out nerdfonts/patcher -c --careful
# Or
docker run -rm -v "D:\Fira_Code_v6 2\tff":/in -v "D:\fonts\patched\firacode patched":/out nerdfonts/patcher -c --careful
aaronbell commented 2 years ago

Alright gents. This discussion has gone a bit far off topic :).

Please take any further discussion regarding patching Cascadia code elsewhere, such as the nerdfonts repro.

There is already an open issue for Cascadia to support so this issue is tracked.

bryant-the-coder commented 2 years ago

ok