Difference between revisions of "CanvasDrawText"

m (typo)
(link to Color parameters)
Line 11: Line 11:
 
* «x», «y»: The location where the text will display.
 
* «x», «y»: The location where the text will display.
 
* «font»: (optional) the textual font name, such as <code>'Arial', 'Comic Sans MS', 'Times New Roman'</code>.
 
* «font»: (optional) the textual font name, such as <code>'Arial', 'Comic Sans MS', 'Times New Roman'</code>.
* «color»: (Optional) Either a textual color name or a color integer. (See [[CellFill]] for an enumeration of textual color names). A color integer encodes red, green, blue and optionally alpha as <code> 0x01000000 * alpha + 0x00010000 * red + 0x0000100 * green + 0x000001 * blue</code>. Defaults to 'Black'.
+
* «color»: (Optional) Either a textual color name or a color integer. See [[Color parameters]] for an enumeration of textual color names and a description of color integers. Defaults to 'Black'.
 
* «bold», «italic»: (Optional) When true, the text is draw in bold or italic font respectively.
 
* «bold», «italic»: (Optional) When true, the text is draw in bold or italic font respectively.
 
* «hAlign»: (Optional) Horizontal alignment relative to «x», either <code>'Left', 'Center' or 'Right'</code>. Default is <code>'Left'</code>.
 
* «hAlign»: (Optional) Horizontal alignment relative to «x», either <code>'Left', 'Center' or 'Right'</code>. Default is <code>'Left'</code>.

Revision as of 00:48, 3 June 2017


New to Analytica 5.0

CanvasDrawText( canvas, text, x, y, font, fontSize, color, bold, italic, hAlign, vAlign )

Draws text on a canvas.

  • «canvas» is a canvas obtained from calling the Canvas() function, or a canvas context obtained by calling the CanvasContext() function.
  • «text» is the text to draw.
  • «x», «y»: The location where the text will display.
  • «font»: (optional) the textual font name, such as 'Arial', 'Comic Sans MS', 'Times New Roman'.
  • «color»: (Optional) Either a textual color name or a color integer. See Color parameters for an enumeration of textual color names and a description of color integers. Defaults to 'Black'.
  • «bold», «italic»: (Optional) When true, the text is draw in bold or italic font respectively.
  • «hAlign»: (Optional) Horizontal alignment relative to «x», either 'Left', 'Center' or 'Right'. Default is 'Left'.
  • «vAlign»: (Optional) Vertical alignment relative to «y», either 'Top', 'Middle' or 'Bottom'. Default is 'Top'.

When drawn to a context where the coordinate frame as been scaled, the text (and the interpretation of «fontSize» is scaled as well. When the x- and y-axes are scaled differently, the text will be squashed or stretched. When one logical unit along x corresponds to two device pixels, then text will be twice as wide as it would be if rendered at the same «fontSize» without scaling.

See also

Comments


You are not allowed to post comments.