[racket] Generating svg-images rather than png-images from Scribble

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Mon Oct 14 12:10:18 EDT 2013

Sam writes:
> That suggests that everything later than IE 8 works.  I don't think we
> should try to support a browser that even Google Apps doesn't support
> any more.

I have committed a patch that enables Scribble to generate svgs
instead of pngs for picts.
There are some differences between the way svgs and pngs behave in the browser
(I have only tested in Chrome so far), so I have made pngs the default.

There differences are:
   - right clicking on an svg image doesn't allow you to save the image only
     (Chrome want's to save the entire page)
   - the size of svgs are slightly larger than pngs
     Even though I remove "pt" from, see:
     (http://lists.racket-lang.org/users/archive/2011-January/043806.html)

The parameter that controls whether pngs or svgs are being used is called
current-html-render-pict-as. I am not completely sure the way I added
the parameter is The Right Way, so speak up, if there is another way.

A test file to try:

#lang scribble/base
@current-html-render-pict-as['svg]
@(require pict)
@(standard-fish 100 100)


https://github.com/plt/racket/commit/5ed686d9911b9f0d1cb1d5cb58d6950e33b9d17c


/Jens Axel

Posted on the users mailing list.