Fonts in VS Code

I hate it when I see code using variable names like THETA all in caps. To be honest, that was some Fortran code, so I still have PTSD from that.

1 Like

Thank you to those who really tried to help me. Personally, I find that is rather inelegant trying to dictate how other programmers should write. My goal is only to test all available fonts in personal codes. Nevertheless, I do find very useful some improvements allowed by Unicode. Indeed, sinθ is way more idiomatic than sin_theta.

I am a GNU/Linux user, and I am testing EndeavourOS right now, which is Arch-based. Which package do you installed to use “emoji font”?

I use Linux and usually use some patched fonts from nerd fonts, which provides a lot of glyphs, but I not sure about this kind of “emoji font”. I just installed the .zip file of JuliaMono, but this kind of emoji is not available though…

See wiki:
https://wiki.archlinux.org/title/Fonts#Emoji_and_symbols
So basically either noto-fonts-emoji or ttf-joypixels should work.

Just in case, here’s the output of pacman -Qs ttf for me:

[nsajko@aceramd ~]$ pacman -Qs ttf
local/gnu-free-fonts 20120503-8
    A free family of scalable outline fonts
local/noto-fonts 20220607-1
    Google Noto TTF fonts
local/noto-fonts-extra 20220607-1
    Google Noto TTF fonts - additional variants
local/ttf-anonymous-pro 1.003-6
    A family of four fixed-width fonts designed especially with coding in mind
local/ttf-bitstream-vera 1.10-14
    Bitstream Vera fonts.
local/ttf-caladea 20200113-3
    A serif font family metric-compatible with Cambria font family
local/ttf-carlito 20130920-6
    Google's Carlito font
local/ttf-cascadia-code 2111.01-1
    A monospaced font by Microsoft that includes programming ligatures
local/ttf-cormorant 3.609-1
    Open-source display font family
local/ttf-crimson 0.800-1
    A font family for book production in the tradition of beautiful oldstyle typefaces
local/ttf-crimson-pro 1.003-1
    A professionally produced redesign of Crimson by Jacques Le Bailly (8 fixed weights)
local/ttf-crimson-pro-variable 1.003-1
    A professionally produced redesign of Crimson by Jacques Le Bailly (variable weight)
local/ttf-croscore 20220607-1
    Chrome OS core fonts
local/ttf-dejavu 2.37+18+g9b5d1b2f-3
    Font family based on the Bitstream Vera Fonts with a wider range of characters
local/ttf-droid 20121017-10
    General-purpose fonts released by Google as part of Android
local/ttf-eurof 1.0-2
    The original eurofurence font designed for headlines, signs, badges, inscriptions, et al.
local/ttf-font-awesome 6.1.2-1
    Iconic font designed for Bootstrap
local/ttf-hack 3.003-3
    A hand groomed and optically balanced typeface based on Bitstream Vera Mono.
local/ttf-ibm-plex 6.0.2-1
    IBM Plex Mono, Sans, and Serif
local/ttf-inconsolata 1:3.000-3
    Monospace font for pretty code listings and for the terminal
local/ttf-input 20220502-1
    Fonts for code from DJR & Font Bureau
local/ttf-ionicons 6.0.3-1
    Font from the Ionic mobile framework
local/ttf-jetbrains-mono 2.242-2
    Typeface for developers, by JetBrains
local/ttf-joypixels 7.0.0-1
    Emoji as a Service (formerly EmojiOne)
local/ttf-junicode 1.003-2
    Junius-Unicode: Font for Medievalists
local/ttf-lato 2.015-4
    A sanserif typeface family bearing the Polish name of "Summer"
local/ttf-liberation 2.1.5-1
    Font family which aims at metric compatibility with Arial, Times New Roman, and Courier New
local/ttf-linux-libertine-g 20120116-6
    Graphite port of Linux Libertine and Linux Biolinum fonts
local/ttf-monofur 1.0-7
    A monospaced font derived from the eurofurence typeface family
local/ttf-opensans 1.101-2
    Sans-serif typeface commissioned by Google
local/ttf-overpass 3.0.5-1
    Open source web font family (True Type Font)
local/ttf-proggy-clean 1.1.5-2
    Monospaced fonts for programming
local/ttf-roboto 2.138-4
    Google's signature family of fonts
local/ttf-roboto-mono 3.000-1
    A monospaced addition to the Roboto type family.
local/ttf-ubuntu-font-family 0.83-8
    Ubuntu font family

And so what? Sometimes I just write code for a Danish audience and I want to use æ, ø, and å and Danish variable names and Danish documentation and so on. An English audience is not always the case.

Just to clarify my understanding of the terminology:

Fonts like FiraCode, JetBrains Mono, JuliaMono, and CascadiaPro are provided as OTF files (with .otf or .ttf) suffix and contain outlines - basically the monochrome shapes - of characters.

There’s a Python script called font-patcher which forcibly adds extra outlines - various symbols and icons -to existing fonts. You can do this to any font you like - some people have done it for most of the popular fonts. Although the name has to be slightly different for license reasons, these are just like ordinary outline fonts.

An “emoji font” is an OTF font that contains coloured images - these can be PNG or SVG images stored inside the file. “Ordinary” fonts like FiraCode, JetBrains Mono, JuliaMono, or CascadiaPro don’t contain these coloured images. For a clue as to why - the Apple Color Emoji font on my system is about 200 Mbytes of coloured pictures, and it doesn’t get smaller every year… :slight_smile:

What should happen in VSCode is that it should switch intelligently between the current monochrome font and the first available emoji font whenever you ask for a specific Unicode glyph. If this isn’t happening, it’s likely due to unavailable emoji fonts or a VSCode issue. There are some older issues on the VSCode issue tracker on GitHub but I’m guessing these have been fixed.

Fonts: Are a personal preference; like shells, [code] editors, etc.

Encoding: There is a reason why 98% of all web pages are UTF-8 encoded.

When it comes to reproducibility: Common, server/web-based deployments* should be preferred over custom, local installations.

*e.g. https://demo.jupyter.b-data.ch with image Julia (pubtools:latest) + code-server.
:information_source: This image (registry.gitlab.b-data.ch/jupyterlab/julia/pubtools) may also be run locally with docker.