I have function
//Function: formatTextPortait
//format text portait or landscape
//
//Parameters:
//@portait
//if true is format text portait else format text landscape
//
this.formatTextPortait = function( portait) {
var elem = selectedElements[0];
if (elem == null) {
return;
}
var d = document.getElementById(elem.id);
var childNodeArray = document.getElementById(elem.id).childNodes;
var c = textManager.textArray[0];
var index =0;
if (portait){
//childNodeArray.item(0).textContent = $('#textDisplay').val();
//elem.textContent =$('#textDisplay').val();
for (i = 0; i< childNodeArray.length ; i++){
var tspan = document.getElementById(childNodeArray.item(i).id);
var dxArray = "0";
var dyArray = "0";
for (j=0; j< tspan.textContent.length ; j++) {
c = textManager.textArray[index];
if (c.width ==0){
index++;
c = textManager.textArray[index];
}
dxArray = dxArray + ' -' + c.width;
dyArray = dyArray + " "+newDy;
index ++;
}
tspan.setAttribute('dx', dxArray );
tspan.setAttribute('dy',dyArray );
tspan.setAttribute('x', elem.getAttribute('x') -(newDy+4)*i);
tspan.setAttribute('y', elem.getAttribute('y') );
}
}else {
//childNodeArray.item(0).textContent = $('#textDisplay').val();
//elem.textContent =$('#textDisplay').val();
for (i = 0; i< childNodeArray.length ; i++){
var tspan = document.getElementById(childNodeArray.item(i).id);
tspan.setAttribute('dx', "0" );
tspan.setAttribute('dy',newDy );
tspan.setAttribute('x', elem.getAttribute('x'));
tspan.setAttribute('y', "" );
}
}
}
This function used to format Japanese.but I do not exported image true format
text portait.
thank you hope to receive help.
Original issue reported on code.google.com by ngocdung...@gmail.com on 25 Jun 2012 at 2:52
Original issue reported on code.google.com by
ngocdung...@gmail.com
on 25 Jun 2012 at 2:52