* bug#61974: 29.0.60; customize checkbox and radio widgets don't render on macOS
@ 2023-03-05 1:35 David Caldwell
2023-03-05 6:25 ` Eli Zaretskii
0 siblings, 1 reply; 6+ messages in thread
From: David Caldwell @ 2023-03-05 1:35 UTC (permalink / raw)
To: 61974
To reproduce:
M-x customize-face RET bold RET
It can be any face, that's just an example. In the customize buffer
click or select the "Show All Attributes" button/link at the bottom. The
attributes should have checkboxes in checked or unchecked states but
none show up. Here's a screenshot (the cyan square is my cursor over
where a checkbox should be rendered):
https://porkrind.org/tmp/emacs29-customize-bug-macos.png
This happens in radio buttons too, but I don't know which
customize setting use those.
This also happens in Emacs 28. I have not tried the master branch yet.
I tried to track this down and found that even inserting the checkbox
image fails, though I can insert other SVGs:
Fails:
(insert-image (find-image '((:file "checked.svg"))))
Works:
(insert-image (find-image '((:file "splash.svg"))))
It appears to be because the checkbox and radio svgs in etc/images all
use height="1em" and the mac native renderer doesn't like that.
It works with rsvg because the emacs code that interfaces with rsvg code
passes some extra styling info to it so that it can render that properly
(image.c:11226 in the emacs-29 branch for me today).
Unfortunately the native renderer in nsimage.m doesn't do this. I spent
some time today trying to figure it out, but it appears that the cocoa
apis just don't have this feature, so it would have to be done some
other way.
I can confirm this is the issue by opening "etc/images/checked.svg",
hitting "C-c C-c" to edit, changing the "1em" to "16" and "C-c C-c"ing
again to re-render it. It will appear with a non-percentage height.
I really wanted to suggest a fix or a patch, but I'm stuck because I
don't want to flat out turn off svgs on macOS, but I also don't want to
get rid of the nice scaling that librsvg supports. Maybe nsimage.m
should load the svg into memory, check for width or height being "1em"
and manually changing it to something concrete before passing it to the
OS? Yuck, but also it would probably work.
-David
In GNU Emacs 29.0.60 (build 1, aarch64-apple-darwin22.1.0, NS
appkit-2299.00 Version 13.0.1 (Build 22A400)) of 2023-03-04 built on
black.local
Repository revision: bd5115e13479b1d81d6aa09efe362ad14d53c3c6
Repository branch: emacs-29
Windowing system distributor 'Apple', version 10.3.2299
System Description: macOS 13.0.1
Configured features:
ACL DBUS GIF GMP GNUTLS JPEG LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS
PDUMPER PNG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP
XIM ZLIB
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Custom
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date subr-x crm
thingatpt cus-edit pp cus-start cus-load icons wid-edit cl-loaddefs
cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind kqueue cocoa ns
lcms2 multi-tty make-network-process emacs)
Memory information:
((conses 16 68647 5810)
(symbols 48 7188 0)
(strings 32 18140 1297)
(string-bytes 1 468742)
(vectors 16 11324)
(vector-slots 8 174536 16175)
(floats 8 38 31)
(intervals 56 1508 3)
(buffers 984 13))
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#61974: 29.0.60; customize checkbox and radio widgets don't render on macOS
2023-03-05 1:35 bug#61974: 29.0.60; customize checkbox and radio widgets don't render on macOS David Caldwell
@ 2023-03-05 6:25 ` Eli Zaretskii
2023-03-05 8:01 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2023-03-05 6:25 UTC (permalink / raw)
To: David Caldwell; +Cc: 61974
> Date: Sat, 4 Mar 2023 17:35:16 -0800
> From: David Caldwell <david@porkrind.org>
>
> Fails:
>
> (insert-image (find-image '((:file "checked.svg"))))
>
> Works:
>
> (insert-image (find-image '((:file "splash.svg"))))
>
> It appears to be because the checkbox and radio svgs in etc/images all
> use height="1em" and the mac native renderer doesn't like that.
>
> It works with rsvg because the emacs code that interfaces with rsvg code
> passes some extra styling info to it so that it can render that properly
> (image.c:11226 in the emacs-29 branch for me today).
>
> Unfortunately the native renderer in nsimage.m doesn't do this. I spent
> some time today trying to figure it out, but it appears that the cocoa
> apis just don't have this feature, so it would have to be done some
> other way.
>
> I can confirm this is the issue by opening "etc/images/checked.svg",
> hitting "C-c C-c" to edit, changing the "1em" to "16" and "C-c C-c"ing
> again to re-render it. It will appear with a non-percentage height.
Does it work to use the checked.xpm image instead? If it does,
perhaps we should switch the macOS build to using the XPM images
(assuming the problem you report is common to all macOS builds, that
is).
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#61974: 29.0.60; customize checkbox and radio widgets don't render on macOS
2023-03-05 6:25 ` Eli Zaretskii
@ 2023-03-05 8:01 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-05 8:26 ` Eli Zaretskii
0 siblings, 1 reply; 6+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-03-05 8:01 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 61974, David Caldwell
Eli Zaretskii <eliz@gnu.org> writes:
>> Date: Sat, 4 Mar 2023 17:35:16 -0800
>> From: David Caldwell <david@porkrind.org>
>>
>> Fails:
>>
>> (insert-image (find-image '((:file "checked.svg"))))
>>
>> Works:
>>
>> (insert-image (find-image '((:file "splash.svg"))))
>>
>> It appears to be because the checkbox and radio svgs in etc/images all
>> use height="1em" and the mac native renderer doesn't like that.
>>
>> It works with rsvg because the emacs code that interfaces with rsvg code
>> passes some extra styling info to it so that it can render that properly
>> (image.c:11226 in the emacs-29 branch for me today).
>>
>> Unfortunately the native renderer in nsimage.m doesn't do this. I spent
>> some time today trying to figure it out, but it appears that the cocoa
>> apis just don't have this feature, so it would have to be done some
>> other way.
>>
>> I can confirm this is the issue by opening "etc/images/checked.svg",
>> hitting "C-c C-c" to edit, changing the "1em" to "16" and "C-c C-c"ing
>> again to re-render it. It will appear with a non-percentage height.
>
> Does it work to use the checked.xpm image instead? If it does,
> perhaps we should switch the macOS build to using the XPM images
> (assuming the problem you report is common to all macOS builds, that
> is).
Shouldn't we disable SVG display with native image APIs instead?
In general, the native image API code we have at present cannot
display SVG images as well as librsvg, because it cannot know the
scale at which the image will be displayed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#61974: 29.0.60; customize checkbox and radio widgets don't render on macOS
2023-03-05 8:01 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-03-05 8:26 ` Eli Zaretskii
2023-03-05 10:42 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2023-03-05 8:26 UTC (permalink / raw)
To: Po Lu; +Cc: 61974, david
> From: Po Lu <luangruo@yahoo.com>
> Cc: David Caldwell <david@porkrind.org>, 61974@debbugs.gnu.org
> Date: Sun, 05 Mar 2023 16:01:10 +0800
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> Date: Sat, 4 Mar 2023 17:35:16 -0800
> >> From: David Caldwell <david@porkrind.org>
> >>
> >> Fails:
> >>
> >> (insert-image (find-image '((:file "checked.svg"))))
> >>
> >> Works:
> >>
> >> (insert-image (find-image '((:file "splash.svg"))))
> >>
> >> It appears to be because the checkbox and radio svgs in etc/images all
> >> use height="1em" and the mac native renderer doesn't like that.
> >>
> >> It works with rsvg because the emacs code that interfaces with rsvg code
> >> passes some extra styling info to it so that it can render that properly
> >> (image.c:11226 in the emacs-29 branch for me today).
> >>
> >> Unfortunately the native renderer in nsimage.m doesn't do this. I spent
> >> some time today trying to figure it out, but it appears that the cocoa
> >> apis just don't have this feature, so it would have to be done some
> >> other way.
> >>
> >> I can confirm this is the issue by opening "etc/images/checked.svg",
> >> hitting "C-c C-c" to edit, changing the "1em" to "16" and "C-c C-c"ing
> >> again to re-render it. It will appear with a non-percentage height.
> >
> > Does it work to use the checked.xpm image instead? If it does,
> > perhaps we should switch the macOS build to using the XPM images
> > (assuming the problem you report is common to all macOS builds, that
> > is).
>
> Shouldn't we disable SVG display with native image APIs instead?
> In general, the native image API code we have at present cannot
> display SVG images as well as librsvg, because it cannot know the
> scale at which the image will be displayed.
My impression was that such a conclusion would be too drastic, as many
SVG images can undoubtedly be displayed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#61974: 29.0.60; customize checkbox and radio widgets don't render on macOS
2023-03-05 8:26 ` Eli Zaretskii
@ 2023-03-05 10:42 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-05 20:26 ` David Caldwell
0 siblings, 1 reply; 6+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-03-05 10:42 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 61974, david
Eli Zaretskii <eliz@gnu.org> writes:
> My impression was that such a conclusion would be too drastic, as many
> SVG images can undoubtedly be displayed.
I don't know... Emacs code has never been prepared for native SVG
display before, as this is a new feature in Mac OS.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#61974: 29.0.60; customize checkbox and radio widgets don't render on macOS
2023-03-05 10:42 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-03-05 20:26 ` David Caldwell
0 siblings, 0 replies; 6+ messages in thread
From: David Caldwell @ 2023-03-05 20:26 UTC (permalink / raw)
To: Po Lu, Eli Zaretskii; +Cc: 61974
On 3/5/23 2:42 AM, Po Lu wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
>
>> My impression was that such a conclusion would be too drastic, as many
>> SVG images can undoubtedly be displayed.
>
> I don't know... Emacs code has never been prepared for native SVG
> display before, as this is a new feature in Mac OS.
The splash screen renders nicely, at least.
I poked around a little more and found that the OS seems to be just
ignoring the "em" in "height=1em" and setting its height to 1. I thought
maybe if I forced the image height to something reasonable that it would
render but it doesn't change anything--still just a blank image.
One thought I had was that maybe Emacs is approaching this
backward—currently the widget code says "please draw the checkbox here"
and the checkbox svg says "I should be one lineheight high please". What
if it instead the widget code said "Please draw the checkbox image here
with the height of my line" and the image said nothing.
The complication there is that you probably don't want to scale
non-vector images.
But that also is kind of a drastic change.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-03-05 20:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-05 1:35 bug#61974: 29.0.60; customize checkbox and radio widgets don't render on macOS David Caldwell
2023-03-05 6:25 ` Eli Zaretskii
2023-03-05 8:01 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-05 8:26 ` Eli Zaretskii
2023-03-05 10:42 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-05 20:26 ` David Caldwell
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.