Last modified: 2014-07-15 03:29:18 UTC
Svg output would be nice as it could solve all complaints about transparent background (bug #47444) and rendering size (bug #47523). It's as easy as lilypond ... -dbackend=svg ... and it's _not_ using ghostscript, which is a fantastic step towards world peace.
What about the current --png parameter? $cmd = wfEscapeShellArg( $wgScoreLilyPond ) . ' ' . wfEscapeShellArg( '-dsafe=#t' ) . ' -dbackend=ps --png --header=texidoc ' . wfEscapeShellArg( $factoryLy ) . ' 2>&1';
reedy@ubuntu64-web-esxi:~/git/mediawiki/core$ lilypond --h Usage: lilypond [OPTION]... FILE... Typeset music and/or produce MIDI from FILE. LilyPond produces beautiful music notation. For more information, see http://lilypond.org Options: -d, --define-default=SYM[=VAL] set Scheme option SYM to VAL (default: #t). Use -dhelp for help. -e, --evaluate=EXPR evaluate scheme code -f, --formats=FORMATs dump FORMAT,... Also as separate options: --pdf generate PDF (default) --png generate PNG --ps generate PostScript -h, --help show this help and exit -H, --header=FIELD dump header field FIELD to file named BASENAME.FIELD -I, --include=DIR add DIR to search path -i, --init=FILE use FILE as init file -j, --jail=USER, GROUP, JAIL, DIR chroot to JAIL, become USER:GROUP and cd into DIR -o, --output=FILE write output to FILE (suffix will be added) --relocate relocate using directory of lilypond program -v, --version show version number and exit -V, --verbose be verbose -w, --warranty show warranty and copyright Report bugs via http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs
Well we'll need PNG for old browsers anyway so this'll need some fallback behavior...
@reedy: simply drop it. try: 'reedy$ lilypond -dsafe=#t -dbackend=svg --header=texidoc whatever.ly' (btw I believe you can drop texidoc as well, it's only required for eps) @brion: Indeed, that's the main reason I didn't propose code fragment right away.
Poking at this for a weekend quick hack project.
Did a quick test here: https://gerrit.wikimedia.org/r/#/c/62243/ It's not quite working, at least on my MacBook the SVG files come out corrupt.
Here's an alternate which allows for scaling up the PNG rendering for high-resolution, but doesn't do the fancy srcset stuff. This has the advantage of also looking cleaner in print, but may not scale down cleanly https://gerrit.wikimedia.org/r/#/c/62313/
SVG makes more sense, given the suggestion that we transition quite a bit MW's front-end imagery to SVG for the HiDPI and zooming benefits, and the increasingly-widespread support for and higher-quality rendering of them.
Everybody seems to prefer the SVG idea, so I'll keep working on that. May require either patches to Lilypond or some file manipulation on our end to make things happy. :)
https://gerrit.wikimedia.org/r/#/c/62243/ adds SVG support with png fallback, would be good to get it reviewed.
Change 62243 had a related patch set uploaded by Ebe123: Optional SVG mode with PNG fallback https://gerrit.wikimedia.org/r/62243