fillText

Jump to: navigation, search

fillText

W3C Candidate Recommendation

Summary

Renders the given text at the given (x, y) coordinates, ensuring that the text isn't wider than maxWidth (if specified), using the current font, textAlign, and textBaseline values.

Method of apis/canvas/CanvasRenderingContext2D

Syntax

var object = object.fillText(see parameter list);

Parameters

text

Data-type: String


The text characters to paint on the canvas.


x

Data-type: Number


The horizontal coordinate to start painting the text at, relative to the canvas.


y

Data-type: Number


The vertical coordinate to start painting the text, relative to the canvas.


maxWidth

Data-type: Number Optional

The maximum possible text width. If the value is less than the width property, the text is scaled to fit.

Return Value

Returns an object of type DOM Node.

Type: HRESULT

This method can return one of these values.

Return code Description
S_OK The operation completed successfully.
SecurityError The current font is not of the same origin or domain as the document that owns the canvas element.




Compatibility

There is no data available for topic "webapi", feature "fillText". If you think that there should be data available, consider opening an issue.

Needs Examples: This section should include examples.



Related specifications

Specification Status Related Changes
W3C HTML Canvas 2D Specification W3C Candidate Recommendation

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: Windows Internet Explorer API reference Article