From 1b81e2178a1dc33fd1e027fc3096cd29a6faa46b Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Fri, 24 Mar 2023 10:58:22 -0700 Subject: [PATCH] Finally got litagures working on my Mac Using a couple of hacks, but I'm keeping Mickey Peterson's project as that seems like a better solution for the Linux system. --- ha-display.org | 15 ++++---- ha-org-word-processor.org | 13 +++++++ ha-org.org | 4 +- ha-programming.org | 81 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 105 insertions(+), 8 deletions(-) diff --git a/ha-display.org b/ha-display.org index da8267d..1a98343 100644 --- a/ha-display.org +++ b/ha-display.org @@ -196,14 +196,16 @@ My /current/ favorite font is actually the top list of fonts that may be install (or (seq-first (seq-filter (lambda (font) (when (x-list-fonts font) font)) - '("Hack Nerd Font" + '("CaskaydiaCove Nerd Font" ; finally found it + "Cascadia Code PL" ; funky font with litagures and a dotted 0 + "Hack Nerd Font" ; clean font, but no litagures!? + "FiraCode Nerd Font" ; has litagures "Cousine Nerd Font" "Iosevka Nerd Font" "Iosevka" "FantasqueSansMono Nerd Font" "Monoid Nerd Font" "Hasklig" - "Cascadia Code PL" "Source Code Pro"))) "monospaced")) "My fixed width font based on what I have installed.") @@ -216,8 +218,10 @@ I probably don't need to have such a ranking system, as chances are good I have (or (seq-first (seq-filter (lambda (font) (when (x-list-fonts font) font)) - '(; Interesting idea: "Iosevka Comfy Motion Duo" + '("Literata" ; Clean, readable with litagures "XCharter" ; https://fontesk.com/xcharter-typeface/ + "Charter" + ; Interesting idea: "Iosevka Comfy Motion Duo" "Serif"))) (warn "Cannot find a Serif Font. Install Source Sans Pro.")))) @@ -367,7 +371,6 @@ Not use what I'm doing with the [[https://github.com/domtronn/all-the-icons.el][ #+end_src *Note:* Install everything with the function, =all-the-icons-install-fonts=. * Ligatures - Seems like getting ligatures to work in Emacs has been a Holy Grail. On Mac, I've used special builds that have hacks, but now with Emacs 27 and Harfbuzz, I should be able to get --> to look like it should. #+begin_src emacs-lisp :tangle no @@ -377,9 +380,7 @@ Seems like getting ligatures to work in Emacs has been a Holy Grail. On Mac, I'v (prettify-symbols-mode +1) #+end_src -Note, in Doom, is appears we have a =ligatures= module. -We'll start using that instead, but changing it in [[file:general-programming.org][general-programming]] file. - +We'll start using that instead, but setting this [[file:ha-programming.org::*Ligatures][over here]] in the programming section. * Technical Artifacts :noexport: Let's =provide= a name so we can =require= this file: diff --git a/ha-org-word-processor.org b/ha-org-word-processor.org index cfaf0a2..b549a00 100644 --- a/ha-org-word-processor.org +++ b/ha-org-word-processor.org @@ -200,6 +200,19 @@ After reading [[https://www.punctuationmatters.com/en-dash-em-dash-hyphen][this (define-key org-mode-map "-" #'ha-insert-long-dash) #+end_src The /issue/ is how do we deal with org’s dashed bullets? In this case, we want to insert an actual dash, but elsewhere, we /visually/ display the dash as a more emphasized glyph. +** Ligatures +Well, using the =composition-function-table=, we can finally get some ligatures to improve readability without Harfbuzz. +#+begin_src emacs-lisp + (defun ha-textual-litagures () + "Non-programming litagures for readable and text-derived modes." + (set-char-table-range composition-function-table + ?f '(["\\(?:ff?[fijlt]\\)" 0 font-shape-gstring])) + (set-char-table-range composition-function-table + ?T '(["\\(?:Th\\)" 0 font-shape-gstring]))) + + (add-hook 'text-mode-hook #'ha-textual-litagures) +#+end_src +This is now fine and ffantastic! * Org Beautify I really want to use the Org Beautify package, but it overrides my darker themes (and all I really want is headlines to behave). diff --git a/ha-org.org b/ha-org.org index a162e04..2514b15 100644 --- a/ha-org.org +++ b/ha-org.org @@ -612,8 +612,10 @@ Splitting out HTML snippets is often a way that I can transfer org-formatted con #+begin_src emacs-lisp (setq org-html-head-extra (string-join '( "