𝔗𝔥𝔬𝔲 𝔖𝔥𝔞𝔩𝔱 𝔘𝔰𝔢 𝔈𝔪𝔞𝔠𝔰 𝔏𝔦𝔰𝔭 Convert Latin Alphabet to Gothic

By Xah Lee. Date: . Last updated: .
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 any `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 2017-01-11"
   (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, ℤ ℚ ℝ ℂ ℜ ℑ ℵ

this post is inspired by a post i saw on g+ at https://plus.google.com/103112149634414554669/posts/V7zxyRYg2EB

Like it? Buy Xah Emacs Tutorial. Thanks.