From 0e1a03575ec273319a5664dd3dc4b92ac4d1f6d8 Mon Sep 17 00:00:00 2001 From: Nikita Prokopov Date: Sun, 20 Oct 2019 19:41:38 +0200 Subject: [PATCH] Reformatted HowToInstall to TXT instead of Markdown (closes #868 closes #716) --- distr/HowToInstall.txt | 123 --------- distr/README.txt | 566 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 566 insertions(+), 123 deletions(-) delete mode 100644 distr/HowToInstall.txt create mode 100644 distr/README.txt diff --git a/distr/HowToInstall.txt b/distr/HowToInstall.txt deleted file mode 100644 index 3dec618..0000000 --- a/distr/HowToInstall.txt +++ /dev/null @@ -1,123 +0,0 @@ -Return to [FiraCode](https://github.com/tonsky/FiraCode) - -### [](#installing-font)Installing font - -Windows: - -* In the ttf folder, double-click each font file, click “Install font”; to install all at once, select all files, right-click, and choose “Install” - -_or_ - -* Use [chocolatey](https://chocolatey.org): `choco install firacode` - -Mac: - -In the downloaded TTF folder: - -1. Select all font files -2. Right click and select `Open` (alternatively `Open With Font Book`) -3. Select "Install Font" - -_or_ - -* Use [brew](http://brew.sh) and [cask](https://caskroom.github.io): - - _Not officially supported, might install outdated version_ - -
- - brew tap caskroom/fonts - brew cask install font-fira-code - - - -Linux: - -* Install a package available for your distribution following [the instructions](https://github.com/tonsky/FiraCode/wiki/Linux-instructions#installing-with-a-package-manager) - -_or_ - -* In the ttf folder double-click each font file and click “Install font”; see [“Manual Installation”](https://github.com/tonsky/FiraCode/wiki/Linux-instructions#manual-installation) if double-clicking doesn't work - -FreeBSD: - -* Using pkg(8): `pkg install firacode` - -_or_ - -* Using ports: `cd /usr/ports/x11-fonts/firacode && make install clean` - -### [](#how-to-enable-ligatures)How to enable ligatures - -You need to explicitly enable ligatures support in following editors: - -* [Atom](https://github.com/tonsky/FiraCode/wiki/Atom-instructions) -* [Brackets](https://github.com/tonsky/FiraCode/wiki/Brackets-Instructions/) -* [Cloud9](https://github.com/tonsky/FiraCode/wiki/cloud9-instructions) -* [Jetbrains' products](https://github.com/tonsky/FiraCode/wiki/Intellij-products-instructions) (IntelliJ, etc) -* [Emacs](https://github.com/tonsky/FiraCode/wiki/Emacs-instructions) -* [MacVim](https://github.com/tonsky/FiraCode/wiki/MacVim-instructions) -* [VS Code](https://github.com/tonsky/FiraCode/wiki/VS-Code-Instructions) -* [BBEdit](https://github.com/tonsky/FiraCode/wiki/BBEdit-instructions) -* [LightTable](https://github.com/tonsky/FiraCode/wiki/LightTable-instructions) -* [Sublimetext](https://github.com/tonsky/FiraCode/wiki/Sublimetext-Instructions) - -For other editors it must be enough to simply select Fira Code as your font of choice. [Full list of supported editors](https://github.com/tonsky/FiraCode#editor-support) - -### [](#troubleshooting)Troubleshooting - -#### [](#1-make-sure-the-font-your-editor-displays-is-actually-fira-code)1\. Make sure the font your editor displays is actually Fira Code - -Easiest way is to compare the shape of `@` `&` and `r` with the reference image: - -![](https://user-images.githubusercontent.com/285292/26971424-c609be76-4d15-11e7-8684-23e7b1c08929.png) - -Issues: [#393](https://github.com/tonsky/FiraCode/issues/393) [#373](https://github.com/tonsky/FiraCode/issues/373) [#227](https://github.com/tonsky/FiraCode/issues/227) - -#### [](#2-make-sure-youve-enabled-ligatures-in-your-editor)2\. Make sure you’ve enabled ligatures in your editor - -Consult this wiki (see above ↑) for instruction on how to do that. - -Issues: [#291](https://github.com/tonsky/FiraCode/issues/291) - -#### [](#3-make-sure-youre-on-the-latest-version-of-fira-code)3\. Make sure you’re on the latest version of Fira Code - -Consult [CHANGELOG](https://github.com/tonsky/FiraCode/blob/master/CHANGELOG.md) to see when it was last updated. - -#### [](#4-check-the-list-of-known-issues-below-)4\. Check the list of known issues below ↓ - -### [](#known-issues)Known issues - -#### [](#hinting-issues)Hinting issues - -* Uneven spacing in `===` and `!==` at certain font sizes, esp. on Windows [#405](https://github.com/tonsky/FiraCode/issues/405) [#243](https://github.com/tonsky/FiraCode/issues/243) [#119](https://github.com/tonsky/FiraCode/issues/119) [#114](https://github.com/tonsky/FiraCode/issues/114) - -* Different height of `[]` at certain font sizes [#332](https://github.com/tonsky/FiraCode/issues/332) [#251](https://github.com/tonsky/FiraCode/issues/251) - -#### [](#powerline-characters-are-of-slightly-wrong-size)Powerline characters are of slightly wrong size - -Unfortunately this can’t be fixed for all terminals because they have different ways of calculate font metrics. See [this comment](https://github.com/tonsky/FiraCode/issues/44#issuecomment-187305276) - -Issues: [#426](https://github.com/tonsky/FiraCode/issues/426) [#131](https://github.com/tonsky/FiraCode/issues/131) [#44](https://github.com/tonsky/FiraCode/issues/44) - -#### [](#some-ligatures-work-while-some-dont)Some ligatures work while some don’t - -This is an issue with your editor and how it handles tokenization/syntax highlighting. Nothing can be done in a font to work around that. Report your problem to the corresponding editor’s issue tracker. - -* All ligatures with dashes in Visual Studio (not Code) [#422](https://github.com/tonsky/FiraCode/issues/422) [#395](https://github.com/tonsky/FiraCode/issues/395) [#360](https://github.com/tonsky/FiraCode/issues/360) [#273](https://github.com/tonsky/FiraCode/issues/273) [#259](https://github.com/tonsky/FiraCode/issues/259) [#233](https://github.com/tonsky/FiraCode/issues/233) [#220](https://github.com/tonsky/FiraCode/issues/220) [#196](https://github.com/tonsky/FiraCode/issues/196) [#181](https://github.com/tonsky/FiraCode/issues/181) [#157](https://github.com/tonsky/FiraCode/issues/157) [#99](https://github.com/tonsky/FiraCode/issues/99) [#43](https://github.com/tonsky/FiraCode/issues/43) [#32](https://github.com/tonsky/FiraCode/issues/32) - -* Ligatures in column 100 in VS Code [#403](https://github.com/tonsky/FiraCode/issues/403) [#397](https://github.com/tonsky/FiraCode/issues/397) [#372](https://github.com/tonsky/FiraCode/issues/372) - -* Atom/VS Code are known to break certain ligatures in certain syntaxes [#361](https://github.com/tonsky/FiraCode/issues/361) [#353](https://github.com/tonsky/FiraCode/issues/353) [#348](https://github.com/tonsky/FiraCode/issues/348) [#328](https://github.com/tonsky/FiraCode/issues/328) [#326](https://github.com/tonsky/FiraCode/issues/326) [#235](https://github.com/tonsky/FiraCode/issues/235) - -#### [](#corrupted-font-in-intellij-on-windows)Corrupted font in IntelliJ on Windows - -Go to `C:\Windows\Fonts` with `cmd.exe`, find and delete everything having Fira in the file name. It’s important that you use terminal commands, not Explorer. - -Issues: [#589](https://github.com/tonsky/FiraCode/issues/589) [#581](https://github.com/tonsky/FiraCode/issues/581) [#398](https://github.com/tonsky/FiraCode/issues/398) [IDEA-159901](https://youtrack.jetbrains.com/issue/IDEA-159901) - -#### [](#anything-related-to-italics)Anything related to italics - -Fira Code does not have italics at all. If you see italicized glyphs it means your editor is “faking” them. - -Issues: [#375](https://github.com/tonsky/FiraCode/issues/375) [#320](https://github.com/tonsky/FiraCode/issues/320) [#281](https://github.com/tonsky/FiraCode/issues/281) \ No newline at end of file diff --git a/distr/README.txt b/distr/README.txt new file mode 100644 index 0000000..189c42d --- /dev/null +++ b/distr/README.txt @@ -0,0 +1,566 @@ +Installing +========== + +Windows +------- + +In the ttf folder, double-click each font file, click “Install font”; to install all at once, select all files, right-click, and choose “Install” + +OR + +Use https://chocolatey.org: + + choco install firacode + + +macOS +----- + +In the downloaded TTF folder: + +1. Select all font files +2. Right click and select `Open` (alternatively `Open With Font Book`) +3. Select "Install Font" + +OR + +Use http://brew.sh: + + brew tap caskroom/fonts + brew cask install font-fira-code + + +Ubuntu Zesty (17.04), Debian Stretch (9) or newer +------------------------------------------------- + +1. Make sure that the `universe` (for Ubuntu) or `contrib` (for Debian) repository is enabled (see https://askubuntu.com/questions/148638/how-do-i-enable-the-universe-repository or https://wiki.debian.org/SourcesList#Component) +2. Install `fonts-firacode` package either by executing `sudo apt install fonts-firacode` in the terminal or via GUI tool (like “Software Center”) + + +Arch Linux +---------- + +Fira Code package is available in the official repository: https://www.archlinux.org/packages/community/any/otf-fira-code/. + +Variant of Fira Code package is available in the AUR: https://aur.archlinux.org/packages/otf-fira-code-git/. + + +Gentoo +------ + + emerge -av media-fonts/fira-code + + +Fedora +------ + +A Fedora copr repository is available: https://copr.fedorainfracloud.org/coprs/evana/fira-code-fonts/. Package sources https://gitlab.com/evana11/fira-code-fonts-fedora. + +To install, perform the following commands: + + dnf copr enable evana/fira-code-fonts + dnf install fira-code-fonts + + +Solus +----- + +Fira Code package is available in the official repository: `font-firacode-ttf` and `font-firacode-otf`. +They can be installed by running: + + sudo eopkg install font-firacode-ttf font-firacode-otf + + +Void linux +---------- + + xbps-install font-firacode + + +Linux Manual Installation +------------------------- + +With most desktop-oriented distributions, double-clicking each font file in the ttf folder and selecting “Install font” should be enough. If it isn’t, create and run `download_and_install.sh` script: + + #!/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 + + for type in Bold Light Medium Regular Retina; do + file_path="${HOME}/.local/share/fonts/FiraCode-${type}.ttf" + file_url="https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-${type}.ttf?raw=true" + if [ ! -e "${file_path}" ]; then + echo "wget -O $file_path $file_url" + wget -O "${file_path}" "${file_url}" + else + echo "Found existing file $file_path" + fi; + done + + echo "fc-cache -f" + fc-cache -f + +More details: https://github.com/tonsky/FiraCode/issues/4 + + +FreeBSD +------- + +Using pkg(8): + + pkg install firacode + +OR + +Using ports: + + cd /usr/ports/x11-fonts/firacode && make install clean + + +Enabling ligatures +================== + +Atom +---- + +To change your font to Fira Code, open Atom's preferences (`cmd + ,` on a Mac, `ctrl + ,` on PC), make sure the "Settings" tab is selected, or the "Editor" in Atom 1.10+, and scroll down to "Editor Settings". In the "Font Family" field, enter `Fira Code`. + +If you wish to specify a font weight, for example, Light, use `Fira Code Light` as a font name (Windows) or `FiraCode-Light` (macOS). + +Ligatures are enabled by default in Atom 1.9 and above. + + +VS Code +------- + +To open the settings editor, first from the File menu choose Preferences, Settings or use keyboard shortcut `Ctrl + ,` (Windows) or `Cmd + ,` (macOS). + +To enable FiraCode in the settings editor, under "Commonly Used", expand the "Text Editor" settings and then click on "Font". In the "Font Family" input box type `Fira Code`, replacing any content. Tick the check box "Enables/Disables font ligatures" under "Font Ligatures" to enable the special ligatures. + +If you wish to specify a font weight, for example, Light, use `Fira Code Light` as a font name (Windows) or `FiraCode-Light` (macOS). + + +IntelliJ products +----------------- + +1. Enable in Settings → Editor → Font → Enable Font Ligatures +2. Select `Fira Code` as "Primary font" under Settings → Editor → Font + +Additionally, if a Color Scheme is selected: + +3. Enable in Settings → Editor → Color Scheme → Color Scheme Font → Enable Font Ligatures +4. Select Fira Code as "Primary font" under Settings → Editor → Color Scheme → Color Scheme Font + + +BBEdit, TextWrangler +-------------------- + +Run in your terminal: + + defaults write com.barebones.bbedit "EnableFontLigatures_Fira Code" -bool YES + +Source: https://www.barebones.com/support/bbedit/ExpertPreferences.html + + +Brackets +-------- + +1. From the `View` menu choose `Themes....` +2. Paste `'Fira Code'`, at the begining of `Font Family` + + +Emacs +----- + +There are a few options when it comes down to using ligatures in +Emacs. They are listed in order of preferred to less-preferred. Pick one! + +1. Using composition mode in Emacs Mac port + +If you're using the latest Mac port of Emacs (https://bitbucket.org/mituharu/emacs-mac by Mitsuharu Yamamoto) for macOS, you can use: + + (mac-auto-operator-composition-mode) + +This is generally the easiest solution, but can only be used on macOS. + +2. Using prettify-symbols + +These instructions are pieced together by https://github.com/Triavanicus, taking some pieces from https://github.com/minad/hasklig-mode. + +This method requires you to install the Fira Code Symbol font, made by https://github.com/siegebell: +https://github.com/tonsky/FiraCode/issues/211#issuecomment-239058632 + + (defun fira-code-mode--make-alist (list) + "Generate prettify-symbols alist from LIST." + (let ((idx -1)) + (mapcar + (lambda (s) + (setq idx (1+ idx)) + (let* ((code (+ #Xe100 idx)) + (width (string-width s)) + (prefix ()) + (suffix '(?\s (Br . Br))) + (n 1)) + (while (< n width) + (setq prefix (append prefix '(?\s (Br . Bl)))) + (setq n (1+ n))) + (cons s (append prefix suffix (list (decode-char 'ucs code)))))) + list))) + + (defconst fira-code-mode--ligatures + '("www" "**" "***" "**/" "*>" "*/" "\\\\" "\\\\\\" + "{-" "[]" "::" ":::" ":=" "!!" "!=" "!==" "-}" + "--" "---" "-->" "->" "->>" "-<" "-<<" "-~" + "#{" "#[" "##" "###" "####" "#(" "#?" "#_" "#_(" + ".-" ".=" ".." "..<" "..." "?=" "??" ";;" "/*" + "/**" "/=" "/==" "/>" "//" "///" "&&" "||" "||=" + "|=" "|>" "^=" "$>" "++" "+++" "+>" "=:=" "==" + "===" "==>" "=>" "=>>" "<=" "=<<" "=/=" ">-" ">=" + ">=>" ">>" ">>-" ">>=" ">>>" "<*" "<*>" "<|" "<|>" + "<$" "<$>" "\\)" #Xe113) + ("[^-]\\(->\\)" #Xe114) + ("\\(->>\\)" #Xe115) + ("\\(-<\\)" #Xe116) + ("\\(-<<\\)" #Xe117) + ("\\(-~\\)" #Xe118) + ("\\(#{\\)" #Xe119) + ("\\(#\\[\\)" #Xe11a) + ("\\(##\\)" #Xe11b) + ("\\(###\\)" #Xe11c) + ("\\(####\\)" #Xe11d) + ("\\(#(\\)" #Xe11e) + ("\\(#\\?\\)" #Xe11f) + ("\\(#_\\)" #Xe120) + ("\\(#_(\\)" #Xe121) + ("\\(\\.-\\)" #Xe122) + ("\\(\\.=\\)" #Xe123) + ("\\(\\.\\.\\)" #Xe124) + ("\\(\\.\\.<\\)" #Xe125) + ("\\(\\.\\.\\.\\)" #Xe126) + ("\\(\\?=\\)" #Xe127) + ("\\(\\?\\?\\)" #Xe128) + ("\\(;;\\)" #Xe129) + ("\\(/\\*\\)" #Xe12a) + ("\\(/\\*\\*\\)" #Xe12b) + ("\\(/=\\)" #Xe12c) + ("\\(/==\\)" #Xe12d) + ("\\(/>\\)" #Xe12e) + ("\\(//\\)" #Xe12f) + ("\\(///\\)" #Xe130) + ("\\(&&\\)" #Xe131) + ("\\(||\\)" #Xe132) + ("\\(||=\\)" #Xe133) + ("[^|]\\(|=\\)" #Xe134) + ("\\(|>\\)" #Xe135) + ("\\(\\^=\\)" #Xe136) + ("\\(\\$>\\)" #Xe137) + ("\\(\\+\\+\\)" #Xe138) + ("\\(\\+\\+\\+\\)" #Xe139) + ("\\(\\+>\\)" #Xe13a) + ("\\(=:=\\)" #Xe13b) + ("[^!/]\\(==\\)[^>]" #Xe13c) + ("\\(===\\)" #Xe13d) + ("\\(==>\\)" #Xe13e) + ("[^=]\\(=>\\)" #Xe13f) + ("\\(=>>\\)" #Xe140) + ("\\(<=\\)" #Xe141) + ("\\(=<<\\)" #Xe142) + ("\\(=/=\\)" #Xe143) + ("\\(>-\\)" #Xe144) + ("\\(>=\\)" #Xe145) + ("\\(>=>\\)" #Xe146) + ("[^-=]\\(>>\\)" #Xe147) + ("\\(>>-\\)" #Xe148) + ("\\(>>=\\)" #Xe149) + ("\\(>>>\\)" #Xe14a) + ("\\(<\\*\\)" #Xe14b) + ("\\(<\\*>\\)" #Xe14c) + ("\\(<|\\)" #Xe14d) + ("\\(<|>\\)" #Xe14e) + ("\\(<\\$\\)" #Xe14f) + ("\\(<\\$>\\)" #Xe150) + ("\\( Settings + +Add before "ignored_packages": + + "font_face": "Fira Code", + "font_options": ["subpixel_antialias"], + +If you want enable antialias, add in font_options: "gray_antialias" + + +Visual Studio +------------- + +1. Launch Visual Studio (2015 or later). +2. Launch the Options dialog by opening the "Tools" menu and selecting "Options". +3. In the Options dialog, under the "Environment" category, you'll find "Fonts and Colors". Click on that. You'll see a combo-box on the right hand side of the dialog labelled "Font". Select "Fira Code" from that combo-box. +4. Click "OK" to dismiss. +5. Restart Visual Studio. + +Now, most FiraCode ligatures will work. A notable exception is the hyphen-based ligatures (e.g. the C++ dereference '->'). See https://github.com/tonsky/FiraCode/issues/422 for details. + + +Troubleshooting +=============== + +See https://github.com/tonsky/FiraCode/wiki/Troubleshooting