Emacs: Latin to Gothic (𝔤𝔬𝔱𝔥𝔦𝔠)

By Xah Lee. Date: . Last updated: .

For a little fun, xah-convert-latin-alphabet-gothic will replace all English alphabet by Gothic version (aka Blackletter, Fraktur).

gothic letters
gothic letters
(defun xah-convert-latin-alphabet-gothic (@begin @end @reverse-direction-p)
  "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://ergoemacs.org/misc/thou_shalt_use_emacs_lisp.html'
Version 2019-03-07"
   (if (use-region-p)
       (list (region-beginning) (region-end) current-prefix-arg )
     (list (line-beginning-position) (line-end-position) current-prefix-arg )))
  (let (
        ($latin-to-gothic [ ["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" "𝔷"] ])
    (if @reverse-direction-p
        (progn (setq $useMap
                      (lambda ($x)
                        (vector (aref $x 1) (aref $x 0)))
      (progn (setq $useMap $latin-to-gothic)))
        (narrow-to-region @begin @end)
        (let ( (case-fold-search nil))
           (lambda ($x)
             (goto-char (point-min))
             (while (search-forward (elt $x 0) nil t)
               (replace-match (elt $x 1) "FIXEDCASE" "LITERAL")))

Note, you may need proper font to display gothic letters. See:

Math Font, Unicode, Gothic Letters, Double Struck, ℤ ℚ ℝ ℂ ℜ ℑ ℵ

Emacs Lisp, Convert English to Other