Its using div elements inside the mml div, when you refresh or resize,
in IE the contents of the mml div is ereased, resulting in a new svg
picture, in firefox its not erased and every object should have an id
otherwise it will be drawn twice.
For the rotation you can do the following:
function rotate(id, p, angle) {
var node, rotatestr;
rotatestr = "";
if (id!=null) {
node = doc.getElementById(id);
var xangle = p[0]*xunitlength+origin[0];
var yangle = height-p[1]*yunitlength-origin[1];
rotatestr = " translate("+xangle+","+yangle+") rotate("+angle+")
translate(-"+xangle+",-"+yangle+")";
node.setAttribute("transform",rotatestr);
}
return rotatestr;
}
In this function id is the id of an existing object, so give your text
an id and refer to it in this function.
p is to point to rotate around so p=[x,y];
angle is the rotation angle in degrees.
Here you also have the functions for the other transformations:
function translation(id, p) {
var node, translatestr;
translatestr = "";
if (id!=null) {
node = doc.getElementById(id);
var xangle = p[0]*xunitlength;
var yangle = -p[1]*yunitlength;
translatestr = " translate("+xangle+","+yangle+")";
node.setAttribute("transform",translatestr);
}
return translatestr;
}
function skewx(id, p, angle) {
var node, skewxstr;
skewxstr = "";
if (id!=null) {
node = doc.getElementById(id);
var xangle = p[0]*xunitlength+origin[0];
var yangle = height-p[1]*yunitlength-origin[1];
skewxstr = " translate("+xangle+","+yangle+") skewX("+angle+")
translate(-"+xangle+",-"+yangle+")";
node.setAttribute("transform",skewxstr);
}
return skewxstr;
}
function skewy(id, p, angle) {
var node, skewystr;
skewystr = "";
if (id!=null) {
node = doc.getElementById(id);
var xangle = p[0]*xunitlength+origin[0];
var yangle = height-p[1]*yunitlength-origin[1];
skewystr = " translate("+xangle+","+yangle+") skewY("+angle+")
translate(-"+xangle+",-"+yangle+")";
node.setAttribute("transform",skewystr);
}
return skewystr;
}
function scale(id, p, scalex, scaley) {
var node, scalestr;
scalestr = "";
if (id!=null) {
node = doc.getElementById(id);
var xangle = p[0]*xunitlength+origin[0];
var yangle = height-p[1]*yunitlength-origin[1];
scalestr = " translate("+xangle+","+yangle+") scale("+scalex
+","+scaley+") translate(-"+xangle+",-"+yangle+")";
node.setAttribute("transform",scalestr);
}
return scalestr;
}
On Apr 28, 8:53 pm, Marc Grober <
m...@interak.com> wrote:
> I would think that the appearance of the implied dot
> suggests that it is using SVG elements, no?
>
>
>
> David Lippman wrote:
> > I haven't gone digging through the code yet... Does the `` approach overlay MathML in HTML divs over the SVG, or does it actually use SVG text elements?
>
> > -----Original Message-----
> > From:
asci...@googlegroups.com [mailto:
asci...@googlegroups.com] On Behalf Of miedema
> > Sent: Tuesday, April 28, 2009 10:54 AM
> > To: ASCIIMath
> > Subject: [ASCIIMath] Re: some asciisvg questions
>
> > Just place it between `` so (`x_1`,`y_`) or `(x_1,y_1)` in my version this works perfectly. I also added rotation to the text command, so you can rotate text in any angle.
>
> > On Apr 28, 6:45 pm, Marc Grober <
m...@interak.com> wrote:
> >> I am working on a lesson for teachers using asciimath and asciisvg and
> >> have come up against the following:
>
> >> 1) Is there an existing way to do subscripts in asciisvg? I want to
> >> identify a point as (x_1, y_1), is there a way to do it without have
> >> to start a new text directive that shifts the y value of the
> >> subscript?
>
> >> 2) What about text orientation, as in selecting a ray along which the
> >> text is displayed and orienting the text to the ray.....
>
> >> Paul and SA, have you looked at text options at all in your
> >> versions?
>
> >> smime.p7s
> >> 4KViewDownload
>
> > >
>
>