1

I want to specify a different font from my default font for runic characters in Emacs.

I tried both:

(set-fontset-font "fontset-default" '(#16a0 . #16ff) "Junicode:Regular")

and

(set-fontset-font "fontset-default" 'runic "Junicode:Regular")

and neither seemed to work. The first reports:

 (invalid-read-syntax "#")

and the latter seems to silently fail.

3
  • 1
    The problem Emacs complains about is that you used #. Characters in Emacs Lisp are just integers, but there's a special syntax to write them, which starts with ? and is followed by the printable version of the character. If you wanted to write a hexadecimal representation, then the proper way of doing it is 16#a0 and 16#ff respectively.
    – wvxvw
    Jul 14, 2015 at 20:11
  • @wvxvw I get the same error if I use 16#a0 and 16#ff. Jul 14, 2015 at 21:50
  • 2
    Sorry, I confused it with Calc, the proper syntax for Emacs Lisp hexadecimal is #xa0 and #xff.
    – wvxvw
    Jul 14, 2015 at 23:54

2 Answers 2

3

You were almost there (note the #x instead of #):

(set-fontset-font "fontset-default" '(#x16a0 . #x16ff) "Junicode:Regular")
1

One solution I found which seems to work is just to install the Emacs unicode-fonts package:

https://github.com/rolandwalker/unicode-fonts

3
  • 1
    You are allowed to accept your own answer. Doing so lets people know that the question is already answered.
    – Drew
    Jul 15, 2015 at 1:25
  • This ends up working, but isn't exactly an answer to the original question. In the sense that it doesn't (immediately) allow a custom specification of a particular font to a particular range. Jul 15, 2015 at 16:17
  • See Clément's answer, which is exactly an answer to the original question. You should accept it.
    – Jim Balter
    Nov 2, 2018 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.