I have been searching for hours to find a solution to display text rotated at 90 degrees in firefox, and could not find one. css3 and IE has the css command "writing-mode: tb-rl;" but this does not work in firefox. i came to conclusion that SVG is the solution. I have been playing with SVG for few hours now and it is brilliant, you can do graphics and animation like flash but text and javascript based!. anyway check this out, this is one solution to do it in svg and it works.
put this in html document
and here is the svg file
[CODE=xml]<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="ht tp://www.w3.org/1999/xlink">
<script type="text/javascript">
<![CDATA[
//this will create htmljavascriptf unctionname in html document and link it to changeText
top.htmljavascr iptfunctionname = changeText;
function changeText(txt) {
targetText=docu ment.getElement ById("thetext") ;
var newText = document.create TextNode(txt);
targetText.repl aceChild(newTex t,targetText.ch ildNodes[0]);
}
// ]]>
</script>
<text id="thetext" transform="rota te(90,4,4)" font-size="10" x="4" y="4" font-family="Verdana ">this text is rotated </text>
</svg>[/CODE]
This idea could be developed further to create the svg object in the html document dom, dynamically with javascript and therefore with no external svj file or an embed object being required. if this woudl be useful to you let me know
put this in html document
Code:
<embed class="svgex" src="../thefile.svg" type="image/svg+xml" frameborder="no" width="30" height="60" />
[CODE=xml]<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="ht tp://www.w3.org/1999/xlink">
<script type="text/javascript">
<![CDATA[
//this will create htmljavascriptf unctionname in html document and link it to changeText
top.htmljavascr iptfunctionname = changeText;
function changeText(txt) {
targetText=docu ment.getElement ById("thetext") ;
var newText = document.create TextNode(txt);
targetText.repl aceChild(newTex t,targetText.ch ildNodes[0]);
}
// ]]>
</script>
<text id="thetext" transform="rota te(90,4,4)" font-size="10" x="4" y="4" font-family="Verdana ">this text is rotated </text>
</svg>[/CODE]
This idea could be developed further to create the svg object in the html document dom, dynamically with javascript and therefore with no external svj file or an embed object being required. if this woudl be useful to you let me know
Comment