.. include:: ../substitutions

.. oe:namespace:: OEDepict

.. meta::
   :keywords: OEEstimateTextWidth

.. _OEDepict_OEEstimateTextWidth:


.. oe:function:: OEEstimateTextWidth


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

      .. oe:api::

         double OEEstimateTextWidth(const std::string& text, const OEFont& font)

   .. oe:language:: python

      .. oe:api:: python

         OEEstimateTextWidth(text: str, font: OEFont) -> float

   Estimates the width of string depicted with a specific style.

   *text*
      The string of which width is being estimated.

   *font*
      The :ref:`OEFont <OEDepict_OEFont>` object that defines the style of
      the depiction.

   .. seealso::

      * :oe:func:`OEDepict::OEReduceFontSizeToFit` function
      * :ref:`OEFont <OEDepict_OEFont>` class
