From fcb1fdb11db07fbf80536261b0627c8161a030b1 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Tue, 28 Jan 2025 13:14:48 -0800 Subject: [PATCH] Shuffling my fonts ... yet again. --- README.org | 22 +++++++++++++--------- ha-config.org | 16 ++++++++++------ ha-display.org | 40 ++++++++++++++++++++++++++-------------- ha-theme.org | 7 ++++--- initialize | 6 +++--- 5 files changed, 56 insertions(+), 35 deletions(-) diff --git a/README.org b/README.org index c6f17fe..3b6fe59 100644 --- a/README.org +++ b/README.org @@ -1,8 +1,8 @@ -#+title: My Emacs Configuration -#+author: Howard X. Abrams -#+date: 2021-11-01 -#+filetags: emacs readme -#+startup: inlineimages +#+TITLE: My Emacs Configuration +#+AUTHOR: Howard X. Abrams +#+DATE: 2021-11-01 +#+FILETAGS: emacs readme +#+STARTUP: inlineimages ** Introduction I’ve crafted my Emacs configuration, I cheekily call /hamacs/, in a literate programming model, heavily inspired by my recent journey into [[https://www.youtube.com/watch?v=LKegZI9vWUU][Henrik Lissner's]] [[https://github.com/hlissner/doom-emacs][Doom Emacs]] and [[https://www.spacemacs.org/][Spacemacs]]. While I used both extensively, I decided I would /roll my own/ as Emacs people like myself, tend to be /control freaks/ (at least a little bit). @@ -12,7 +12,7 @@ Using [[https://howardism.org/Technical/Emacs/literate-devops.html][literate pro I’ve separated my configuration into /chapters/ around particular subjects, applications and programming languages. This feature allows you, dear reader, to jump our to items of interest, but allows me to /selectively load/ individual chapters. For instance, if I’m not doing much with Ruby at work, I can remove that chapter from the list in my [[file:bootstrap.org::*Load the Rest][bootstrap]]. I also don’t load my [[file:ha-display.org][UI configuration]] when I am using the Terminal (doesn’t happen much, actually). -Hit me up with questions on Mastodon: [[https://emacs.ch/@howard][@howard@emacs.ch]]. +Hit me up with questions on Mastodon: [[https://emacs.ch/@howard][@howard@pdx.social]]. If you want to try the entire process, after installing Emacs (see my instructions for [[file:README-MacOS.org][both MacOS]] and [[file:README-Linux.org][Linux]]), clone this repo with: #+begin_src sh @@ -29,15 +29,15 @@ To create [[file:~/.emacs.d/init.el][~/.emacs.d/init.el]] which starts the proce - [[file:bootstrap.org][Bootstrap]] :: configures =straight= and loads basic libraries the rest of the code depends on. It then loads the following files in order. - [[file:ha-config.org][Configuration]] :: contains /most/ of my configuration, setting up my sequence key menus, evil, etc. - [[file:ha-evil.org][Evilness]] :: configuration for using VI, er, ~vim~ keybindings in Emacs. - - [[file:ha-general.org][Leader]] :: using the ~SPC~ to kick off a hierarchal order of functions. - - [[file:ha-display.org][GUI Display]] :: sets up the visual aspects of an Emacs GUI, including themes and fonts. + - [[file:ha-general.org][Leader]] :: using the ~SPC~ to kick off a hierarchical order of functions. + - [[file:ha-display.org][GUI Display]] :: sets up the visual aspects of an Emacs GUI, including font specification and [[file:ha-theme.org][my theme]]. - [[file:ha-dashboard.org][Dashboard]] :: sets up initial window layout of the =main= project with a dashboard. - [[file:ha-data.org][Data]] :: functions for dealing with a buffer-full of data. ** Org Mode Configuration - [[file:ha-org.org][Initial Org Configuration]] :: configures the basics for org-mode formatted files. Specific features come from their own files. - [[file:ha-org-word-processor.org][Word Processing]] :: attempts to make Org files /visually/ look like a word processor, including turning off the colors for headers, and instead increasing their size. - - [[file:ha-org-literate.org][Literate Programming]] :: functions to support literate programming techniques. I use this most prevalently with this Emacs configuration. + - [[file:ha-org-literate.org][Literate Programming]] :: functions to support literate programming techniques. I use this with my Emacs configuration. - [[file:ha-org-clipboard.org][Clipboard]] :: automatically converting HTML from a clipboard into Org-formatted content. - [[file:ha-org-journaling.org][Journaling]] :: for writing journal entries and tasks. - [[file:ha-org-publishing.org][Publishing]] :: code for publishing my website, [[http://howardism.org][www.howardism.org]]. @@ -82,3 +82,7 @@ Other functions and files come from essays written on [[http://www.howardism.org #+options: num:nil toc:nil todo:nil tasks:nil tags:nil date:nil #+options: skip:nil author:nil email:nil creator:nil timestamp:nil #+infojs_opt: view:nil toc:t ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js + +# Local Variables: +# jinx-local-words: "bitlbee rcirc supe" +# End: diff --git a/ha-config.org b/ha-config.org index c0e9a60..9945a4f 100644 --- a/ha-config.org +++ b/ha-config.org @@ -1,7 +1,8 @@ -#+title: General Emacs Configuration -#+author: Howard X. Abrams -#+date: 2020-09-10 -#+tags: emacs +#+TITLE: General Emacs Configuration +#+AUTHOR: Howard X. Abrams +#+DATE: 2020-09-10 +#+FILETAGS: emacs +#+STARTUP: inlineimages A literate programming file for configuring Emacs. @@ -24,12 +25,15 @@ A literate programming file for configuring Emacs. ;; ;;; Commentary: ;; - ;; Basic configuration of Emacs. Start early in the loading sequence. + ;; Basic Emacs configuration settings, ran near the beginning of the + ;; loading sequence. ;; ;;; Code: #+end_src * Basic Configuration -I begin configuration of Emacs that isn’t /package-specific/. For instance, I hate to fat-finger a single letter that could stop Emacs: +I begin configuration of Emacs that isn’t /package-specific/. + +I hate to fat-finger a single letter that could stop Emacs: #+begin_src emacs-lisp (setq confirm-kill-emacs 'yes-or-no-p) #+end_src diff --git a/ha-display.org b/ha-display.org index de43e64..9644ace 100644 --- a/ha-display.org +++ b/ha-display.org @@ -22,6 +22,12 @@ A literate programming file to configure the Emacs UI. ;; ~/src/hamacs/ha-display.org ;; Using `find-file-at-point', and tangle the file to recreate this one . ;; + ;;; Commentary: + ;; + ;; Configuration settings related to graphical display. Ran when the setting + ;; `display-graphic-p' is non-nil. Change the fonts, colors and ligatures; + ;; settings unavailable when ran from a Terminal emulator. + ;; ;;; Code: #+end_src @@ -288,19 +294,27 @@ brew tap homebrew/cask-fonts brew install --cask font-hack-nerd-font #+end_src ** Specifying a Font -My /current/ favorite font is actually the top list of fonts that may be installed on my system: + +My /current/ favorite /coding/ font changes often…call me /font-curious/. Since I may/may not have each font installed, I make a list, and pick the first one installed, so I order them: + + - While I like Microsoft’s [[https://github.com/microsoft/cascadia-code][Cascadia]], I’m using [[https://github.com/eliheuer/caskaydia-cove][Caskaydia Cove]] from our beloved [[https://www.nerdfonts.com/font-downloads][NerdFonts]] as it has: + - A dot in the 0 + - Good distinguishing aspects between parens, brackets and braces + - Medium level of ligatures, like -> for arrows, but triple === signs don’t make three lines + - Less serifs mean less letters + - [[https://github.com/emersion/nanum-gothic-coding][Nanum Gothic Coding]] won the [[https://www.codingfont.com][CodingFont Challenge]] for me, like Hack (a fav) but with ligatures + - [[https://github.com/source-foundry/Hack][Hack]] is another favorite, but looses out without ligatures + #+begin_src emacs-lisp (defvar ha-fixed-font (when window-system (or (seq-first (seq-filter (lambda (font) (when (x-list-fonts font) font)) - '("CaskaydiaCove Nerd Font" ; finally found it - ;; funky font with litagures and a dotted 0 - "Cascadia Code PL" - ;; clean font, but no litagures!? - "Hack Nerd Font" - "FiraCode Nerd Font" ; has litagures + '("CaskaydiaCove Nerd Font" ; Best Nerd-based font + "NanumGothicCoding" ; Winner of codingfont.com + "Hack Nerd Font" ; no litagures!? + "FiraCode Nerd Font" ; has too much ligatures "Cousine Nerd Font" "Iosevka Nerd Font" "FantasqueSansMono Nerd Font" @@ -311,21 +325,19 @@ My /current/ favorite font is actually the top list of fonts that may be install "My fixed width font based on what I have installed.") #+end_src -I probably don't need to have such a ranking system, as chances are good I have them all installed. +While I like [[https://www.brailleinstitute.org/freefont/][Atkinson Hyperlegible]] a lot (oh, and [[https://fontesk.com/xcharter-typeface/][Literata]]), I found that [[https://supernotes.app/open-source/sn-pro][SN Pro]] is great for headers as well as matches my monospace font, [[https://github.com/eliheuer/caskaydia-cove/][Caskaydia Cove]]. + #+begin_src emacs-lisp (defvar ha-variable-font (when window-system (or (seq-first (seq-filter (lambda (font) (when (x-list-fonts font) font)) - '("Atkinson Hyperlegible" - "SN Pro" ; https://supernotes.app/open-source/sn-pro - "Literata" ; Clean, readable with litagures - ;; Next best can be downloaded here: - ;; https://fontesk.com/xcharter-typeface/ + '("SN Pro" + "Atkinson Hyperlegible" + "Literata" "XCharter" "Charter" - ;; Interesting idea: "Iosevka Comfy Motion Duo" "Serif"))) (warn "Cannot find a Serif Font. Install Source Sans Pro.")))) diff --git a/ha-theme.org b/ha-theme.org index 4b07842..0bbe13e 100644 --- a/ha-theme.org +++ b/ha-theme.org @@ -252,6 +252,7 @@ Color definition injects the /named/ lists defined above (using Org’s =noweb= ) "A list of named colors available in theme.") #+END_SRC + * Theme Support Stole the following macro from Zenburn, which converts color references defined above, but only within the body of the macro. Sweet way to trim down a lot of boilerplate: @@ -344,13 +345,13 @@ Let’s make a /theme/: `(header-line ((t (:foreground ,almond :background ,inactive :extend t)))) `(help-key-binding ((t (:foreground ,gray-80 :weight ultra-bold)))) `(bold ((t (:foreground ,gray-90 :weight ultra-bold)))) - `(italics ((t (:foreground ,gray-95)))) - `(bold-italic ((t (:foreground "white")))) + `(italics ((t (:foreground ,gray-95 :slant italic)))) + `(bold-italic ((t (:foreground "white" :slant italic :weight ultra-bold)))) `(link ((t (:foreground ,link-color)))) `(link-visited ((t (:foreground ,visited-color)))) - `(font-lock-comment-face ((t (:foreground ,gray-60)))) + `(font-lock-comment-face ((t (:foreground ,gray-60 :slant italic)))) `(font-lock-comment-delimiter-face ((t (:foreground ,gray-50)))) `(font-lock-string-face ((t (:foreground ,gray-75)))) `(font-lock-type-face ((t (:foreground ,green-lt)))) diff --git a/initialize b/initialize index ddecf90..b4e1375 100755 --- a/initialize +++ b/initialize @@ -68,9 +68,9 @@ cat > "$HAMACS_DEST/init.el" <