Skip to content

Latest commit

 

History

History
89 lines (54 loc) · 3.46 KB

font-el.org

File metadata and controls

89 lines (54 loc) · 3.46 KB

Emacs Font Config

Prologue

Generally fonts on the web or in applications aren’t a big deal, but some reason I spend a lot of time finding an tweaking fonts in my editor. This is a story of how I set that up.

Unicode

First and really the most important – set UTF-8 everywhere

(set-language-environment "UTF-8")
(set-default-coding-systems 'utf-8-unix)

Font selection

See also my fancy orgmode setup

I got back and forth of what I want for a default font. And once in a while I have to move this config to other machines and they may not have all my configs. So below you can see what I have tried… none of these are bad, but I’ve moved for some reason.

Basically this little snippet will look if that font name exists and, if so, will set it as the default. Note that I do this over and over again, replacing the default font until it gets to the end.

DejaVu Sans Mono

(when (member "DejaVu Sans Mono" (font-family-list))
  (set-face-attribute 'default nil :font "DejaVu Sans Mono" :height 140 :weight 'normal))

Source Code Pro – I used this the longest. One of it’s problems is that it doesn’t have all the unicode characters in it (see below of that fix). Another is that it’s hard to read sometimes, and making it bigger can make it worse. I like it at 125 and really no other size

(when (member "Source Code Pro" (font-family-list))
  (set-face-attribute 'default nil :font "Source Code Pro" :height 125 :weight 'normal))

IBM Plex – wait? IBM has a font?!? Yes it does. Lots of them, actually, under the Plex name. It’s certainly very corporate looking, but apparently they use this corporate wide. Not only does it look nice and scale well, it seems to be complete as far as weight, italic, etc.

(when (member "IBM Plex Mono" (font-family-list))
  (set-face-attribute 'default nil :font "IBM Plex Mono" :height 140 :weight 'normal))

My latest – JetBrains Mono. I mainly like it over IBM Plex Mono because it’s a bit less bold, but bold enough for me to see and I don’ t need the font quite as big.

(when (member "JetBrains Mono" (font-family-list))
  (set-face-attribute 'default nil :font "JetBrains Mono" :height 140 :weight 'regular))

Lastly… more Unicode

Seems familiar? Just like in Unicode but different – that was about what we use, not what we display it. Symbola is pretty ugly but (as the name states) it has a complete UTF-8 state. Prepending this allows us to view all characters.

I should note that I don’t deal with multiple languages and symbols often, but it’s best to prepare yourself when before you find yourself in that world

(when (member "Symbola" (font-family-list))
  (set-fontset-font t 'unicode "Symbola" nil 'prepend))