본문 바로가기
목차
개발환경

[Env] Install a NerdFont on Ubuntu

by ds31x 2023. 7. 14.
728x90
반응형

https://www.nerdfonts.com/

brew로 설치하기 (추천)

brew install --cask font-caskaydia-cove-nerd-font

 

macOS에선 어지간한 건 brew 로 다 된다.

 

참고로, Ubuntu (Debian 포함)도 linuxbrew가 된다. 개인용 장비로 linux를 쓰는 경우엔 linuxbrew도 좋은 선택이라고 생각한다.

안정성이 극히 중요한 장비에선 권하지 않음에 유의할 것.

2023.09.05 - [Linux] - [Linux] homebrew 설치하기 (Ubuntu)

 

[Linux] homebrew 설치하기 (Ubuntu)

Homebrew는 Max Howell이 만든 패키지 관리자 (Debian 계열 linux의 apt-get 또는 Windows 의 winget과 비슷)임.macOS 용 으로 2009년 ruby로 개발됨.사실상 macOS에서는 표준 패키지 관리자임.최근 들어 linux 및 WSL에서

ds31x.tistory.com


직접 다운로드 받아 font config로 설치하기

--;; brew가 편하지만, 아래와 같이 직접 설치할 수도 있다.


순서

  1. 원하는 Nerd Font 를 다운로드.
  2. 압축을 풀고, 설치할 directory ~/.fonts 로 copy.
    • ~/.local/share/fonts 에 설치해도 된다.
  3. 명령어 fc-cache -fv 를 수행하여 font cache를 rebuild (아래 설명 참조).

관련 Shell Script.

#!/bin/bash

if which fc-cache &> /dev/null ; then
        echo "fc-cache exists"
else
        echo "fc-cache not found"
        sudo apt install fontconfig
fi
echo "Download CaskaydiaCove Nerd Font"

if which wget &> /dev/null ; then
        echo "wget exists"
else
        echo "wget not found"
        sudo apt install wget
fi
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/CascadiaCode.zip

if which unzip &> /dev/null ; then
        echo "unzip exists"
else
        echo "unzip not found"
        sudo apt install unzip
fi

echo "install fonts into ~/.fonts"
unzip CascadiaCode.zip -d ~/.fonts
fc-cache -fv

echo "done!"

fc-cache 명령어는 font 설정 명령어 중 하나로, 새 font를 추가한 이후 캐시(cache)에서 해당 font를 반영하도록 재생성함.

  • fc-cache 가 없는 경우 sudo apt install fontconfig를 실행하면 설치된다.

fa-cache 명령어를 수행한 이후 추가된 새 font 사용이 가능.

위에서 사용된 옵션의 의미는 다음과 같음.

  • -f : force로 강제 실행.
  • -v : 표준 출력 stdout에서 실행정보 출력 (verbose로 기억하면 쉬움)

fcfc-cache
aptapt-cache 의 관계를 생각하면 된다.


fc (font config)의 다른 명령어는 다음과 같음.

  • fc-list : font config에 의해 설정된 모든 font의 list를 출력.
  • fc-match : font 이름 일부등을 인자로 받고 매칭이 되는 font 정보를 출력.
  • fc-cache : font 캐시 관련 명령어. 위에서 설명한 options 외에도 다음과 같은 options를 지원
    • -r : 기존의 캐시를 지우고 새로 갱신한다.
    • -s : font가 설치된 시스템 디렉토리를 scan
    • -V : version출력
  • fc-cat : font config의 캐시로부터 font 정보를 출력함.
  • fc-query : font file의 path를 인자로 넘겨서 해당 font file 정보를 본다.

apt를 이용한 방식

apt는 Debian계열 linux의 package manaber임.

다음은 nanum font설치하는 명령어임.

# sudo가 필요!
apt update
apt install fonts-nanum*
# 보단 간단하게는 다음과 같이 설치해도 됨:
# apt -qq -y install fonts-nanum*

 

다음 글을 참고할 것.

https://ds31x.tistory.com/32#3.-nanum-font-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0

 

[Python] Matplotlib Font설정 : 한글 사용하기 (colab, macOS).

1. 현재 matplotlib가 사용하는 font의 family와 size 확인하기.matplotlib의 rcParams (runtime config parameters)에서 확인 가능함.import matplotlib as mplprint(f"font.family: {mpl.rcParams['font.family']}"), print(f"font.size : {mpl.rcPara

ds31x.tistory.com


참고

https://gist.github.com/matthewjberger/7dd7e079f282f8138a9dc3b045ebefa0?permalink_comment_id=3307825#gistcomment-3307825

 

Install a nerd font on ubuntu

Install a nerd font on ubuntu. GitHub Gist: instantly share code, notes, and snippets.

gist.github.com

2024.09.08 - [utils] - [Utils] homebrew - Summary

 

[Utils] homebrew - Summary

Homebrew란?Homebrew는 2009년 Max Howell에 의해 처음 개발된 오픈소스 package manager임.처음에는 macOS에서 소프트웨어 설치를 간편하게 하기 위해 만들어졌으며,이후 Linux도 지원하게 되었음 (Linux 지원은 2

ds31x.tistory.com

2023.06.26 - [개발환경] - [Env] xterm: Font

 

[Env] xterm: Font

이 문서는 xterm에 font를 추가설치하는 방법을 설명함. xterm은 x-windows system의 표준 terminal emulator임. Ubuntu 기준. xterm 설치 sudo apt install xterm 위의 command는 xterm을 pacakage manager apt로 설치하는 것을 나

ds31x.tistory.com

https://dsaint31.tistory.com/454

 

[Linux] Debian 계열 패키지 관리 툴: apt, apt-get

apt (apt-get, apt-cache)apt는Debian 계열의 Linux에서 패키지 관리 SW로서,Package Management System (패키지관리시스템, Package Manager)의High Level Command Line Interface를 제공한다. 달리 말하면 apt-get과 apt-cache와 같은

dsaint31.tistory.com

2025.09.20 - [CE] - Font: TTF vs. OTF

 

Font: TTF vs. OTF

개발자 친화적인 아이콘을 font로 제공하는 Nerd Fonts에서는 아직까지 TTF만을 지원할 정도로, 아직까지는 TTF가 터미널 및 IDE에서는 가장 안정적으로 동작한다. 하지만, 프로그램 라이브러리의 resou

ds31x.tistory.com


 

728x90