On Fri, Jul 8, 2011 at 13:39, dinkypumpkin <[email protected]> wrote:

> 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.  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.


Thanks. That's useful information! I still can't get any text to appear,
however. Do you happen to have a tiny example that causes text to display?
Or, can you tell me what I need to change in the following to get text to
show up? I must be missing something simple, but I don't see it.

qx.Class.define("svg.demo.Application",
{
  extend : qx.application.Standalone,

  members :
  {
    main : function()
    {
      // Call super class
      this.base(arguments);

      // Enable logging in debug variant
      if (qx.core.Environment.get("qx.debug"))
      {
        // support native logging capabilities, e.g. Firebug for Firefox
        qx.log.appender.Native;

        // support additional cross-browser console. Press F7 to toggle
visibility
        qx.log.appender.Console;
      }

      this._addCircle();

    },

    _addCircle : function()
    {
      var doc = this.getRoot();

      var svgWidget = new svg.embed.Svg();

      doc.add(svgWidget,
      {
        left   : 0,
        right  : 0,
        top    : 0,
        bottom : 0
      });

      var svgroot = svgWidget.getSvg();

      // create a defs section
      var defs = new svg.struct.Defs();
      svgroot.add(defs);

      // prepare a group for the circle chunks
      var circleGroup = new svg.struct.Group();
      circleGroup.setId("circle");
      svgroot.add(circleGroup);

      // create the big chunk
      var bigChunk = new svg.path.Path();
      bigChunk.setStroke("black");
      bigChunk.setStrokeWidth(2);
      bigChunk.setFill("red");
      circleGroup.add(bigChunk);

      // create the pathdata for the big chunk
      var bigChunkPD = new svg.path.PathData();
      bigChunkPD.moveTo(300, 200);
      bigChunkPD.lineTo(-150, 0, true);
      bigChunkPD.arc(150, 150, 0, true, false, 150, -150, true);
      bigChunkPD.closePath();

      // apply the big chunk path data
      bigChunk.setPathData(bigChunkPD);

      // create a piece of text
      var text = new svg.text.Text();
      text.set(
        {
          value : "hello world",
          x : 0,
          y : 0,
          fontFamily : "serif",
          fontStyle : "normal",
          fontWeight : "normal",
          fontSize : 20
        });
      svgroot.add(text);

/*
      svgWidget.addListener(
        "appear",
        function(e)
        {
          this.setValue("hi there");
        },
        text);
*/
    }
  }
});
------------------------------------------------------------------------------
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

Reply via email to