Re: [svg-developers] Help neede in SVG issue - urgent
Hi Ganesh you asked that question yesterday, and it was already answerd, just in case you missed the answer: http://groups.yahoo.com/group/svg-developers/message/49206 Holger > Hi > > 1)I have the following piece of code in my svg > > > > > ATTRACT > > > > Now I would like to align the text 'ATTRACT' in the center of the > curve. I'm not able to achieve this using text-anchor:middle. Please help > > 2) I would like to zoom my svg image programmatically. I know it can > done. But my zooming requires that the width alone be increased and > the height remains constant. How can I do it. > > With regards > ganesh > - To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [svg-developers] Help neede in SVG issue - urgent
Hi Holger Thank You for the answer. It was very helpfult. Just a couple of more questions. 1) In the same code ATTRACT If u see now I am able to place the text "Attract" in teh center of the curve. So now this string will not be hardcoded and it will be a parameter that we will be passing during runtime. So is it possible to find if the string exceeds the length of the curve and if so autofit the string within teh curve. Also can I have multilingual strings displayed. 2) Regarding my question on zooming the image only horizontally and not vertically ur answer was to use preserveaspectratio=none. Can I get a code snippet of how this is done programmatically. Thanks in advance ganesh Holger Will <[EMAIL PROTECTED]> wrote: Hi Ganesh you asked that question yesterday, and it was already answerd, just in case you missed the answer: http://groups.yahoo.com/group/svg-developers/message/49206 Holger > Hi > > 1)I have the following piece of code in my svg > > > > > ATTRACT > > > > Now I would like to align the text 'ATTRACT' in the center of the > curve. I'm not able to achieve this using text-anchor:middle. Please help > > 2) I would like to zoom my svg image programmatically. I know it can > done. But my zooming requires that the width alone be increased and > the height remains constant. How can I do it. > > With regards > ganesh > - To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" - Yahoo! Groups Links To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com [Non-text portions of this message have been removed] - To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [svg-developers] Help neede in SVG issue - urgent
Ganesh Jothikumar wrote: > Hi Holger > Thank You for the answer. It was very helpfult. Just a > couple of more questions. > > 1) In the same code > > > > > > > xlink:href="#attract"> > > ATTRACT > > > > > > > If u see now I am able to place the text "Attract" in teh center of > the curve. So now this string will not be hardcoded and it will be a > parameter that we will be passing during runtime. So is it possible to > find if the string exceeds the length of the curve and if so autofit > the string within teh curve. i think you will need some script, something along the lines: a=determine path length with getTotalLength() b= determin string length with getComputedTextLength() newfontsize = a * fontsize / b > Also can I have multilingual strings displayed. yes, you would use switch for that see: http://www.w3.org/TR/SVG/struct.html#SwitchElement but dont ask me about switch,ive never used it... > > 2) Regarding my question on zooming the image only horizontally and > not vertically ur answer was to use preserveaspectratio=none. Can I > get a code snippet of how this is done programmatically. http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; preserveAspectRatio="none" viewBox="0 0 100 100"> function zoom(){ var vb=document.documentElement.getAttribute("viewBox").split(" ") document.documentElement.setAttribute("viewBox",vb[0]+" "+vb[1]+" "+vb[2]*2+" "+vb[3]) } hth Holger - To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [svg-developers] Help neede in SVG issue - urgent
Hi Holger Thanks for the help. I followed your steps but I am not able to accomplish my task correctly Can you check whether my code is correct: http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";> http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink";> maxLineWidth ) { textobj.setAttribute("font-size",10); } } ]]> ATTRACT PERSUADE CONVERT RETAIN Apart from this what is the general way to print any variable for debugging purposes. Also Holger in the above code in order to zoom only horizontally I just changed the viewbox to "0 0 960 320" keeping width and height constant. But I expected teh SVG to get elongated horizontally ( with all the text elongating elatively ) but it behaved very peculiarly. Can you sugest how to do this and if possible incorporate the changes needed in the above code. I have attached the image I am referencing in the SVG along with this mail. THanks ganesh Holger Will <[EMAIL PROTECTED]> wrote: Ganesh Jothikumar wrote: > Hi Holger > Thank You for the answer. It was very helpfult. Just a > couple of more questions. > > 1) In the same code > > > > > > > xlink:href="#attract"> > > ATTRACT > > > > > > > If u see now I am able to place the text "Attract" in teh center of > the curve. So now this string will not be hardcoded and it will be a > parameter that we will be passing during runtime. So is it possible to > find if the string exceeds the length of the curve and if so autofit > the string within teh curve. i think you will need some script, something along the lines: a=determine path length with getTotalLength() b= determin string length with getComputedTextLength() newfontsize = a * fontsize / b > Also can I have multilingual strings displayed. yes, you would use switch for that see: http://www.w3.org/TR/SVG/struct.html#SwitchElement but dont ask me about switch,ive never used it... > > 2) Regarding my question on zooming the image only horizontally and > not vertically ur answer was to use preserveaspectratio=none. Can I > get a code snippet of how this is done programmatically. http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; preserveAspectRatio="none" viewBox="0 0 100 100"> function zoom(){ var vb=document.documentElement.getAttribute("viewBox").split(" ") document.documentElement.setAttribute("viewBox",vb[0]+" "+vb[1]+" "+vb[2]*2+" "+vb[3]) } hth Holger - To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" - Yahoo! Groups Links To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com [Non-text portions of this message have been removed] - To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [svg-developers] Help neede in SVG issue - urgent
Good morning Ganesh > Thanks for the help. I followed your steps but I am not able to > accomplish my task correctly > > Can you check whether my code is correct: > see: http://www.treebuilder.de/svg/textpath.svg for a working version. the problem, i figured is a bug in ASV which gets getComputedTextLength() wrong on textPathes. i now use two text elements, one for calculating the textlength (without textpath) and the one with textpath. > > Apart from this what is the general way to print any variable for > debugging purposes. alert(anyvariable) > > Also Holger in the above code in order to zoom only horizontally I > just changed the viewbox to "0 0 960 320" keeping width and height > constant. But I expected teh SVG to get elongated horizontally ( with > all the text elongating elatively ) but it behaved very peculiarly. > Can you sugest how to do this and if possible incorporate the changes > needed in the above code. I have attached the image I am referencing > in the SVG along with this mail. sorry, not really much time right now, will look into this later. HTH Holger - To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [svg-developers] Help neede in SVG issue - urgent
Thanks a ton Holger. It's working perfectly fine. Holger Will <[EMAIL PROTECTED]> wrote:Good morning Ganesh > Thanks for the help. I followed your steps but I am not able to > accomplish my task correctly > > Can you check whether my code is correct: > see: http://www.treebuilder.de/svg/textpath.svg for a working version. the problem, i figured is a bug in ASV which gets getComputedTextLength() wrong on textPathes. i now use two text elements, one for calculating the textlength (without textpath) and the one with textpath. > > Apart from this what is the general way to print any variable for > debugging purposes. alert(anyvariable) > > Also Holger in the above code in order to zoom only horizontally I > just changed the viewbox to "0 0 960 320" keeping width and height > constant. But I expected teh SVG to get elongated horizontally ( with > all the text elongating elatively ) but it behaved very peculiarly. > Can you sugest how to do this and if possible incorporate the changes > needed in the above code. I have attached the image I am referencing > in the SVG along with this mail. sorry, not really much time right now, will look into this later. HTH Holger - To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" - Yahoo! Groups Links To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com [Non-text portions of this message have been removed] - To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/