.. include:: ../substitutions

.. oe:namespace:: OEDepict

.. meta::
   :keywords: OEDrawText

.. _OEDepict_OEDrawText:


.. oe:function:: OEDrawText

   .. oe:language:: c++ java csharp

      .. oe:api::

         void OEDrawText(OEImageBase& image, const std::string& text,
                         const OEFont& font, double padding = 5.0)

   .. oe:language:: python

      .. oe:api:: python

         OEDrawText(image: OEImageBase, text: str, font: OEFont,
                    padding: float = 5.0) -> None

   Draws the given text to the image respecting the font alignment.

   *text*
      The text that is going to be rendered into the given image.

   *font*
      The :ref:`OEFont <OEDepict_OEFont>` object that encapsulates properties
      that determine the display style of text.

   *padding*
      Defines the padding used on the left and right of the given cell
      as a percentage of the width of the cell.

   .. seealso::

      * :ref:`OEImageBase <OEDepict_OEImageBase>` class
      * :ref:`OEFont <OEDepict_OEFont>` class
      * :oe:func:`OEDepict::OEDrawTextToCenter` function
