andorsk / d2-mode

emacs major mode for d2 graphs
GNU General Public License v3.0
69 stars 8 forks source link

Cask M1 Emacs doesn't ship with SVG render support #8

Open andorsk opened 1 year ago

andorsk commented 1 year ago

M1 Emacs doesn't ship with SVG render support. There are some build flags with libsvg to support rendering in the buffer, but would need to re-install emacs or build from source.

andorsk commented 1 year ago

out of cask, svg is working:

image
andorsk commented 1 year ago

The cask formula just downloads from emacsformacosx, which is part of the problem. https://github.com/Homebrew/homebrew-cask/blob/c5ae3285a70367cd322e56caa61112bed675065f/Casks/emacs.rb

andorsk commented 1 year ago

I installed emacs plus via brew:

brew install emacs-plus --with-imagemagick --with-native-comp --with-mailutils --with-debug --with-dbus --with-ctags

and it confirms to work. There is no fix (AFAIK) to the cask install unless we revisit the entire cask formula or until emacsformac gets updated with a new binary that supports svg.

suliveevil commented 1 year ago

Emacs 30 is better on dealing with SVG (emacs-plus):

GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin22.1.0, NS appkit-2299.00
 Version 13.0.1 (Build 22A400)) of 2022-11-29

emacs-30-svg

andorsk commented 1 year ago

that's awesome.

andorsk commented 1 year ago

@suliveevil I added your working svg into the README! Thanks for providing the screenshot above.

suliveevil commented 1 year ago

I'm glad I could help. 🤗

andorsk commented 1 year ago

19 provides a workaround that should work on most systems.