### Install FiraCode via ports (FreeBSD) Source: https://github.com/tonsky/firacode/wiki/Installing Installs FiraCode on FreeBSD using the ports system. ```bash cd /usr/ports/x11-fonts/firacode && make install clean ``` -------------------------------- ### Install QA Dependencies Source: https://github.com/tonsky/firacode/blob/master/googlefonts-qa/README.md Install the necessary Python packages for the Google Fonts QA process using pip. ```bash pip install -U -r googlefonts-qa/scripts/requirements.txt ``` -------------------------------- ### Install FiraCode via pkg (FreeBSD) Source: https://github.com/tonsky/firacode/wiki/Installing Installs FiraCode on FreeBSD using the pkg package manager. ```bash pkg install firacode ``` -------------------------------- ### Install Fira Code on Solus Source: https://github.com/tonsky/firacode/wiki/Linux-instructions Use eopkg to install the Fira Code TTF font package on Solus. ```bash sudo eopkg install font-firacode-ttf ``` -------------------------------- ### Install FiraCode via Scoop (Windows) Source: https://github.com/tonsky/firacode/wiki/Installing Installs FiraCode on Windows using the Scoop package manager. Requires running as administrator and adding the nerd-fonts bucket. ```powershell scoop bucket add nerd-fonts scoop install firacode ``` -------------------------------- ### Install Fira Code on Gentoo Source: https://github.com/tonsky/firacode/wiki/Linux-instructions Use emerge to install the Fira Code font package on Gentoo Linux. ```bash emerge -av media-fonts/fira-code ``` -------------------------------- ### Install Fira Code via APT (Debian/Ubuntu) Source: https://github.com/tonsky/firacode/blob/master/distr/README.txt Install the fonts-firacode package using apt on Debian or Ubuntu. ```bash sudo apt install fonts-firacode ``` -------------------------------- ### Install FiraCode via Chocolatey (Windows) Source: https://github.com/tonsky/firacode/wiki/Installing Installs FiraCode on Windows using the Chocolatey package manager. ```powershell choco install firacode ``` -------------------------------- ### Create and Activate Python Virtual Environment Source: https://github.com/tonsky/firacode/blob/master/googlefonts-qa/README.md Set up a dedicated Python 3 virtual environment for installing QA dependencies. ```bash virtualenv -p python3 build/venv source venv/bin/activate ``` -------------------------------- ### Install Fira Code on Fedora Source: https://github.com/tonsky/firacode/wiki/Linux-instructions Use dnf to install the Fira Code font package on Fedora. ```bash dnf install fira-code-fonts ``` -------------------------------- ### Install Fira Code on Void Linux Source: https://github.com/tonsky/firacode/wiki/Linux-instructions Use xbps-install to install the Fira Code font package on Void Linux. ```bash xbps-install font-firacode ``` -------------------------------- ### HarfBuzz Benchmark Setup Source: https://github.com/tonsky/firacode/blob/master/docs/calt_performance.md Details of the HarfBuzz version and system specifications used for the performance benchmarks. ```text HarfBuzz 2.6.4 3,2 GHz 6-Core Intel Core i7 MacOS 10.15.3 ``` -------------------------------- ### Install FiraCode via Homebrew Cask (macOS) Source: https://github.com/tonsky/firacode/wiki/Installing Installs FiraCode using Homebrew Cask. Note that this might install an outdated version as it's not officially supported. ```bash brew install font-fira-code ``` -------------------------------- ### Build Fira Code on macOS Source: https://github.com/tonsky/firacode/blob/master/README.md Install build tools and build the font files locally on macOS. ```bash # install all required build tools ./script/bootstrap_macos.sh # build the font files ./script/build.sh # install OTFs to ~/Library/Fonts cp distr/otf/*.otf ~/Library/Fonts ``` -------------------------------- ### Install Fira Code via Homebrew (macOS) Source: https://github.com/tonsky/firacode/blob/master/distr/README.txt Use Homebrew package manager to install Fira Code on macOS. ```bash brew install --cask font-fira-code ``` -------------------------------- ### Manual Fira Code Installation Script Source: https://github.com/tonsky/firacode/wiki/Linux-instructions A bash script to download, install, and cache Fira Code fonts manually. Ensures the local font directory exists and updates the font cache. ```bash #!/usr/bin/env bash fonts_dir="${HOME}/.local/share/fonts" if [ ! -d "${fonts_dir}" ]; then echo "mkdir -p $fonts_dir" mkdir -p "${fonts_dir}" else echo "Found fonts dir $fonts_dir" fi version=5.2 zip=Fira_Code_v${version}.zip curl --fail --location --show-error https://github.com/tonsky/FiraCode/releases/download/${version}/${zip} --output ${zip} unzip -o -q -d ${fonts_dir} ${zip} rm ${zip} echo "fc-cache -f" fc-cache -f ``` -------------------------------- ### Functional Programming Example: take function Source: https://github.com/tonsky/firacode/blob/master/distr/specimen.html A functional programming implementation of a 'take' function, designed to extract a specified number of elements from a list. This example is repeated across different font weights, demonstrating the consistent logic. ```clojure take = (n, [x, ...xs]:list) --> | n <= 0 => [] | empty list => [] | otherwise => [x] ++ take n-1, xs ``` -------------------------------- ### Enable Fira Code and Ligatures in settings.json Source: https://github.com/tonsky/firacode/wiki/VS-Code-Instructions Paste these lines into your settings.json file to enable Fira Code and its ligatures. Ensure Fira Code is installed. ```json "editor.fontFamily": "Fira Code", "editor.fontLigatures": true, ``` -------------------------------- ### Enable Fira Code Mode with use-package Source: https://github.com/tonsky/firacode/wiki/Emacs-instructions Install and configure `fira-code-mode` using `use-package`. This snippet enables the mode for programming modes and allows customization of disabled ligatures. ```elisp (use-package fira-code-mode :custom (fira-code-mode-disabled-ligatures '("[]" "x")) ; ligatures you don't want :hook prog-mode) ; mode to enable fira-code-mode in ``` -------------------------------- ### Enable Fira Code in BBEdit Source: https://github.com/tonsky/firacode/blob/master/distr/README.txt Instructions to set Fira Code as the default font in BBEdit after installation. ```text 1. Install FiraCode as per the [macOS installation instructions](https://github.com/tonsky/FiraCode/wiki/Installing#macos) 2. Open BBEdit preferences, Editor Defaults, assign Fira Code as the Default font ``` -------------------------------- ### Setup Fira Code Symbol Font Source: https://github.com/tonsky/firacode/wiki/Emacs-instructions Configures Emacs to use the 'Fira Code Symbol' font for the Unicode range corresponding to Fira Code ligatures. ```elisp (defun fira-code-mode--setup () "Setup Fira Code Symbols" (set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol")) (provide 'fira-code-mode) ``` -------------------------------- ### Functional Programming Example: last3 function Source: https://github.com/tonsky/firacode/blob/master/distr/specimen.html A functional programming implementation to get the last three elements of a list by reversing the list, taking the first three, and then reversing again. This logic is consistent across different font weights. ```clojure last3 = reverse >> take 3 >> reverse ``` -------------------------------- ### Enable DirectWrite with LuaScript for Older Notepad++ Source: https://github.com/tonsky/firacode/wiki/Notepad-Plus-Plus-instructions Add this code to the LuaScript startup file to enable DirectWrite for improved rendering of special characters in older Notepad++ versions. Requires restarting Notepad++. ```lua editor1.Technology = SC_TECHNOLOGY_DIRECTWRITE editor2.Technology = SC_TECHNOLOGY_DIRECTWRITE ``` -------------------------------- ### Build Fira Code with Docker Source: https://github.com/tonsky/firacode/blob/master/README.md Build Fira Code font files using a Docker container. ```bash # install dependencies in a container and build the font files make # package the font files from dist/ into a zip make package ``` -------------------------------- ### Clone Fira Code Repository Source: https://github.com/tonsky/firacode/blob/master/googlefonts-qa/README.md Clone the Fira Code repository and checkout the 'qa' branch to begin the onboarding process. ```bash git clone git@github.com:thundernixon/firacode.git cd firacode git checkout qa ``` -------------------------------- ### Build Fira Code with Custom Features and Weights Source: https://github.com/tonsky/firacode/blob/master/README.md Build Fira Code with specific features, family name, and weights using the build script. ```bash # locally in your shell ./script/build.sh --features "ss02,ss08,ss10,cv03,cv07,cv14" --family-name "Fira Code straight" --weights "Regular,Bold" # or via a docker container (creates the family name 'Fira Code cv01 cv02 cv06 cv31 onum ss01 ss03 ss04 zero') docker run --rm -v "${PWD}":/opt tonsky/firacode:latest ./script/build.sh -f "cv01,cv02,cv06,ss01,zero,onum,ss03,ss04,cv31" -n "features" # in Git Bash from Git for Windows, or any other MSYS2 based shell, you might need to disable path conversion MSYS2_ARG_CONV_EXCL="*" docker run --rm -v "${PWD}":/opt tonsky/firacode:latest ./script/build.sh -f "ss02,ss03,ss04,ss05,ss06,ss07" ``` -------------------------------- ### Build Fonts Source: https://github.com/tonsky/firacode/blob/master/googlefonts-qa/README.md Execute the build script to generate fresh copies of the relevant fonts. ```bash googlefonts-qa/scripts/build.sh ``` -------------------------------- ### Fira Code Light: take and last3 functions Source: https://github.com/tonsky/firacode/blob/master/distr/specimen.html Demonstrates the 'take' and 'last3' functions applied with Fira Code Light font weight. ```clojure take = (n, [x, ...xs]:list) --> | n <= 0 => [] | empty list => [] | otherwise => [x] ++ take n-1, xs last3 = reverse >> take 3 >> reverse ``` -------------------------------- ### Set Fira Code Font in Emacs Source: https://github.com/tonsky/firacode/wiki/Emacs-instructions Sets the Fira Code font for the current Emacs frame if a window system is available. This is a basic setup for enabling the font. ```elisp (when (window-system) (set-frame-font "Fira Code")) ``` -------------------------------- ### Grant Execute Permissions to Scripts Source: https://github.com/tonsky/firacode/blob/master/googlefonts-qa/README.md Make the build and move-check scripts executable. ```bash chmod +x googlefonts-qa/scripts/build.sh chmod +x googlefonts-qa/scripts/move-check.sh ``` -------------------------------- ### Configure Fira Code Stylistic Sets Source: https://github.com/tonsky/firacode/wiki/VS-Code-Instructions Define stylistic sets for Fira Code ligatures using this setting, compatible with VS Code version 1.40 and later. Ensure Fira Code 2+ is installed. ```json "editor.fontLigatures": "'calt', 'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'zero', 'onum'" ``` -------------------------------- ### Example Font Object for Windows Terminal Source: https://github.com/tonsky/firacode/wiki/Windows-Terminal-&-Windows-Terminal-Preview This JSON object configures the font face, size, weight, and specific font features for Fira Code within Windows Terminal profiles. It can be added to the 'defaults' or specific profile sections of settings.json. ```json "font": { "face": "Fira Code", "size": 14, "weight": "normal", "features": { "cv02": 1, "cv14": 1, "cv25": 1, "cv26": 1, "cv28": 1, "cv32": 1, "ss02": 1, "ss03": 1, "ss05": 1, "ss07": 1, "ss09": 1 } } ``` -------------------------------- ### Configure Ligatures with ligature.el Source: https://github.com/tonsky/firacode/wiki/Emacs-instructions Add these Elisp snippets to your init.el file to enable FiraCode ligatures using the ligature.el package. This method works on macOS, Linux, and potentially other systems with Harfbuzz and Cairo support. ```elisp ;; Enable the www ligature in every possible major mode (ligature-set-ligatures 't '("www")) ``` ```elisp ;; Enable ligatures in programming modes (ligature-set-ligatures 'prog-mode '("www" "**" "***" "**-" "*-" "*/" "\\\\" "\\\\\\" "{-" "::" ":::" ":=" "!!" "!=" "!==" "-}" "---- " "-->" "->" "-=>" "-< " "-<<" "-~" "#{" "#[" "##" "###" "####" "#(" "#?" "#_" "#_(" ".-" ".=" ".." "..< " "..." "?=" "??" ";;" "/*" "/**" "/=" "/==" "/>" "//" "///" "&&" "||" "||=" "|= " "|> " "^=" "$> " "++" "+++" "+>" "=:=" "==" "=== " "==>" "=>" ">=>>" "<=" "=<<" "=/=" ">-" ">=" ">=>" ">>" ">>-" ">>=" ">>>" "<*" "<*>" "<|" "<|>" "<$ " <$> " "" "->" "->>" "-<" "-<<" "-~" "#{" "#[" "##" "###" "####" "#(" "#?" "#_" "#_(" ".-" ".=" ".." "..<" "..." "?=" "??" ";;" "/*" "/**" "/=" "/==" "/>" "//" "///" "&&" "||" "||=" "|=" "|> "^=" "$> "++" "+++" "+>" ">=:=" "==" "===" "==>" "=>" "=>>" "<= " =<<" "=/=" ">-" ">=" ">=>" ">>" ">>-" ">>=" ">>>" "<*" "<*>" "<|" "<|>" "<$ " <$> "