.. role:: ts-api-decorator

####
Text
####

.. js:module:: Markup.Shapes
   :noindex:

.. container:: ts-api-section

   .. js:class:: Text

      This object represents markup text that is drawn on the canvas.



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~Markup.Shapes.Text.constructor`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~Markup.Shapes.Text.getFillColor`
   * :js:meth:`~Markup.Shapes.Text.getFillOpacity`
   * :js:meth:`~Markup.Shapes.Text.getFontFamily`
   * :js:meth:`~Markup.Shapes.Text.getFontSize`
   * :js:meth:`~Markup.Shapes.Text.getPosition`
   * :js:meth:`~Markup.Shapes.Text.getStrokeColor`
   * :js:meth:`~Markup.Shapes.Text.getStrokeWidth`
   * :js:meth:`~Markup.Shapes.Text.getText`
   * :js:meth:`~Markup.Shapes.Text.setFillColor`
   * :js:meth:`~Markup.Shapes.Text.setFillOpacity`
   * :js:meth:`~Markup.Shapes.Text.setFontFamily`
   * :js:meth:`~Markup.Shapes.Text.setFontSize`
   * :js:meth:`~Markup.Shapes.Text.setPosition`
   * :js:meth:`~Markup.Shapes.Text.setStrokeColor`
   * :js:meth:`~Markup.Shapes.Text.setStrokeWidth`
   * :js:meth:`~Markup.Shapes.Text.setText`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: Text.constructor( text, position)

      :param text: the text associated with this item.
      :type text: string
      :param position: the screen space point of the top left of the text string.
      :type position: Point2


      Creates a new markup text item.


      :rtype: Text



Methods
=======

.. rst-class:: ts-api-section

getFillColor
------------

.. js:method:: Text.getFillColor()



   Gets the fill color for this shape

   :returns: the fill color


   :rtype: Color

.. rst-class:: ts-api-section

getFillOpacity
--------------

.. js:method:: Text.getFillOpacity()



   Gets the fill opacity for this shape

   :returns: the fill opacity


   :rtype: number

.. rst-class:: ts-api-section

getFontFamily
-------------

.. js:method:: Text.getFontFamily()



   Gets the font family for this text

   :returns: the font family


   :rtype: null | string

.. rst-class:: ts-api-section

getFontSize
-----------

.. js:method:: Text.getFontSize()



   Gets the font size for this text

   :returns: the font size


   :rtype: number

.. rst-class:: ts-api-section

getPosition
-----------

.. js:method:: Text.getPosition()



   Gets the text position

   :returns: the text position


   :rtype: Point2

.. rst-class:: ts-api-section

getStrokeColor
--------------

.. js:method:: Text.getStrokeColor()



   Gets the stroke color for this shape

   :returns: the stroke color


   :rtype: Color

.. rst-class:: ts-api-section

getStrokeWidth
--------------

.. js:method:: Text.getStrokeWidth()



   Gets the stroke width for this shape in pixels

   :returns: the stroke width in pixels


   :rtype: number

.. rst-class:: ts-api-section

getText
-------

.. js:method:: Text.getText()



   Gets the text content

   :returns: the text content


   :rtype: string

.. rst-class:: ts-api-section

setFillColor
------------

.. js:method:: Text.setFillColor( color)

   :param color: the fill color
   :type color: Color


   Sets the fill color for this shape


   :rtype: void

.. rst-class:: ts-api-section

setFillOpacity
--------------

.. js:method:: Text.setFillOpacity( fillOpacity)

   :param fillOpacity: the fill opacity
   :type fillOpacity: number


   Sets the fill opacity for this shape


   :rtype: void

.. rst-class:: ts-api-section

setFontFamily
-------------

.. js:method:: Text.setFontFamily( fontFamily)

   :param fontFamily: font family to use for this text
   :type fontFamily: string


   Sets the font family this shape


   :rtype: void

.. rst-class:: ts-api-section

setFontSize
-----------

.. js:method:: Text.setFontSize( fontSize)

   :param fontSize: size to use for this text
   :type fontSize: number


   Sets the font size for this text


   :rtype: void

.. rst-class:: ts-api-section

setPosition
-----------

.. js:method:: Text.setPosition( position)

   :param position: None
   :type position: Point2


   Sets the text position

   :returns: the top left position to render text from


   :rtype: void

.. rst-class:: ts-api-section

setStrokeColor
--------------

.. js:method:: Text.setStrokeColor( color)

   :param color: the stroke color
   :type color: Color


   Sets the stroke color for this shape


   :rtype: void

.. rst-class:: ts-api-section

setStrokeWidth
--------------

.. js:method:: Text.setStrokeWidth( strokeWidth)

   :param strokeWidth: the stroke width in pixels
   :type strokeWidth: number


   Sets the stroke width for this shape in pixels


   :rtype: void

.. rst-class:: ts-api-section

setText
-------

.. js:method:: Text.setText( text)

   :param text: the text to render
   :type text: string


   Sets the text content


   :rtype: void

