Emacs: Latin to Gothic (๐”ค๐”ฌ๐”ฑ๐”ฅ๐”ฆ๐” ) ๐Ÿ“œ

By Xah Lee. Date: . Last updated: .

Here's a command to convert English alphabet characters to Gothic (aka Blackletter, Fraktur) characters.

gothic letters
gothic letters

put this in your Emacs Init File:

(defun xah-convert-latin-alphabet-gothic (Begin End ReverseDirectionQ)
  "Replace English alphabets to Unicode gothic characters.
For example, A โ†’ ๐”„, a โ†’ ๐”ž.

When called interactively, work on current line or text selection.

If `universal-argument' is called first, reverse direction.

When called in elisp, the Begin and End are region begin/end positions to work on.

URL `http://xahlee.info/emacs/misc/thou_shalt_use_emacs_lisp.html'
Created: 2019-03-07
Version: 2023-05-12"
  (interactive
   (if (region-active-p)
       (list (region-beginning) (region-end) current-prefix-arg)
     (list (line-beginning-position) (line-end-position) current-prefix-arg)))
  (let ((xgothicMap [ ["A" "๐”„"] ["B" "๐”…"] ["C" "โ„ญ"] ["D" "๐”‡"] ["E" "๐”ˆ"] ["F" "๐”‰"] ["G" "๐”Š"] ["H" "โ„Œ"] ["I" "โ„‘"] ["J" "๐”"] ["K" "๐”Ž"] ["L" "๐”"] ["M" "๐”"] ["N" "๐”‘"] ["O" "๐”’"] ["P" "๐”“"] ["Q" "๐””"] ["R" "โ„œ"] ["S" "๐”–"] ["T" "๐”—"] ["U" "๐”˜"] ["V" "๐”™"] ["W" "๐”š"] ["X" "๐”›"] ["Y" "๐”œ"] ["Z" "โ„จ"] ["a" "๐”ž"] ["b" "๐”Ÿ"] ["c" "๐” "] ["d" "๐”ก"] ["e" "๐”ข"] ["f" "๐”ฃ"] ["g" "๐”ค"] ["h" "๐”ฅ"] ["i" "๐”ฆ"] ["j" "๐”ง"] ["k" "๐”จ"] ["l" "๐”ฉ"] ["m" "๐”ช"] ["n" "๐”ซ"] ["o" "๐”ฌ"] ["p" "๐”ญ"] ["q" "๐”ฎ"] ["r" "๐”ฏ"] ["s" "๐”ฐ"] ["t" "๐”ฑ"] ["u" "๐”ฒ"] ["v" "๐”ณ"] ["w" "๐”ด"] ["x" "๐”ต"] ["y" "๐”ถ"] ["z" "๐”ท"] ])
        xuseMap
        )
    (setq xuseMap
          (if ReverseDirectionQ
              (mapcar
               (lambda (xx)
                 (vector (aref xx 1) (aref xx 0)))
               xgothicMap)
            xgothicMap))
    (save-excursion
      (save-restriction
        (narrow-to-region Begin End)
        (let ((case-fold-search nil))
          (mapc
           (lambda (xx)
             (goto-char (point-min))
             (while (search-forward (elt xx 0) nil t)
               (replace-match (elt xx 1) t t)))
           xuseMap))))))