>> The text to render is set via the "value" property for svg.text.Text > (acquired from svg.core.MTextContainer mixin). >> I doesn't show up in the API docs for svg.text.Text, but it works. > > The setValue and getValue methods are indeed the ones to use for text > content. I'm not sure why you don't see them in the API viewer; I can see > them in both release 0.2 and trunk. You need to look at the methods > though, > because it's not a property. >
My bad. There is no "value" property, per se - only getter/setter for content of the SVG DOM element. Getter/setter are in API doc, as you say. >> One other thing I found while getting started with svg.text.Text: it > doesn't support any fill properties out of the box, >> so I just created a subclass to mix in svg.paint.MFillProperties, which > seemed to work OK for setting text colour. > > This is actually a design challenge that I face continuously. You will > find > many examples like this one in the contrib. > ... > If you (or anyone else!) have any thoughts on how it should work, they > would > be most welcome. ;) > FWIW, I reckon you're right to keep it simple. It would seem that one goal of any SVG wrapper would be to hide some complexity, something your contrib does admirably. If you roll out additional attribute sets as mixins, it's simple enough to subclass as needed. My only suggestion at the moment would be to mix in svg.paint.MFillProperties and svg.paint.MStrokeProperties into svg.text.Text. Although the necessary subclass is trivial, it would be helpful to have to ability to set text colour, opacity, etc. out of the box. I think that's something new users might take for granted, particularly when transferring apps from dojo.gfx and Raphael.js. >> Set the "y" property of your text element to >=20. That property sets >> the > text baseline, >> so when it's =0, your text element is in the DOM but just out of view. > > Actually, SVG allows you to set the text baseline with the > alignment-baseline, dominant-baseline, and a few other properties. See the > ... > Derrell: Beware my oversimplification. The text display is subject to the baseline properties that Marc mentioned. To oversimplify again, the default baseline for the L-to-R text in your example aligns with the font (sort of like in a word processor), so "y" does mark the baseline, but that won't always be the case. As a demonstration, in your example, set y=0 and "hello world" to "hello gyro" and you'll see the g and y descenders below the baseline peeking into your browser window. -- View this message in context: http://qooxdoo.678.n2.nabble.com/SVG-contrib-tp6562957p6564511.html Sent from the qooxdoo mailing list archive at Nabble.com. ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
