GNU bug report logs - #47074
Replace XPM icons with Unicode codepoints in customize/widgets

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Thu, 11 Mar 2021 16:52:02 UTC

Severity: wishlist

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47074 in the body.
You can then email your comments to 47074 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Thu, 11 Mar 2021 16:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Kangas <stefan <at> marxist.se>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 11 Mar 2021 16:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: bug-gnu-emacs <at> gnu.org
Subject: Replace XPM icons with Unicode codepoints in customize/widgets
Date: Thu, 11 Mar 2021 10:51:19 -0600
Severity: wishlist

In M-x customize, we use the etc/images/{un,}checked.xpm and other
icons. These images do not scale when you increase the font, and (this
is subjective but) generally don't look too good.

I think we could get better result if we used Unicode characters like:

- ☑ checked
- ☐ unchecked
- ▼ or ▾ down triangle
- ▶ or ▸ right triangle

I'm less sure about the look of these but they do exist:

- ⬤ or ◉ or 🔘 radio button selected (the last one was added to Unicode
  in 2015 and gives the hex square here)
- ◯ radio button unselected

Obviously how these look depends on the fonts you have installed.  On my
machine, the "Fira Code" font is used, which makes them look very good.
(They also obviously scale when increasing the font size.)

Perhaps we could prefer Unicode icons if they are available, and fall
back on icons if not.  It seems like we can use `char-displayable-p' to
see if there is any font that can display that codepoint.

If we don't think that will produce consistently improved results, we
could also just add a new option to use Unicode characters.

Thoughts?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Thu, 11 Mar 2021 17:02:01 GMT) Full text and rfc822 format available.

Message #8 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Thu, 11 Mar 2021 18:01:06 +0100
[Message part 1 (text/plain, inline)]
Stefan Kangas <stefan <at> marxist.se> writes:

> I'm less sure about the look of these but they do exist:
>
> - ⬤ or ◉ or 🔘 radio button selected (the last one was added to Unicode
>   in 2015 and gives the hex square here)
> - ◯ radio button unselected

These look like this here:

[Message part 2 (image/png, inline)]
[Message part 3 (text/plain, inline)]
> If we don't think that will produce consistently improved results, we
> could also just add a new option to use Unicode characters.
>
> Thoughts?

I think it's a good idea.

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

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Thu, 11 Mar 2021 17:23:02 GMT) Full text and rfc822 format available.

Message #11 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Thu, 11 Mar 2021 11:22:13 -0600
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> I'm less sure about the look of these but they do exist:
>>
>> - ⬤ or ◉ or 🔘 radio button selected (the last one was added to Unicode
>>   in 2015 and gives the hex square here)
>> - ◯ radio button unselected
>
> These look like this here:

◉ seems to pair well with ◯ here too.  So perhaps that could be a
reasonable choice for the radio buttons.

The 🔘 character is fancy, but I don't know what to use for the
non-selected version (and it doesn't display here, so...).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Thu, 11 Mar 2021 17:29:01 GMT) Full text and rfc822 format available.

Message #14 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Thu, 11 Mar 2021 19:28:11 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Thu, 11 Mar 2021 10:51:19 -0600
> 
> Obviously how these look depends on the fonts you have installed.  On my
> machine, the "Fira Code" font is used, which makes them look very good.

Exactly, so depending on a font to produce good results is not
necessarily a good idea.

> Perhaps we could prefer Unicode icons if they are available, and fall
> back on icons if not.  It seems like we can use `char-displayable-p' to
> see if there is any font that can display that codepoint.

char-displayable-p is expensive, though.  And it does nothing against
the not-so-pretty fonts, of course

So I generally find the idea of using characters for this purpose
problematic; we've seen these problems in other places in Emacs.  Why
not use SVG images instead?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Thu, 11 Mar 2021 17:39:01 GMT) Full text and rfc822 format available.

Message #17 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Thu, 11 Mar 2021 19:38:03 +0200
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Thu, 11 Mar 2021 18:01:06 +0100
> Cc: 47074 <at> debbugs.gnu.org
> 
> > - ⬤ or ◉ or 🔘 radio button selected (the last one was added to Unicode
> >   in 2015 and gives the hex square here)
> > - ◯ radio button unselected
> 
> These look like this here:

With Symbola as the font (which is what we have by default), the
result is much worse than images.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Thu, 11 Mar 2021 17:52:02 GMT) Full text and rfc822 format available.

Message #20 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Thu, 11 Mar 2021 11:51:40 -0600
Eli Zaretskii <eliz <at> gnu.org> writes:

> With Symbola as the font (which is what we have by default), the
> result is much worse than images.

:-/

So I guess using Unicode would need to be optional.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Thu, 11 Mar 2021 17:52:02 GMT) Full text and rfc822 format available.

Message #23 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Thu, 11 Mar 2021 11:51:45 -0600
Eli Zaretskii <eliz <at> gnu.org> writes:

> char-displayable-p is expensive, though.

Could we perhaps cache the results if it is prohibitively slow?

> And it does nothing against the not-so-pretty fonts, of course

This is the bigger problem indeed.

> So I generally find the idea of using characters for this purpose
> problematic; we've seen these problems in other places in Emacs.  Why
> not use SVG images instead?

I think SVG is obviously much preferable to XPM, but there is still the
problem that the images don't scale with the text.  Do we have a general
solution to that?  If not, should we have one?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Thu, 11 Mar 2021 18:05:01 GMT) Full text and rfc822 format available.

Message #26 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Thu, 11 Mar 2021 19:03:48 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

> I think SVG is obviously much preferable to XPM, but there is still the
> problem that the images don't scale with the text.  Do we have a general
> solution to that?  If not, should we have one?

`create-image' does scale the images with the text (by default -- but
perhaps not on all platforms) -- it looks at how big the default font is
and sets :scaling.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Thu, 11 Mar 2021 20:00:02 GMT) Full text and rfc822 format available.

Message #29 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: larsi <at> gnus.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Thu, 11 Mar 2021 21:59:33 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Thu, 11 Mar 2021 11:51:40 -0600
> Cc: 47074 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > With Symbola as the font (which is what we have by default), the
> > result is much worse than images.
> 
> :-/
> 
> So I guess using Unicode would need to be optional.

Yes, I think so.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Thu, 11 Mar 2021 20:02:02 GMT) Full text and rfc822 format available.

Message #32 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Thu, 11 Mar 2021 22:01:11 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Thu, 11 Mar 2021 11:51:45 -0600
> Cc: 47074 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > char-displayable-p is expensive, though.
> 
> Could we perhaps cache the results if it is prohibitively slow?

It isn't prohibitively slow, just slow.

> > So I generally find the idea of using characters for this purpose
> > problematic; we've seen these problems in other places in Emacs.  Why
> > not use SVG images instead?
> 
> I think SVG is obviously much preferable to XPM, but there is still the
> problem that the images don't scale with the text.  Do we have a general
> solution to that?  If not, should we have one?

With SVG, I believe we could.  (We can scale other kinds of images as
well, but they don't look well when enlarged, AFAIK.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Thu, 11 Mar 2021 20:22:02 GMT) Full text and rfc822 format available.

Message #35 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Thu, 11 Mar 2021 22:21:47 +0200
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  47074 <at> debbugs.gnu.org
> Date: Thu, 11 Mar 2021 19:03:48 +0100
> 
> Stefan Kangas <stefan <at> marxist.se> writes:
> 
> > I think SVG is obviously much preferable to XPM, but there is still the
> > problem that the images don't scale with the text.  Do we have a general
> > solution to that?  If not, should we have one?
> 
> `create-image' does scale the images with the text (by default -- but
> perhaps not on all platforms) -- it looks at how big the default font is
> and sets :scaling.

