Subject: bug#35816: 26.2; set-frame-font cannot set some fonts which autocomplete suggests due to dashes in names. I.e. gnu-unifont

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 12 Aug 2021 14:27:49 +0200

Eli Zaretskii <[email-masked]> writes:

> set-frame-font is not the only API that accepts font names, and XLFD
> is not the only format of fonts Emacs accepts

This bug was only about XLFD fonts, though.

> Do the changes you made affect that code in any way

Nope.

> Also, perhaps set-face-font can now accept font names that
> include a dash which not only precedes a numeric size, in which case
> at least the doc string of set-face-font should be amended?

I didn't see anything about dashes in the set-face-font doc string?

> Finally, I think it would be good to have some tests for these issues,
> as much as possible (we cannot set fonts in batch mode, but perhaps
> using lower-level APIs that parse the font spec would allow such
> tests).

I didn't find any Lisp-level interfaces that exposed this yesterday, but
I now see that `(font-spec :name ...)' was what I was looking for, so
I've added a couple of tests.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no