GNU bug report logs -
#35816
26.2; set-frame-font cannot set some fonts which autocomplete suggests due to dashes in names. I.e. gnu-unifont
Previous Next
Reported by: Vladimir Nikishkin <lockywolf <at> gmail.com>
Date: Tue, 21 May 2019 02:07:01 UTC
Severity: normal
Found in version 26.2
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Wed, 11 Aug 2021 22:04:37 +0200
> Cc: Vladimir Nikishkin <lockywolf <at> gmail.com>, 35816 <at> debbugs.gnu.org
>
> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
> > Thanks! After an "apt install fonts-mikachan" I can now reproduce the
> > problem on this Debian/bullseye system, too, and I'll try to see whether
> > I can come up with a solution.
>
> And I've now made font_parse_xlfd try harder to make sense of font names
> like:
>
> (set-frame-font "-Take-mikachan-puchi-normal-normal-normal-*-*-*-*-*-*-0-iso10646-1")
>
> I've tried to be as backwards-compatible as possible -- only trying to
> interpret this as a family name of "mikachan-puchi" is parsing it the
> normal way fails.
Thanks.
set-frame-font is not the only API that accepts font names, and XLFD
is not the only format of fonts Emacs accepts (see the node "Fonts" in
the Emacs user manual for description of all of the forms users can
specify a font). Another important API that accepts font names is
set-face-font, and you will see that there's already some heuristics
in set-face-attribute to support the likes of "Courier-10", which is a
Fontconfig format of specifying a font family. (The log message for
the change which allowed such font families to be supported includes a
URL where you will be able to find a test case for that.) Do the
changes you made affect that code in any way, i.e. does that code
still work (looks like it does in my limited testing, but I cannot
test the full Fontconfig format here, and neither can I test the GTK
format). 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?
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).
This bug report was last modified 3 years and 281 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.