Opened 9 years ago

Closed 3 years ago

#11006 closed enhancement (patchwelcome)

SVG Text -> GFX surface conversion API

Reported by: liyang Owned by: Eugene Lazutkin
Priority: high Milestone: 1.13
Component: DojoX GFX Version: 1.4.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Eugene Lazutkin)

In dojox.gfx.utils there is a toSvg() API that concerts a GFX surface (whether it is VML based, or SVG, or even canvas), to SVG by creative use of the SVG render code. It would be really cool if there was an inverse API take SVG Text and convert it back to a GFX surface. Preferably without using XSLT.

The benefit of this would be:

1.) Pulling in a document into dijit.Editor that has inline SVG and being able to bind GFX to the inline SVG and manipulate it.

2.) Being able to load an SVG scene from a file (via xhr), and construct a GFX object from it that can be manipulated.

Change History (6)

comment:1 Changed 9 years ago by Eugene Lazutkin

Description: modified (diff)
Milestone: tbdfuture
Status: newassigned
Summary: SVG Text -> GFX srfuace conversion APISVG Text -> GFX surface conversion API

Two things:

  1. Why no XSLT?
  1. We already have some (unfinished) provisions for a somewhat similar thing: xxx_attach.js (e.g., svg_attach.js, vml_attach.js, and so on). They idea was to be able to instantiate a native DOM, and attach gfx object to existing elements. Clearly it is not a portable thing, yet it allows to introspect existing DOM.

comment:2 Changed 9 years ago by Eugene Lazutkin

Description: modified (diff)

comment:3 Changed 9 years ago by liyang

A notice for implementation, there's xsl asset that converts svg to gfx already, namely:

  • dojox/gfx/resource/svg2gfx.xsl
  • dojox/gfx/resource/svg2gfx-simple.xsl

comment:4 Changed 9 years ago by Jared Jurkiewicz

Because you can't apply xslt in the browser consistently (to my knowledge).

comment:5 in reply to:  4 Changed 9 years ago by Eugene Lazutkin

Replying to jaredj:

Because you can't apply xslt in the browser consistently (to my knowledge).

For my work I needed XSLT and wrote simple shims to support. Everybody is doing it one way and IE does it in its own way. But other than that it works fine. The only potential problem can be mobile browsers --- I never tested them for XSLT, they may skip on implementing it.

In any case I can contribute shims.

comment:6 Changed 3 years ago by dylan

Milestone: future1.12
Resolution: patchwelcome
Status: assignedclosed

Given that no one has shown interest in creating a patch in the past 5+ years, I'm closing this as patchwelcome.

Note: See TracTickets for help on using tickets.