But that doesn't happen in Custom buffers when one enlarges the text
scale, does it?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Thu, 11 Mar 2021 20:28:02 GMT) Full text and rfc822 format available.

Message #38 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Thu, 11 Mar 2021 21:27:08 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> `create-image' does scale the images with the text (by default -- but
>> perhaps not on all platforms) -- it looks at how big the default font is
>> and sets :scaling.
>
> But that doesn't happen in Custom buffers when one enlarges the text
> scale, does it?

Oh, I wasn't thinking about `C-x +' and friends.  No, the images are not
re-scaled by that command.  (Of course, that's something we could decide
to do, though.)

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Thu, 11 Mar 2021 23:51:02 GMT) Full text and rfc822 format available.

Message #41 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Stefan Kangas <stefan <at> marxist.se>, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Thu, 11 Mar 2021 23:49:54 +0000
On Thu, Mar 11, 2021 at 10:01:11PM +0200, Eli Zaretskii wrote:
> > 
> > I think SVG is obviously much preferable to XPM, but there is still the
> > problem that the images don't scale with the text.  Do we have a general
> > solution to that?  If not, should we have one?
> 
> With SVG, I believe we could.  (We can scale other kinds of images as
> well, but they don't look well when enlarged, AFAIK.)

I've been thinking about this, and assuming we can extract the font
name and size from the face in C then we can create a default CSS
stylesheet that should make 1em in an SVG equivalent to the actual
Emacs font height.

It might mean rewriting the code I recently rewrote to extract the
foreground and background colours to just reference the face id, but
that will probably result in even less good image caching than we have
at the moment.

In fact, it's possible to build an SVG within Emacs that contains the
correct font details that will display at the correct size.

Something like this:

(require 'svg)
(let* ((scale (cadr (assoc :height (assoc 'default face-remapping-alist))))
       (height (* (/ (face-attribute 'default :height) 10) (if scale scale 1)))
       (family (face-attribute 'default :family))
       (img (svg-create height height
			:font-size height
			:font-family family)))
  (svg-circle img "0.5em" "0.5em" "0.5em")
  (insert "XX")
  (insert-image (svg-image img :ascent 'center))
  (insert "XX"))

Alas it doesn't resize the image as you scale with C-x C-+.

Perhaps there is some way to mark certain SVGs as part of the UI and
regenerate them?

Yet another alternative is to define a different text property (or
whatever) that only draws SVGs, but on the fly so there's no caching
and we can put them anywhere in the frame. But that might not be a
good idea.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Fri, 12 Mar 2021 00:13:01 GMT) Full text and rfc822 format available.

Message #44 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alan Third <alan <at> idiocy.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Stefan Kangas <stefan <at> marxist.se>,
 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Fri, 12 Mar 2021 01:12:02 +0100
Alan Third <alan <at> idiocy.org> writes:

> In fact, it's possible to build an SVG within Emacs that contains the
> correct font details that will display at the correct size.
>
> Something like this:
>
> (require 'svg)
> (let* ((scale (cadr (assoc :height (assoc 'default face-remapping-alist))))
>        (height (* (/ (face-attribute 'default :height) 10) (if scale scale 1)))
>        (family (face-attribute 'default :family))
>        (img (svg-create height height
> 			:font-size height
> 			:font-family family)))
>   (svg-circle img "0.5em" "0.5em" "0.5em")
>   (insert "XX")
>   (insert-image (svg-image img :ascent 'center))
>   (insert "XX"))

Hm...  Isn't that basically what `image-compute-scaling-factor' does
already, only on the `create-image' level?

> Alas it doesn't resize the image as you scale with C-x C-+.
>
> Perhaps there is some way to mark certain SVGs as part of the UI and
> regenerate them?

Yes, doing so should be easy enough.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Fri, 12 Mar 2021 01:39:02 GMT) Full text and rfc822 format available.

Message #47 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Thu, 11 Mar 2021 19:38:12 -0600
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Oh, I wasn't thinking about `C-x +' and friends.  No, the images are not
> re-scaled by that command.  (Of course, that's something we could decide
> to do, though.)

I think we should do precisely that.  Perhaps one should be able to turn
it off, as it might not always make sense (e.g. in eww buffers?).

How would we go about implementing something like that?  Do we need to
scan the buffer for any images and re-insert them when we change the
font size, or can we just add an image attribute or something?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Fri, 12 Mar 2021 01:44:01 GMT) Full text and rfc822 format available.

Message #50 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Fri, 12 Mar 2021 02:43:03 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Oh, I wasn't thinking about `C-x +' and friends.  No, the images are not
>> re-scaled by that command.  (Of course, that's something we could decide
>> to do, though.)
>
> I think we should do precisely that.  Perhaps one should be able to turn
> it off, as it might not always make sense (e.g. in eww buffers?).

I think it would make sense in eww buffers, too...  probably.  If there
are buffers where this shouldn't happen, we can add a mechanism for
that, though.

> How would we go about implementing something like that?  Do we need to
> scan the buffer for any images and re-insert them when we change the
> font size, or can we just add an image attribute or something?

I think just altering the :scale image attribute would probably do the
trick...  but we can't destructively modify the image objects, I guess,
so re-inserting them is probably necessary...

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Fri, 12 Mar 2021 02:25:01 GMT) Full text and rfc822 format available.

Message #53 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Thu, 11 Mar 2021 20:24:00 -0600
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I think just altering the :scale image attribute would probably do the
> trick...  but we can't destructively modify the image objects, I guess,
> so re-inserting them is probably necessary...

So basically `text-scale-adjust' should search the buffer for any images
and re-insert them with the new size?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Fri, 12 Mar 2021 02:36:01 GMT) Full text and rfc822 format available.

Message #56 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Fri, 12 Mar 2021 03:34:59 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

>> I think just altering the :scale image attribute would probably do the
>> trick...  but we can't destructively modify the image objects, I guess,
>> so re-inserting them is probably necessary...
>
> So basically `text-scale-adjust' should search the buffer for any images
> and re-insert them with the new size?

Yes, I think so.  I haven't actually tried this, but I think it should
be possible...

If the images are large, then this may be slow, but it shouldn't
generate a lot of garbage (since the image data itself in (in case of a
"data" image) should be shared, still.  I think it's worth a try, at
least.  If it turns out to be very slow, then we can start thinking
about mechanisms for marking specific (smaller) icons for rescaling,
while leaving the rest of the images alone.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Fri, 12 Mar 2021 07:28:02 GMT) Full text and rfc822 format available.

Message #59 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Fri, 12 Mar 2021 09:27:01 +0200
> Date: Thu, 11 Mar 2021 23:49:54 +0000
> From: Alan Third <alan <at> idiocy.org>
> Cc: Stefan Kangas <stefan <at> marxist.se>, 47074 <at> debbugs.gnu.org
> 
> I've been thinking about this, and assuming we can extract the font
> name and size from the face in C then we can create a default CSS
> stylesheet that should make 1em in an SVG equivalent to the actual
> Emacs font height.

The font details can be accessed from Lisp as well, if that's more
convenient.

> Alas it doesn't resize the image as you scale with C-x C-+.

Why not? what is preventing that?

> Perhaps there is some way to mark certain SVGs as part of the UI and
> regenerate them?
> 
> Yet another alternative is to define a different text property (or
> whatever) that only draws SVGs, but on the fly so there's no caching
> and we can put them anywhere in the frame. But that might not be a
> good idea.

if these two paragraphs explain why the images currently don't resize
with the text scale, I don't think I follow the reasoning.  Please
elaborate.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Fri, 12 Mar 2021 08:13:01 GMT) Full text and rfc822 format available.

Message #62 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: larsi <at> gnus.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Fri, 12 Mar 2021 10:12:42 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Thu, 11 Mar 2021 19:38:12 -0600
> Cc: 47074 <at> debbugs.gnu.org
> 
> How would we go about implementing something like that?  Do we need to
> scan the buffer for any images and re-insert them when we change the
> font size, or can we just add an image attribute or something?

AFAIR, the display property has a way of reacting to the value of a
symbol's variable cell automatically.  Not sure the image display
property can, too, but it won't do any harm trying.  Keep in mind that
changing the text scale requires redisplaying the buffer, so Emacs
will regenerate the images anyway.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Fri, 12 Mar 2021 18:22:01 GMT) Full text and rfc822 format available.

Message #65 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Stefan Kangas <stefan <at> marxist.se>,
 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Fri, 12 Mar 2021 18:21:24 +0000
On Fri, Mar 12, 2021 at 01:12:02AM +0100, Lars Ingebrigtsen wrote:
> Alan Third <alan <at> idiocy.org> writes:
> 
> > In fact, it's possible to build an SVG within Emacs that contains the
> > correct font details that will display at the correct size.
> >
> > Something like this:
> >
> > (require 'svg)
> > (let* ((scale (cadr (assoc :height (assoc 'default face-remapping-alist))))
> >        (height (* (/ (face-attribute 'default :height) 10) (if scale scale 1)))
> >        (family (face-attribute 'default :family))
> >        (img (svg-create height height
> > 			:font-size height
> > 			:font-family family)))
> >   (svg-circle img "0.5em" "0.5em" "0.5em")
> >   (insert "XX")
> >   (insert-image (svg-image img :ascent 'center))
> >   (insert "XX"))
> 
> Hm...  Isn't that basically what `image-compute-scaling-factor' does
> already, only on the `create-image' level?

Sort of, although this should produce an image that's the exact same
size as the text, which I don't think we can duplicate without making
image-compute-scaling-factor resize much more aggressively. Nor would
we want to, generally.

-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Fri, 12 Mar 2021 18:26:02 GMT) Full text and rfc822 format available.

Message #68 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Fri, 12 Mar 2021 18:25:34 +0000
On Fri, Mar 12, 2021 at 09:27:01AM +0200, Eli Zaretskii wrote:
> > Date: Thu, 11 Mar 2021 23:49:54 +0000
> > From: Alan Third <alan <at> idiocy.org>
> > Cc: Stefan Kangas <stefan <at> marxist.se>, 47074 <at> debbugs.gnu.org
> > 
> > I've been thinking about this, and assuming we can extract the font
> > name and size from the face in C then we can create a default CSS
> > stylesheet that should make 1em in an SVG equivalent to the actual
> > Emacs font height.
> 
> The font details can be accessed from Lisp as well, if that's more
> convenient.

It depends. Doing it at the C level means it Just Works for all SVGs.
That is if you put unstyled text into any SVG it would appear with the
size and font of the surrounding face rather than whatever the librsvg
default setting is.

Doing it in lisp would require a little more care.

> > Alas it doesn't resize the image as you scale with C-x C-+.
> 
> Why not? what is preventing that?

Simply that we're inserting an image and to change it we'd have to
regenerate it. If it were being done as part of a mode (this bug
report is about customize, so in there I guess?) it should be possible
to make it fix it.

> > Perhaps there is some way to mark certain SVGs as part of the UI and
> > regenerate them?
> > 
> > Yet another alternative is to define a different text property (or
> > whatever) that only draws SVGs, but on the fly so there's no caching
> > and we can put them anywhere in the frame. But that might not be a
> > good idea.
> 
> if these two paragraphs explain why the images currently don't resize
> with the text scale, I don't think I follow the reasoning.  Please
> elaborate.

No, I was just listing off the different ways I could think of to make
SVGs appear more coupled to the text.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Fri, 12 Mar 2021 18:38:01 GMT) Full text and rfc822 format available.

Message #71 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Fri, 12 Mar 2021 20:37:40 +0200
> Date: Fri, 12 Mar 2021 18:25:34 +0000
> From: Alan Third <alan <at> idiocy.org>
> Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
> 
> > > Alas it doesn't resize the image as you scale with C-x C-+.
> > 
> > Why not? what is preventing that?
> 
> Simply that we're inserting an image and to change it we'd have to
> regenerate it.

Even if some attributes of the image spec reference variables?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Fri, 12 Mar 2021 18:44:02 GMT) Full text and rfc822 format available.

Message #74 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Fri, 12 Mar 2021 18:43:44 +0000
On Fri, Mar 12, 2021 at 08:37:40PM +0200, Eli Zaretskii wrote:
> > Date: Fri, 12 Mar 2021 18:25:34 +0000
> > From: Alan Third <alan <at> idiocy.org>
> > Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
> > 
> > > > Alas it doesn't resize the image as you scale with C-x C-+.
> > > 
> > > Why not? what is preventing that?
> > 
> > Simply that we're inserting an image and to change it we'd have to
> > regenerate it.
> 
> Even if some attributes of the image spec reference variables?

Yes, it's inserted into the buffer as a simple list, I believe, so
changing the variables doesn't affect the existing image spec.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Fri, 12 Mar 2021 19:28:01 GMT) Full text and rfc822 format available.

Message #77 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: alan <at> idiocy.org, stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Fri, 12 Mar 2021 21:27:00 +0200
> Date: Fri, 12 Mar 2021 18:43:44 +0000
> From: Alan Third <alan <at> idiocy.org>
> Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
> 
> > > Simply that we're inserting an image and to change it we'd have to
> > > regenerate it.
> > 
> > Even if some attributes of the image spec reference variables?
> 
> Yes, it's inserted into the buffer as a simple list, I believe, so
> changing the variables doesn't affect the existing image spec.

We could change that, though.  Like supporting :eval in the spec or
somesuch.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sat, 13 Mar 2021 02:46:02 GMT) Full text and rfc822 format available.

Message #80 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Alan Third <alan <at> idiocy.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Fri, 12 Mar 2021 20:44:55 -0600
[Message part 1 (text/plain, inline)]
Alan Third <alan <at> idiocy.org> writes:

> On Thu, Mar 11, 2021 at 10:01:11PM +0200, Eli Zaretskii wrote:
>> >
>> > I think SVG is obviously much preferable to XPM, but there is still the
>> > problem that the images don't scale with the text.  Do we have a general
>> > solution to that?  If not, should we have one?
>>
>> With SVG, I believe we could.  (We can scale other kinds of images as
>> well, but they don't look well when enlarged, AFAIK.)
>
> I've been thinking about this, and assuming we can extract the font
> name and size from the face in C then we can create a default CSS
> stylesheet that should make 1em in an SVG equivalent to the actual
> Emacs font height.

I took a stab at adding SVG icons, as found in the GNOME Adwaita Icon
Theme.  I had to scrub some color details from the SVG files by hand,
but they now seem to automagically adapt to the :foreground and
:background of the current face (but I could be wrong about that as I
don't understand how this is supposed to work).

How would a patch like the attached relate to the changes you propose,
Alan?
[0001-Add-SVG-icons-for-customize-buffers.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sat, 13 Mar 2021 07:30:02 GMT) Full text and rfc822 format available.

Message #83 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sat, 13 Mar 2021 09:29:00 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Fri, 12 Mar 2021 20:44:55 -0600
> Cc: 47074 <at> debbugs.gnu.org
> 
> @@ -2385,9 +2385,9 @@ 'checkbox
>    ;; We could probably do the same job as the images using single
>    ;; space characters in a boxed face with a stretch specification to
>    ;; make them square.
> -  :on-glyph "checked"
> +  :on-glyph "ui/checkbox-checked"
>    :off "[ ]"
> -  :off-glyph "unchecked"
> +  :off-glyph "ui/checkbox"
>    :help-echo "Toggle this item."
>    :action 'widget-checkbox-action)

How will this work in an Emacs session that doesn't support SVG?  The
images/ui/ directory has only SVG images.  Am I missing something?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sat, 13 Mar 2021 07:48:02 GMT) Full text and rfc822 format available.

Message #86 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sat, 13 Mar 2021 01:47:25 -0600
Eli Zaretskii <eliz <at> gnu.org> writes:

>> @@ -2385,9 +2385,9 @@ 'checkbox
>>    ;; We could probably do the same job as the images using single
>>    ;; space characters in a boxed face with a stretch specification to
>>    ;; make them square.
>> -  :on-glyph "checked"
>> +  :on-glyph "ui/checkbox-checked"
>>    :off "[ ]"
>> -  :off-glyph "unchecked"
>> +  :off-glyph "ui/checkbox"
>>    :help-echo "Toggle this item."
>>    :action 'widget-checkbox-action)
>
> How will this work in an Emacs session that doesn't support SVG?  The
> images/ui/ directory has only SVG images.  Am I missing something?

There are only SVG images in that directory, yes.

IIUC, it would show the :on and :off text on such configurations,
i.e. "[X]" and "[ ]".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sat, 13 Mar 2021 08:38:01 GMT) Full text and rfc822 format available.

Message #89 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sat, 13 Mar 2021 10:37:17 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sat, 13 Mar 2021 01:47:25 -0600
> Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> @@ -2385,9 +2385,9 @@ 'checkbox
> >>    ;; We could probably do the same job as the images using single
> >>    ;; space characters in a boxed face with a stretch specification to
> >>    ;; make them square.
> >> -  :on-glyph "checked"
> >> +  :on-glyph "ui/checkbox-checked"
> >>    :off "[ ]"
> >> -  :off-glyph "unchecked"
> >> +  :off-glyph "ui/checkbox"
> >>    :help-echo "Toggle this item."
> >>    :action 'widget-checkbox-action)
> >
> > How will this work in an Emacs session that doesn't support SVG?  The
> > images/ui/ directory has only SVG images.  Am I missing something?
> 
> There are only SVG images in that directory, yes.
> 
> IIUC, it would show the :on and :off text on such configurations,
> i.e. "[X]" and "[ ]".

That'd be a regression, no?  Can we arrange for the old XPM files to
be used if SVG is not available?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sat, 13 Mar 2021 10:36:02 GMT) Full text and rfc822 format available.

Message #92 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sat, 13 Mar 2021 04:35:43 -0600
Eli Zaretskii <eliz <at> gnu.org> writes:

>> IIUC, it would show the :on and :off text on such configurations,
>> i.e. "[X]" and "[ ]".
>
> That'd be a regression, no?

Are there any systems we care about where librsvg is not available?  Do
we think it is important to support these graphical icons on those
systems?  If the answer is yes to both of these questions, then I guess
we should count it as a regression.

(A priori, I think it sounds okay to expect users to build with librsvg
if they want to have graphical icons.  Presumably/hopefully all
distributions are already doing it.)

> Can we arrange for the old XPM files to be used if SVG is not
> available?

Perhaps fixing this it is as easy as moving/copying the old XPM files to
ui/<newnames>.xpm, but I'd need to test it as I didn't study the code
very closely.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sat, 13 Mar 2021 10:55:01 GMT) Full text and rfc822 format available.

Message #95 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sat, 13 Mar 2021 12:54:38 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sat, 13 Mar 2021 04:35:43 -0600
> Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> IIUC, it would show the :on and :off text on such configurations,
> >> i.e. "[X]" and "[ ]".
> >
> > That'd be a regression, no?
> 
> Are there any systems we care about where librsvg is not available?  Do
> we think it is important to support these graphical icons on those
> systems?  If the answer is yes to both of these questions, then I guess
> we should count it as a regression.

Since librsvg is an _optional_ dependency, IMO the answer is YES by
definition, right?

> > Can we arrange for the old XPM files to be used if SVG is not
> > available?
> 
> Perhaps fixing this it is as easy as moving/copying the old XPM files to
> ui/<newnames>.xpm, but I'd need to test it as I didn't study the code
> very closely.

Yes, I think copying the XPM file would be okay.

Alternatively, we could move and rename the new SVG files.  They are
in a separate directory just because of the license?  If so, I don't
think that's a string enough reason to segregate them, we could just
mention in the README in etc/images that these files (with an explicit
list) are from so-and-so place under such-and-such license.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sat, 13 Mar 2021 11:52:02 GMT) Full text and rfc822 format available.

Message #98 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sat, 13 Mar 2021 05:51:26 -0600
Eli Zaretskii <eliz <at> gnu.org> writes:

> Since librsvg is an _optional_ dependency, IMO the answer is YES by
> definition, right?

OK.

>> Perhaps fixing this it is as easy as moving/copying the old XPM files to
>> ui/<newnames>.xpm, but I'd need to test it as I didn't study the code
>> very closely.
>
> Yes, I think copying the XPM file would be okay.
>
> Alternatively, we could move and rename the new SVG files.  They are
> in a separate directory just because of the license?  If so, I don't
> think that's a string enough reason to segregate them, we could just
> mention in the README in etc/images that these files (with an explicit
> list) are from so-and-so place under such-and-such license.

I mostly placed them there as the old names were to my mind not ideal,
and I hoped we could have something better/more consistent.

Here's a comparison:

    OLD NAME          NEW NAME
    ---------------   ---------------
    checked.xpm       ui/checkbox.svg
    unchecked.xpm     ui/checkbox-checked.svg
    N/A               ui/checkbox-mixed.svg
    N/A               ui/radio-checked.svg
    N/A               ui/radio-mixed.svg
    N/A               ui/radio.svg
    custom/down.xpm   ui/triangle-down.svg   [not yet added]
    N/A               ui/triangle-left.svg   [not yet added]
    custom/right.xpm  ui/triangle-right.svg  [not yet added]
    N/A               ui/triangle-up.svg     [not yet added]




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sat, 13 Mar 2021 16:28:02 GMT) Full text and rfc822 format available.

Message #101 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sat, 13 Mar 2021 18:27:25 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sat, 13 Mar 2021 05:51:26 -0600
> Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
> 
> I mostly placed them there as the old names were to my mind not ideal,
> and I hoped we could have something better/more consistent.
> 
> Here's a comparison:
> 
>     OLD NAME          NEW NAME
>     ---------------   ---------------
>     checked.xpm       ui/checkbox.svg
>     unchecked.xpm     ui/checkbox-checked.svg
>     N/A               ui/checkbox-mixed.svg
>     N/A               ui/radio-checked.svg
>     N/A               ui/radio-mixed.svg
>     N/A               ui/radio.svg
>     custom/down.xpm   ui/triangle-down.svg   [not yet added]
>     N/A               ui/triangle-left.svg   [not yet added]
>     custom/right.xpm  ui/triangle-right.svg  [not yet added]
>     N/A               ui/triangle-up.svg     [not yet added]

I don't think names matter in this case, as no one sees them except
the source code.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sat, 13 Mar 2021 16:45:02 GMT) Full text and rfc822 format available.

Message #104 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sat, 13 Mar 2021 10:44:46 -0600
Eli Zaretskii <eliz <at> gnu.org> writes:

> I don't think names matter in this case, as no one sees them except
> the source code.

If we only consider custom.el I agree completely.  But I was personally
hoping that these "improved" icons will see some use also outside of
custom, including perhaps in third-party packages.  It would be nice to
have these better names for such use.

Would it be okay to just have two names/locations for these XPM files?

(I seem to remember that we can't use symlinks due to our support for
Windows or something?  But perhaps even without symlinking the cost of
duplicating the XPM files is fairly low, as they are only around 1 KiB
each.  The biggest problem would be if someone decides to change these
files (but I see no changes in the last decade, and presumably XPM will
only get less relevant over time).)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sat, 13 Mar 2021 17:03:01 GMT) Full text and rfc822 format available.

Message #107 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sat, 13 Mar 2021 19:02:10 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sat, 13 Mar 2021 10:44:46 -0600
> Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > I don't think names matter in this case, as no one sees them except
> > the source code.
> 
> If we only consider custom.el I agree completely.  But I was personally
> hoping that these "improved" icons will see some use also outside of
> custom, including perhaps in third-party packages.  It would be nice to
> have these better names for such use.

Are they really significantly better?  I fail to see that.

> Would it be okay to just have two names/locations for these XPM files?

Do we have to?

> (I seem to remember that we can't use symlinks due to our support for
> Windows or something?

Symlinks in tarballs are trouble, not only on Windows.

I feel we are again bikeshedding here, sorry.  It's an insignificant
issue from where I stand.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sat, 13 Mar 2021 20:25:02 GMT) Full text and rfc822 format available.

Message #110 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sat, 13 Mar 2021 20:24:04 +0000
On Fri, Mar 12, 2021 at 08:44:55PM -0600, Stefan Kangas wrote:
> Alan Third <alan <at> idiocy.org> writes:
> How would a patch like the attached relate to the changes you propose,
> Alan?

Yes. With a few small changed to the SVG files, and then the ability
to create the CSS file for librsvg, we will be able to make these
icons appear at exactly the same size as the text. Or, if we wanted, a
consistent relation to the text.

I'll have a look and see what I think is the best approach to
generating the CSS.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 14 Mar 2021 13:48:01 GMT) Full text and rfc822 format available.

Message #113 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 14 Mar 2021 13:46:59 +0000
[Message part 1 (text/plain, inline)]
On Fri, Mar 12, 2021 at 08:44:55PM -0600, Stefan Kangas wrote:
> Alan Third <alan <at> idiocy.org> writes:
> 
> > On Thu, Mar 11, 2021 at 10:01:11PM +0200, Eli Zaretskii wrote:
> >> >
> >> > I think SVG is obviously much preferable to XPM, but there is still the
> >> > problem that the images don't scale with the text.  Do we have a general
> >> > solution to that?  If not, should we have one?
> >>
> >> With SVG, I believe we could.  (We can scale other kinds of images as
> >> well, but they don't look well when enlarged, AFAIK.)
> >
> > I've been thinking about this, and assuming we can extract the font
> > name and size from the face in C then we can create a default CSS
> > stylesheet that should make 1em in an SVG equivalent to the actual
> > Emacs font height.
> 
> I took a stab at adding SVG icons, as found in the GNOME Adwaita Icon
> Theme.  I had to scrub some color details from the SVG files by hand,
> but they now seem to automagically adapt to the :foreground and
> :background of the current face (but I could be wrong about that as I
> don't understand how this is supposed to work).
> 
> How would a patch like the attached relate to the changes you propose,
> Alan?

I've attached a proof of concept patch for what I'm talking about.
Stefan's patch must be applied first and it requires at least librsvg
2.48 and might foul up if create-image starts automatically changing
scale (it's fine here).

Does this look like the sort of behaviour you were thinking of, in
terms of icon sizing?
-- 
Alan Third
[0001-Autoresizing-SVG-files-PoC.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 14 Mar 2021 18:45:14 GMT) Full text and rfc822 format available.

Message #116 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Alan Third <alan <at> idiocy.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 14 Mar 2021 13:44:32 -0500
Alan Third <alan <at> idiocy.org> writes:

> I've attached a proof of concept patch for what I'm talking about.
> Stefan's patch must be applied first and it requires at least librsvg
> 2.48 and might foul up if create-image starts automatically changing
> scale (it's fine here).
>
> Does this look like the sort of behaviour you were thinking of, in
> terms of icon sizing?

This is exactly the behavior I was thinking of, yes.  It looks and works
great in some minor testing.

Maybe Lars or Eli have additional comments, but LGTM.

Thank you.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 14 Mar 2021 18:50:01 GMT) Full text and rfc822 format available.

Message #119 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 14 Mar 2021 20:49:30 +0200
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sun, 14 Mar 2021 13:44:32 -0500
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 47074 <at> debbugs.gnu.org
> 
> This is exactly the behavior I was thinking of, yes.  It looks and works
> great in some minor testing.
> 
> Maybe Lars or Eli have additional comments, but LGTM.

The only question I have is what will happen if librsvg is older than
2.48?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 14 Mar 2021 19:38:02 GMT) Full text and rfc822 format available.

Message #122 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Stefan Kangas <stefan <at> marxist.se>, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 14 Mar 2021 19:37:33 +0000
On Sun, Mar 14, 2021 at 08:49:30PM +0200, Eli Zaretskii wrote:
> > From: Stefan Kangas <stefan <at> marxist.se>
> > Date: Sun, 14 Mar 2021 13:44:32 -0500
> > Cc: Eli Zaretskii <eliz <at> gnu.org>, 47074 <at> debbugs.gnu.org
> > 
> > This is exactly the behavior I was thinking of, yes.  It looks and works
> > great in some minor testing.
> > 
> > Maybe Lars or Eli have additional comments, but LGTM.
> 
> The only question I have is what will happen if librsvg is older than
> 2.48?

It will work exactly as it works at the moment. The font size will be
set to the librsvg default, which I think is 16 pixels, so the images
will default to 16 pixels high.

The problem is that librsvg only provided the ability to set a
stylesheet in 2.48, for earlier versions we'd have to wrap the SVG,
similar to what we do at the moment for resizing, but we'd have to
wrap twice with two different wrappers (once to get the original size,
and once to generate the resized image). I'm not actually sure whether
we can reliably get the size of a wrapped image. I'll have to try it I
suppose.

It looks like the stylesheet change was only merged in last year, I
was forgetting this was added so recently.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 14 Mar 2021 19:53:02 GMT) Full text and rfc822 format available.

Message #125 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 14 Mar 2021 21:52:58 +0200
> Date: Sun, 14 Mar 2021 19:37:33 +0000
> From: Alan Third <alan <at> idiocy.org>
> Cc: Stefan Kangas <stefan <at> marxist.se>, 47074 <at> debbugs.gnu.org
> 
> > The only question I have is what will happen if librsvg is older than
> > 2.48?
> 
> It will work exactly as it works at the moment. The font size will be
> set to the librsvg default, which I think is 16 pixels, so the images
> will default to 16 pixels high.

Then that's fine, I think.  Thanks for doing this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Mon, 15 Mar 2021 21:35:01 GMT) Full text and rfc822 format available.

Message #128 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Mon, 15 Mar 2021 21:34:24 +0000
[Message part 1 (text/plain, inline)]
On Sun, Mar 14, 2021 at 09:52:58PM +0200, Eli Zaretskii wrote:
> > Date: Sun, 14 Mar 2021 19:37:33 +0000
> > From: Alan Third <alan <at> idiocy.org>
> > Cc: Stefan Kangas <stefan <at> marxist.se>, 47074 <at> debbugs.gnu.org
> > 
> > > The only question I have is what will happen if librsvg is older than
> > > 2.48?
> > 
> > It will work exactly as it works at the moment. The font size will be
> > set to the librsvg default, which I think is 16 pixels, so the images
> > will default to 16 pixels high.
> 
> Then that's fine, I think.  Thanks for doing this.

Here's my final patch, then. Again Stefan's patch is required first.

I'm somewhat tempted to add a :css image attribute for SVG files to
allow the user to over-ride the default css, but I can do that later.
-- 
Alan Third
[0001-Set-CSS-for-SVG-files.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Tue, 16 Mar 2021 03:30:02 GMT) Full text and rfc822 format available.

Message #131 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Tue, 16 Mar 2021 05:29:21 +0200
> Date: Mon, 15 Mar 2021 21:34:24 +0000
> From: Alan Third <alan <at> idiocy.org>
> Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
> 
> Here's my final patch, then. Again Stefan's patch is required first.

Thanks.  As discussed elsewhere, Stefan's patch will have to be
slightly reworked to allow Emacs without SVG support to display
equivalent images of other formats.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sat, 03 Apr 2021 20:08:01 GMT) Full text and rfc822 format available.

Message #134 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Alan Third <alan <at> idiocy.org>, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sat, 3 Apr 2021 15:06:57 -0500
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Mon, 15 Mar 2021 21:34:24 +0000
>> From: Alan Third <alan <at> idiocy.org>
>> Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
>>
>> Here's my final patch, then. Again Stefan's patch is required first.
>
> Thanks.  As discussed elsewhere, Stefan's patch will have to be
> slightly reworked to allow Emacs without SVG support to display
> equivalent images of other formats.

I have now pushed it to master.  The XPM files are now used when
configuring --without-rsvg, and SVG is used otherwise (the default
case).

Eli insisted on keeping the old file names, so the file names in your
patch will need to be changed accordingly.




Reply sent to Alan Third <alan <at> idiocy.org>:
You have taken responsibility. (Sat, 03 Apr 2021 22:29:01 GMT) Full text and rfc822 format available.

Notification sent to Stefan Kangas <stefan <at> marxist.se>:
bug acknowledged by developer. (Sat, 03 Apr 2021 22:29:01 GMT) Full text and rfc822 format available.

Message #139 received at 47074-done <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 47074-done <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sat, 3 Apr 2021 23:28:35 +0100
On Sat, Apr 03, 2021 at 03:06:57PM -0500, Stefan Kangas wrote:
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> Date: Mon, 15 Mar 2021 21:34:24 +0000
> >> From: Alan Third <alan <at> idiocy.org>
> >> Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
> >>
> >> Here's my final patch, then. Again Stefan's patch is required first.
> >
> > Thanks.  As discussed elsewhere, Stefan's patch will have to be
> > slightly reworked to allow Emacs without SVG support to display
> > equivalent images of other formats.
> 
> I have now pushed it to master.  The XPM files are now used when
> configuring --without-rsvg, and SVG is used otherwise (the default
> case).
> 
> Eli insisted on keeping the old file names, so the file names in your
> patch will need to be changed accordingly.

I've pushed a change up, so hopefully it should all Just Work now.

Thanks!
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 06:57:02 GMT) Full text and rfc822 format available.

Message #142 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 04 Apr 2021 09:55:53 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sat, 3 Apr 2021 15:06:57 -0500
> Cc: Alan Third <alan <at> idiocy.org>, 47074 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> Date: Mon, 15 Mar 2021 21:34:24 +0000
> >> From: Alan Third <alan <at> idiocy.org>
> >> Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
> >>
> >> Here's my final patch, then. Again Stefan's patch is required first.
> >
> > Thanks.  As discussed elsewhere, Stefan's patch will have to be
> > slightly reworked to allow Emacs without SVG support to display
> > equivalent images of other formats.
> 
> I have now pushed it to master.  The XPM files are now used when
> configuring --without-rsvg, and SVG is used otherwise (the default
> case).

Thanks.  How can this new feature be tested?  That is, how can I be
sure my Emacs indeed loads the SVG images when they are available?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 09:22:01 GMT) Full text and rfc822 format available.

Message #145 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 4 Apr 2021 04:21:09 -0500
Eli Zaretskii <eliz <at> gnu.org> writes:

>> I have now pushed it to master.  The XPM files are now used when
>> configuring --without-rsvg, and SVG is used otherwise (the default
>> case).
>
> Thanks.  How can this new feature be tested?  That is, how can I be
> sure my Emacs indeed loads the SVG images when they are available?

I have tested it using `M-x customize-face RET menu RET' and then "Show
all attributes".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 09:22:02 GMT) Full text and rfc822 format available.

Message #148 received at 47074-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Alan Third <alan <at> idiocy.org>
Cc: 47074-done <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 4 Apr 2021 04:21:16 -0500
Alan Third <alan <at> idiocy.org> writes:

> I've pushed a change up, so hopefully it should all Just Work now.

It works perfectly, thank you!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 11:14:02 GMT) Full text and rfc822 format available.

Message #151 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 04 Apr 2021 14:13:22 +0300
[Message part 1 (text/plain, inline)]
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sun, 4 Apr 2021 04:21:09 -0500
> Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> I have now pushed it to master.  The XPM files are now used when
> >> configuring --without-rsvg, and SVG is used otherwise (the default
> >> case).
> >
> > Thanks.  How can this new feature be tested?  That is, how can I be
> > sure my Emacs indeed loads the SVG images when they are available?
> 
> I have tested it using `M-x customize-face RET menu RET' and then "Show
> all attributes".

Thanks.  The results on my system are much worse than the XPM images,
see the two attached screenshots.

[SVG-widgets.PNG (image/png, attachment)]
[XPM-widgets.PNG (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 11:38:01 GMT) Full text and rfc822 format available.

Message #154 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 04 Apr 2021 14:37:12 +0300
> Date: Sat, 3 Apr 2021 23:28:35 +0100
> From: Alan Third <alan <at> idiocy.org>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 47074-done <at> debbugs.gnu.org
> 
> I've pushed a change up, so hopefully it should all Just Work now.

Alan, this patch calls malloc to allocate face_font_family, but then
calls xfree to free it.  Why didn't you call xmalloc to allocate?
that's currently the only caller of malloc in the entire image.c.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 11:39:02 GMT) Full text and rfc822 format available.

Message #157 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Stefan Kangas <stefan <at> marxist.se>, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 4 Apr 2021 12:37:58 +0100
On Sun, Apr 04, 2021 at 02:13:22PM +0300, Eli Zaretskii wrote:
> > From: Stefan Kangas <stefan <at> marxist.se>
> > Date: Sun, 4 Apr 2021 04:21:09 -0500
> > Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
> > 
> > Eli Zaretskii <eliz <at> gnu.org> writes:
> > 
> > >> I have now pushed it to master.  The XPM files are now used when
> > >> configuring --without-rsvg, and SVG is used otherwise (the default
> > >> case).
> > >
> > > Thanks.  How can this new feature be tested?  That is, how can I be
> > > sure my Emacs indeed loads the SVG images when they are available?
> > 
> > I have tested it using `M-x customize-face RET menu RET' and then "Show
> > all attributes".
> 
> Thanks.  The results on my system are much worse than the XPM images,
> see the two attached screenshots.

Something is going wrong with the rendering of the SVGs. It looks as
though the background is offset, and the background and foreground
colours are backwards.

What version of librsvg do you have?
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 11:40:02 GMT) Full text and rfc822 format available.

Message #160 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: alan <at> idiocy.org, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 4 Apr 2021 06:39:21 -0500
Eli Zaretskii <eliz <at> gnu.org> writes:

> Thanks.  The results on my system are much worse than the XPM images,
> see the two attached screenshots.

Yes, that looks really bad.

Does anyone have any idea why this would happen on MS-Windows?

One workaround that comes to mind would be to make this system
dependent, but it would be better if we could find a proper fix.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 11:45:02 GMT) Full text and rfc822 format available.

Message #163 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 4 Apr 2021 12:44:00 +0100
On Sun, Apr 04, 2021 at 02:37:12PM +0300, Eli Zaretskii wrote:
> > Date: Sat, 3 Apr 2021 23:28:35 +0100
> > From: Alan Third <alan <at> idiocy.org>
> > Cc: Eli Zaretskii <eliz <at> gnu.org>, 47074-done <at> debbugs.gnu.org
> > 
> > I've pushed a change up, so hopefully it should all Just Work now.
> 
> Alan, this patch calls malloc to allocate face_font_family, but then
> calls xfree to free it.  Why didn't you call xmalloc to allocate?
> that's currently the only caller of malloc in the entire image.c.

I originally used malloc, then realised every other call is to xmalloc
and thought I'd fixed them all.

This change appears to have been particularly bad, apologies to
everyone for the mess I've caused.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 11:49:01 GMT) Full text and rfc822 format available.

Message #166 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: alan <at> idiocy.org, stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 04 Apr 2021 14:48:29 +0300
> Date: Sun, 4 Apr 2021 12:37:58 +0100
> From: Alan Third <alan <at> idiocy.org>
> Cc: Stefan Kangas <stefan <at> marxist.se>, 47074 <at> debbugs.gnu.org
> 
> > Thanks.  The results on my system are much worse than the XPM images,
> > see the two attached screenshots.
> 
> Something is going wrong with the rendering of the SVGs. It looks as
> though the background is offset, and the background and foreground
> colours are backwards.
> 
> What version of librsvg do you have?

2.40.1.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 11:57:01 GMT) Full text and rfc822 format available.

Message #169 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 04 Apr 2021 14:55:41 +0300
> Date: Sun, 4 Apr 2021 12:44:00 +0100
> From: Alan Third <alan <at> idiocy.org>
> Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
> 
> > Alan, this patch calls malloc to allocate face_font_family, but then
> > calls xfree to free it.  Why didn't you call xmalloc to allocate?
> > that's currently the only caller of malloc in the entire image.c.
> 
> I originally used malloc, then realised every other call is to xmalloc
> and thought I'd fixed them all.

OK, I fixed.

> This change appears to have been particularly bad, apologies to
> everyone for the mess I've caused.

No need to apologize, thanks for your work.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 12:39:01 GMT) Full text and rfc822 format available.

Message #172 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: alan <at> idiocy.org, stefan <at> marxist.se,	47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 04 Apr 2021 15:38:25 +0300
[Message part 1 (text/plain, inline)]
> Date: Sun, 04 Apr 2021 14:48:29 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: alan <at> idiocy.org, stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
> 
> > Something is going wrong with the rendering of the SVGs. It looks as
> > though the background is offset, and the background and foreground
> > colours are backwards.
> > 
> > What version of librsvg do you have?
> 
> 2.40.1.

To maybe facilitate the investigation of this issue, I attach 3 more
images created from checked.svg, with scale of 2, 5, and 10.  Note the
significant change between 2 and 5:

[SVG-widgets2.PNG (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 13:15:02 GMT) Full text and rfc822 format available.

Message #175 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 4 Apr 2021 14:14:48 +0100
[Message part 1 (text/plain, inline)]
On Sun, Apr 04, 2021 at 02:48:29PM +0300, Eli Zaretskii wrote:
> > Date: Sun, 4 Apr 2021 12:37:58 +0100
> > From: Alan Third <alan <at> idiocy.org>
> > Cc: Stefan Kangas <stefan <at> marxist.se>, 47074 <at> debbugs.gnu.org
> > 
> > > Thanks.  The results on my system are much worse than the XPM images,
> > > see the two attached screenshots.
> > 
> > Something is going wrong with the rendering of the SVGs. It looks as
> > though the background is offset, and the background and foreground
> > colours are backwards.
> > 
> > What version of librsvg do you have?
> 
> 2.40.1.

I can see something similar, but not exactly the same, on one of my
build virtual machines running 2.40.5. That particular problem looks
like an rsvg bug, since rsvg-view-3 displays it the same way.

It appears to be this (and one other related problem):

    https://github.com/svg/svgo/issues/822

I've reformatted the svg files so they display correctly here, but can
you please check that the attached patch fixes the problem for you as
well?
-- 
Alan Third
[0001-Work-around-librsvg-bug-bug-47074.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 13:16:01 GMT) Full text and rfc822 format available.

Message #178 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 4 Apr 2021 14:15:49 +0100
On Sun, Apr 04, 2021 at 03:38:25PM +0300, Eli Zaretskii wrote:
> > Date: Sun, 04 Apr 2021 14:48:29 +0300
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > Cc: alan <at> idiocy.org, stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
> > 
> > > Something is going wrong with the rendering of the SVGs. It looks as
> > > though the background is offset, and the background and foreground
> > > colours are backwards.
> > > 
> > > What version of librsvg do you have?
> > 
> > 2.40.1.
> 
> To maybe facilitate the investigation of this issue, I attach 3 more
> images created from checked.svg, with scale of 2, 5, and 10.  Note the
> significant change between 2 and 5:

Ah yes, that definitely looks like the problem mentioned in my other
email. Thanks.

-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 13:17:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 13:23:01 GMT) Full text and rfc822 format available.

Message #184 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 04 Apr 2021 16:22:19 +0300
> Date: Sun, 4 Apr 2021 14:14:48 +0100
> From: Alan Third <alan <at> idiocy.org>
> Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
> 
> > 2.40.1.
> 
> I can see something similar, but not exactly the same, on one of my
> build virtual machines running 2.40.5. That particular problem looks
> like an rsvg bug, since rsvg-view-3 displays it the same way.
> 
> It appears to be this (and one other related problem):
> 
>     https://github.com/svg/svgo/issues/822
> 
> I've reformatted the svg files so they display correctly here, but can
> you please check that the attached patch fixes the problem for you as
> well?

Thanks, this indeed fixes the problem here.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 13:29:02 GMT) Full text and rfc822 format available.

Message #187 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 4 Apr 2021 14:28:25 +0100
On Sun, Apr 04, 2021 at 04:22:19PM +0300, Eli Zaretskii wrote:
> > Date: Sun, 4 Apr 2021 14:14:48 +0100
> > From: Alan Third <alan <at> idiocy.org>
> > Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
> > 
> > > 2.40.1.
> > 
> > I can see something similar, but not exactly the same, on one of my
> > build virtual machines running 2.40.5. That particular problem looks
> > like an rsvg bug, since rsvg-view-3 displays it the same way.
> > 
> > It appears to be this (and one other related problem):
> > 
> >     https://github.com/svg/svgo/issues/822
> > 
> > I've reformatted the svg files so they display correctly here, but can
> > you please check that the attached patch fixes the problem for you as
> > well?
> 
> Thanks, this indeed fixes the problem here.

Thanks. I've pushed it to master.

Hopefully that's the last problem we find here. :)
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47074; Package emacs. (Sun, 04 Apr 2021 13:37:02 GMT) Full text and rfc822 format available.

Message #190 received at 47074 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
Subject: Re: bug#47074: Replace XPM icons with Unicode codepoints in
 customize/widgets
Date: Sun, 04 Apr 2021 16:36:20 +0300
> Date: Sun, 4 Apr 2021 14:28:25 +0100
> From: Alan Third <alan <at> idiocy.org>
> Cc: stefan <at> marxist.se, 47074 <at> debbugs.gnu.org
> 
> > >     https://github.com/svg/svgo/issues/822
> > > 
> > > I've reformatted the svg files so they display correctly here, but can
> > > you please check that the attached patch fixes the problem for you as
> > > well?
> > 
> > Thanks, this indeed fixes the problem here.
> 
> Thanks. I've pushed it to master.

Thank you.

Btw, since the SVG icons look quite differently from the XPM ones,
should we perhaps have a user options for preferring one type over the
other when both are available?  What do people think?

In any case, this change should be called out in NEWS, I think, as the
visual difference is prominent.

> Hopefully that's the last problem we find here. :)

Famous last words ;-)




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 03 May 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 358 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.