Skip to content

Managing structured SVG (with external elements)

Jim Allman edited this page Jul 3, 2016 · 5 revisions

How can we safely construct SVGs with external links (for fonts, images, ornaments) to

  • maintain good performance in the editor;
  • guarantee faithful rendering in a browser and the printed page;
  • safely store all elements in peyotl (as a "folderish" type);
  • and keepall elements in other persistence stores, e.g. in a Jupyter notebook?

Should we stick to remote URLs (to web fonts, etc) in some of these use cases? Perhaps there's an explicit "bundling" step that would gather all resources in a single folder/resource. This should work, since it appears SVG will happily use relative URLs in all cases.

See related links here, esp. under "Handling external resources"

Pre-render a PDF version as the ultimate "safety" format for absolute fidelity?

This might be auto-generated (on saves) and stored by convention, presumably in the main bundle folder.

Let the user toggle between local (bundled) resources and remote URLs on the web?

This might be done to save space (unlikely), or to take advantage of changes to resources like PhyloPic. N.B. images can also be embedded directly in the SVG file, but this is almost certainly the Wrong Thing To Do.

Are there resources we can't legally copy into a bundled illustration?

Copyrighted web fonts? PhyloPic images? Copyrighted images?

What would a typical journal expect/demand?

I assume their priorities include fidelity and offline use. Again, maybe a PDF is the ultimate solution here.