not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
638 B

  1. //* Canvas control that draws a text string.
  2. enyo.kind({
  3. name: "enyo.canvas.Text",
  4. kind: enyo.canvas.Shape,
  5. published: {
  6. //* The text to draw
  7. text: "",
  8. //* CSS font specification used to select a font for drawing
  9. font: "12pt Arial",
  10. //* Text alignment within the rectangle specified by the _bounds_ property
  11. align: "left"
  12. },
  13. //* @protected
  14. renderSelf: function(ctx) {
  15. ctx.textAlign = this.align;
  16. ctx.font = this.font;
  17. this.draw(ctx);
  18. },
  19. fill: function(ctx) {
  20. ctx.fillText(this.text, this.bounds.l, this.bounds.t);
  21. },
  22. outline: function(ctx) {
  23. ctx.strokeText(this.text, this.bounds.l, this.bounds.t);
  24. }
  25. });