.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.TextAttr:

==========================================================================================================================================
|phoenix_title|  **wx.TextAttr**
==========================================================================================================================================

:ref:`wx.TextAttr`  represents the character and paragraph attributes, or style, for a range of text in a :ref:`wx.TextCtrl`  or :ref:`wx.richtext.RichTextCtrl`.          

When setting up a :ref:`wx.TextAttr`  object, pass a bitlist mask to :meth:`wx.TextAttr.SetFlags`   to indicate which style elements should be changed. As a convenience, when you call a setter such as SetFont, the relevant bit will be set. 







         



.. seealso:: :ref:`wx.TextCtrl`, :ref:`wx.richtext.RichTextCtrl`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>TextAttr</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.TextAttr_inheritance.png" alt="Inheritance diagram of TextAttr" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.TextAttr.html" title="wx.TextAttr" alt="" coords="5,5,101,35"/> </map> 
   </p>
   </div>

|


|sub_classes| Known Subclasses
==============================

:ref:`wx.richtext.RichTextAttr`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.TextAttr.__init__`                                                    Constructors.
:meth:`~wx.TextAttr.Apply`                                                       Applies the attributes in `style`  to the original object, but not those attributes from `style`  that are the same as those in `compareWith`  (if passed).
:meth:`~wx.TextAttr.EqPartial`                                                   Partial equality test.
:meth:`~wx.TextAttr.GetAlignment`                                                Returns the alignment flags.
:meth:`~wx.TextAttr.GetBackgroundColour`                                         Returns the background colour.
:meth:`~wx.TextAttr.GetBulletFont`                                               Returns a string containing the name of the font associated with the bullet symbol.
:meth:`~wx.TextAttr.GetBulletName`                                               Returns the standard bullet name, applicable if the bullet style is ``wx.TEXT_ATTR_BULLET_STYLE_STANDARD``.
:meth:`~wx.TextAttr.GetBulletNumber`                                             Returns the bullet number.
:meth:`~wx.TextAttr.GetBulletStyle`                                              Returns the bullet style.
:meth:`~wx.TextAttr.GetBulletText`                                               Returns the bullet text, which could be a symbol, or (for example) cached outline text.
:meth:`~wx.TextAttr.GetCharacterStyleName`                                       Returns the name of the character style.
:meth:`~wx.TextAttr.GetFlags`                                                    Returns flags indicating which attributes are applicable.
:meth:`~wx.TextAttr.GetFont`                                                     Creates and returns a font specified by the font attributes in the :ref:`wx.TextAttr`  object.
:meth:`~wx.TextAttr.GetFontAttributes`                                           Gets the font attributes from the given font, using only the attributes specified by `flags`.
:meth:`~wx.TextAttr.GetFontEncoding`                                             Returns the font encoding.
:meth:`~wx.TextAttr.GetFontFaceName`                                             Returns the font face name.
:meth:`~wx.TextAttr.GetFontFamily`                                               Returns the font family.
:meth:`~wx.TextAttr.GetFontSize`                                                 Returns the font size in points.
:meth:`~wx.TextAttr.GetFontStyle`                                                Returns the font style.
:meth:`~wx.TextAttr.GetFontUnderlined`                                           Returns ``True`` if the font is underlined.
:meth:`~wx.TextAttr.GetFontWeight`                                               Returns the font weight.
:meth:`~wx.TextAttr.GetLeftIndent`                                               Returns the left indent in tenths of a millimetre.
:meth:`~wx.TextAttr.GetLeftSubIndent`                                            Returns the left sub-indent in tenths of a millimetre.
:meth:`~wx.TextAttr.GetLineSpacing`                                              Returns the line spacing value, one of :ref:`wx.TextAttrLineSpacing`  values.
:meth:`~wx.TextAttr.GetListStyleName`                                            Returns the name of the list style.
:meth:`~wx.TextAttr.GetOutlineLevel`                                             Returns the outline level.
:meth:`~wx.TextAttr.GetParagraphSpacingAfter`                                    Returns the space in tenths of a millimeter after the paragraph.
:meth:`~wx.TextAttr.GetParagraphSpacingBefore`                                   Returns the space in tenths of a millimeter before the paragraph.
:meth:`~wx.TextAttr.GetParagraphStyleName`                                       Returns the name of the paragraph style.
:meth:`~wx.TextAttr.GetRightIndent`                                              Returns the right indent in tenths of a millimeter.
:meth:`~wx.TextAttr.GetTabs`                                                     Returns an array of tab stops, each expressed in tenths of a millimeter.
:meth:`~wx.TextAttr.GetTextColour`                                               Returns the text foreground colour.
:meth:`~wx.TextAttr.GetTextEffectFlags`                                          Returns the text effect bits of interest.
:meth:`~wx.TextAttr.GetTextEffects`                                              Returns the text effects, a bit list of styles.
:meth:`~wx.TextAttr.GetURL`                                                      Returns the URL for the content.
:meth:`~wx.TextAttr.GetUnderlineColour`                                          Returns the underline color used.
:meth:`~wx.TextAttr.GetUnderlineType`                                            Returns the underline type, which is one of the TextAttrUnderlineType values.
:meth:`~wx.TextAttr.HasAlignment`                                                Returns ``True`` if the attribute object specifies alignment.
:meth:`~wx.TextAttr.HasBackgroundColour`                                         Returns ``True`` if the attribute object specifies a background colour.
:meth:`~wx.TextAttr.HasBulletName`                                               Returns ``True`` if the attribute object specifies a standard bullet name.
:meth:`~wx.TextAttr.HasBulletNumber`                                             Returns ``True`` if the attribute object specifies a bullet number.
:meth:`~wx.TextAttr.HasBulletStyle`                                              Returns ``True`` if the attribute object specifies a bullet style.
:meth:`~wx.TextAttr.HasBulletText`                                               Returns ``True`` if the attribute object specifies bullet text (usually specifying a symbol).
:meth:`~wx.TextAttr.HasCharacterStyleName`                                       Returns ``True`` if the attribute object specifies a character style name.
:meth:`~wx.TextAttr.HasFlag`                                                     Returns ``True`` if the `flag`  is present in the attribute object's flag bitlist.
:meth:`~wx.TextAttr.HasFont`                                                     Returns ``True`` if the attribute object specifies any font attributes.
:meth:`~wx.TextAttr.HasFontEncoding`                                             Returns ``True`` if the attribute object specifies an encoding.
:meth:`~wx.TextAttr.HasFontFaceName`                                             Returns ``True`` if the attribute object specifies a font face name.
:meth:`~wx.TextAttr.HasFontFamily`                                               Returns ``True`` if the attribute object specifies a font family.
:meth:`~wx.TextAttr.HasFontItalic`                                               Returns ``True`` if the attribute object specifies italic style.
:meth:`~wx.TextAttr.HasFontPixelSize`                                            Returns ``True`` if the attribute object specifies a font pixel size.
:meth:`~wx.TextAttr.HasFontPointSize`                                            Returns ``True`` if the attribute object specifies a font point size.
:meth:`~wx.TextAttr.HasFontSize`                                                 Returns ``True`` if the attribute object specifies a font point or pixel size.
:meth:`~wx.TextAttr.HasFontUnderlined`                                           Returns ``True`` if the attribute object specifies either underlining or no underlining.
:meth:`~wx.TextAttr.HasFontWeight`                                               Returns ``True`` if the attribute object specifies font weight (bold, light or normal).
:meth:`~wx.TextAttr.HasLeftIndent`                                               Returns ``True`` if the attribute object specifies a left indent.
:meth:`~wx.TextAttr.HasLineSpacing`                                              Returns ``True`` if the attribute object specifies line spacing.
:meth:`~wx.TextAttr.HasListStyleName`                                            Returns ``True`` if the attribute object specifies a list style name.
:meth:`~wx.TextAttr.HasOutlineLevel`                                             Returns ``True`` if the attribute object specifies an outline level.
:meth:`~wx.TextAttr.HasPageBreak`                                                Returns ``True`` if the attribute object specifies a page break before this paragraph.
:meth:`~wx.TextAttr.HasParagraphSpacingAfter`                                    Returns ``True`` if the attribute object specifies spacing after a paragraph.
:meth:`~wx.TextAttr.HasParagraphSpacingBefore`                                   Returns ``True`` if the attribute object specifies spacing before a paragraph.
:meth:`~wx.TextAttr.HasParagraphStyleName`                                       Returns ``True`` if the attribute object specifies a paragraph style name.
:meth:`~wx.TextAttr.HasRightIndent`                                              Returns ``True`` if the attribute object specifies a right indent.
:meth:`~wx.TextAttr.HasTabs`                                                     Returns ``True`` if the attribute object specifies tab stops.
:meth:`~wx.TextAttr.HasTextColour`                                               Returns ``True`` if the attribute object specifies a text foreground colour.
:meth:`~wx.TextAttr.HasTextEffects`                                              Returns ``True`` if the attribute object specifies text effects.
:meth:`~wx.TextAttr.HasURL`                                                      Returns ``True`` if the attribute object specifies a URL.
:meth:`~wx.TextAttr.IsCharacterStyle`                                            Returns ``True`` if the object represents a character style, that is, the flags specify a font or a text background or foreground colour.
:meth:`~wx.TextAttr.IsDefault`                                                   Returns ``False`` if we have any attributes set, ``True`` otherwise.
:meth:`~wx.TextAttr.IsParagraphStyle`                                            Returns ``True`` if the object represents a paragraph style, that is, the flags specify alignment, indentation, tabs, paragraph spacing, or bullet style.
:meth:`~wx.TextAttr.Merge`                                                       Copies all defined/valid properties from overlay to current object.
:meth:`~wx.TextAttr.SetAlignment`                                                Sets the paragraph alignment.
:meth:`~wx.TextAttr.SetBackgroundColour`                                         Sets the background colour.
:meth:`~wx.TextAttr.SetBulletFont`                                               Sets the name of the font associated with the bullet symbol.
:meth:`~wx.TextAttr.SetBulletName`                                               Sets the standard bullet name, applicable if the bullet style is ``wx.TEXT_ATTR_BULLET_STYLE_STANDARD``.
:meth:`~wx.TextAttr.SetBulletNumber`                                             Sets the bullet number.
:meth:`~wx.TextAttr.SetBulletStyle`                                              Sets the bullet style.
:meth:`~wx.TextAttr.SetBulletText`                                               Sets the bullet text, which could be a symbol, or (for example) cached outline text.
:meth:`~wx.TextAttr.SetCharacterStyleName`                                       Sets the character style name.
:meth:`~wx.TextAttr.SetFlags`                                                    Sets the flags determining which styles are being specified.
:meth:`~wx.TextAttr.SetFont`                                                     Sets the attributes for the given font.
:meth:`~wx.TextAttr.SetFontEncoding`                                             Sets the font encoding.
:meth:`~wx.TextAttr.SetFontFaceName`                                             Sets the font face name.
:meth:`~wx.TextAttr.SetFontFamily`                                               Sets the font family.
:meth:`~wx.TextAttr.SetFontPixelSize`                                            Sets the font size in pixels.
:meth:`~wx.TextAttr.SetFontPointSize`                                            Sets the font size in points.
:meth:`~wx.TextAttr.SetFontSize`                                                 Sets the font size in points.
:meth:`~wx.TextAttr.SetFontStyle`                                                Sets the font style (normal, italic or slanted).
:meth:`~wx.TextAttr.SetFontUnderlined`                                           Sets the font underlining (solid line, text colour).
:meth:`~wx.TextAttr.SetFontUnderlineType`                                        Sets the font underlining.
:meth:`~wx.TextAttr.SetFontWeight`                                               Sets the font weight.
:meth:`~wx.TextAttr.SetLeftIndent`                                               Sets the left indent and left subindent in tenths of a millimetre.
:meth:`~wx.TextAttr.SetLineSpacing`                                              Sets the line spacing.
:meth:`~wx.TextAttr.SetListStyleName`                                            Sets the list style name.
:meth:`~wx.TextAttr.SetOutlineLevel`                                             Specifies the outline level.
:meth:`~wx.TextAttr.SetPageBreak`                                                Specifies a page break before this paragraph.
:meth:`~wx.TextAttr.SetParagraphSpacingAfter`                                    Sets the spacing after a paragraph, in tenths of a millimetre.
:meth:`~wx.TextAttr.SetParagraphSpacingBefore`                                   Sets the spacing before a paragraph, in tenths of a millimetre.
:meth:`~wx.TextAttr.SetParagraphStyleName`                                       Sets the name of the paragraph style.
:meth:`~wx.TextAttr.SetRightIndent`                                              Sets the right indent in tenths of a millimetre.
:meth:`~wx.TextAttr.SetTabs`                                                     Sets the tab stops, expressed in tenths of a millimetre.
:meth:`~wx.TextAttr.SetTextColour`                                               Sets the text foreground colour.
:meth:`~wx.TextAttr.SetTextEffectFlags`                                          Sets the text effect bits of interest.
:meth:`~wx.TextAttr.SetTextEffects`                                              Sets the text effects, a bit list of styles.
:meth:`~wx.TextAttr.SetURL`                                                      Sets the URL for the content.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.TextAttr.Alignment`                                                   See :meth:`~wx.TextAttr.GetAlignment` and :meth:`~wx.TextAttr.SetAlignment`
:attr:`~wx.TextAttr.BackgroundColour`                                            See :meth:`~wx.TextAttr.GetBackgroundColour` and :meth:`~wx.TextAttr.SetBackgroundColour`
:attr:`~wx.TextAttr.BulletFont`                                                  See :meth:`~wx.TextAttr.GetBulletFont` and :meth:`~wx.TextAttr.SetBulletFont`
:attr:`~wx.TextAttr.BulletName`                                                  See :meth:`~wx.TextAttr.GetBulletName` and :meth:`~wx.TextAttr.SetBulletName`
:attr:`~wx.TextAttr.BulletNumber`                                                See :meth:`~wx.TextAttr.GetBulletNumber` and :meth:`~wx.TextAttr.SetBulletNumber`
:attr:`~wx.TextAttr.BulletStyle`                                                 See :meth:`~wx.TextAttr.GetBulletStyle` and :meth:`~wx.TextAttr.SetBulletStyle`
:attr:`~wx.TextAttr.BulletText`                                                  See :meth:`~wx.TextAttr.GetBulletText` and :meth:`~wx.TextAttr.SetBulletText`
:attr:`~wx.TextAttr.CharacterStyleName`                                          See :meth:`~wx.TextAttr.GetCharacterStyleName` and :meth:`~wx.TextAttr.SetCharacterStyleName`
:attr:`~wx.TextAttr.Flags`                                                       See :meth:`~wx.TextAttr.GetFlags` and :meth:`~wx.TextAttr.SetFlags`
:attr:`~wx.TextAttr.Font`                                                        See :meth:`~wx.TextAttr.GetFont` and :meth:`~wx.TextAttr.SetFont`
:attr:`~wx.TextAttr.FontEncoding`                                                See :meth:`~wx.TextAttr.GetFontEncoding` and :meth:`~wx.TextAttr.SetFontEncoding`
:attr:`~wx.TextAttr.FontFaceName`                                                See :meth:`~wx.TextAttr.GetFontFaceName` and :meth:`~wx.TextAttr.SetFontFaceName`
:attr:`~wx.TextAttr.FontFamily`                                                  See :meth:`~wx.TextAttr.GetFontFamily` and :meth:`~wx.TextAttr.SetFontFamily`
:attr:`~wx.TextAttr.FontSize`                                                    See :meth:`~wx.TextAttr.GetFontSize` and :meth:`~wx.TextAttr.SetFontSize`
:attr:`~wx.TextAttr.FontStyle`                                                   See :meth:`~wx.TextAttr.GetFontStyle` and :meth:`~wx.TextAttr.SetFontStyle`
:attr:`~wx.TextAttr.FontUnderlined`                                              See :meth:`~wx.TextAttr.GetFontUnderlined` and :meth:`~wx.TextAttr.SetFontUnderlined`
:attr:`~wx.TextAttr.FontWeight`                                                  See :meth:`~wx.TextAttr.GetFontWeight` and :meth:`~wx.TextAttr.SetFontWeight`
:attr:`~wx.TextAttr.LeftIndent`                                                  See :meth:`~wx.TextAttr.GetLeftIndent` and :meth:`~wx.TextAttr.SetLeftIndent`
:attr:`~wx.TextAttr.LeftSubIndent`                                               See :meth:`~wx.TextAttr.GetLeftSubIndent`
:attr:`~wx.TextAttr.LineSpacing`                                                 See :meth:`~wx.TextAttr.GetLineSpacing` and :meth:`~wx.TextAttr.SetLineSpacing`
:attr:`~wx.TextAttr.ListStyleName`                                               See :meth:`~wx.TextAttr.GetListStyleName` and :meth:`~wx.TextAttr.SetListStyleName`
:attr:`~wx.TextAttr.OutlineLevel`                                                See :meth:`~wx.TextAttr.GetOutlineLevel` and :meth:`~wx.TextAttr.SetOutlineLevel`
:attr:`~wx.TextAttr.ParagraphSpacingAfter`                                       See :meth:`~wx.TextAttr.GetParagraphSpacingAfter` and :meth:`~wx.TextAttr.SetParagraphSpacingAfter`
:attr:`~wx.TextAttr.ParagraphSpacingBefore`                                      See :meth:`~wx.TextAttr.GetParagraphSpacingBefore` and :meth:`~wx.TextAttr.SetParagraphSpacingBefore`
:attr:`~wx.TextAttr.ParagraphStyleName`                                          See :meth:`~wx.TextAttr.GetParagraphStyleName` and :meth:`~wx.TextAttr.SetParagraphStyleName`
:attr:`~wx.TextAttr.RightIndent`                                                 See :meth:`~wx.TextAttr.GetRightIndent` and :meth:`~wx.TextAttr.SetRightIndent`
:attr:`~wx.TextAttr.Tabs`                                                        See :meth:`~wx.TextAttr.GetTabs` and :meth:`~wx.TextAttr.SetTabs`
:attr:`~wx.TextAttr.TextColour`                                                  See :meth:`~wx.TextAttr.GetTextColour` and :meth:`~wx.TextAttr.SetTextColour`
:attr:`~wx.TextAttr.TextEffectFlags`                                             See :meth:`~wx.TextAttr.GetTextEffectFlags` and :meth:`~wx.TextAttr.SetTextEffectFlags`
:attr:`~wx.TextAttr.TextEffects`                                                 See :meth:`~wx.TextAttr.GetTextEffects` and :meth:`~wx.TextAttr.SetTextEffects`
:attr:`~wx.TextAttr.URL`                                                         See :meth:`~wx.TextAttr.GetURL` and :meth:`~wx.TextAttr.SetURL`
:attr:`~wx.TextAttr.UnderlineColour`                                             See :meth:`~wx.TextAttr.GetUnderlineColour`
:attr:`~wx.TextAttr.UnderlineType`                                               See :meth:`~wx.TextAttr.GetUnderlineType`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.TextAttr(object)

   **Possible constructors**::

       TextAttr()
       
       TextAttr(colText, colBack=NullColour, font=NullFont,
                alignment=TEXT_ALIGNMENT_DEFAULT)
       
       TextAttr(attr)
       
   
   TextAttr represents the character and paragraph attributes, or
   style, for a range of text in a TextCtrl or RichTextCtrl.



   .. method:: __init__(self, *args, **kw)

      Constructors.                   


      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self)`
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, colText, colBack=NullColour, font=NullFont, alignment=TEXT_ALIGNMENT_DEFAULT)`
      
      
      
      
      :param `colText`: 
      :type `colText`: wx.Colour
      :param `colBack`: 
      :type `colBack`: wx.Colour
      :param `font`: 
      :type `font`: wx.Font
      :param `alignment`: 
      :type `alignment`: wx.TextAttrAlignment
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, attr)`
      
      
      
      
      :param `attr`: 
      :type `attr`: wx.TextAttr
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: Apply(self, style, compareWith=None)

      Applies the attributes in `style`  to the original object, but not those attributes from `style`  that are the same as those in `compareWith`  (if passed).                  


      :param `style`: 
      :type `style`: wx.TextAttr
      :param `compareWith`: 
      :type `compareWith`: wx.TextAttr




      :rtype: `bool`








   .. method:: EqPartial(self, attr, weakTest=True)

      Partial equality test.                  

      If `weakTest`  is ``True``, attributes of this object do not have to be present if those attributes of `attr`  are present. If `weakTest`  is ``False``, the function will fail if an attribute is present in `attr`  but not in this object.                  


      :param `attr`: 
      :type `attr`: wx.TextAttr
      :param `weakTest`: 
      :type `weakTest`: bool




      :rtype: `bool`








   .. method:: GetAlignment(self)

      Returns the alignment flags.                  

      See :ref:`wx.TextAttrAlignment`  for a list of available styles.                  

      :rtype: :ref:`wx.TextAttrAlignment`








   .. method:: GetBackgroundColour(self)

      Returns the background colour.                  

      :rtype: :ref:`wx.Colour`








   .. method:: GetBulletFont(self)

      Returns a string containing the name of the font associated with the bullet symbol.                  

      Only valid for attributes with ``TEXT_ATTR_BULLET_SYMBOL``.                  

      :rtype: `string`








   .. method:: GetBulletName(self)

      Returns the standard bullet name, applicable if the bullet style is ``wx.TEXT_ATTR_BULLET_STYLE_STANDARD``.                  

      Currently the following standard bullet names are supported:

      -  ``standard/circle``       
      -  ``standard/square``       
      -  ``standard/diamond``       
      -  ``standard/triangle``       




                

      :rtype: `string`







      .. note:: 

         For :ref:`wx.richtext.RichTextCtrl`  users only: if you wish your rich text controls to support further bullet graphics, you can derive a class from :ref:`wx.richtext.RichTextRenderer`  or :ref:`wx.richtext.RichTextStdRenderer`, override  ``DrawStandardBullet``   and   ``EnumerateStandardBulletNames`` , and set an instance of the class using  :meth:`wx.richtext.RichTextBuffer.SetRenderer` .   








   .. method:: GetBulletNumber(self)

      Returns the bullet number.                  

      :rtype: `int`








   .. method:: GetBulletStyle(self)

      Returns the bullet style.                  

      See :ref:`wx.TextAttrBulletStyle`  for a list of available styles.                  

      :rtype: `int`








   .. method:: GetBulletText(self)

      Returns the bullet text, which could be a symbol, or (for example) cached outline text.                  

      :rtype: `string`








   .. method:: GetCharacterStyleName(self)

      Returns the name of the character style.                  

      :rtype: `string`








   .. method:: GetFlags(self)

      Returns flags indicating which attributes are applicable.                  

      See :meth:`SetFlags`   for a list of available flags.                  

      :rtype: `long`








   .. method:: GetFont(self)

      Creates and returns a font specified by the font attributes in the :ref:`wx.TextAttr`  object.                  

      Note that :ref:`wx.TextAttr`  does not store a :ref:`wx.Font`  object, so this is only a temporary font. 

      For greater efficiency, access the font attributes directly.                  

      :rtype: :ref:`wx.Font`








   .. method:: GetFontAttributes(self, font, flags=TEXT_ATTR_FONT)

      Gets the font attributes from the given font, using only the attributes specified by `flags`.                  


      :param `font`: 
      :type `font`: wx.Font
      :param `flags`: 
      :type `flags`: int




      :rtype: `bool`








   .. method:: GetFontEncoding(self)

      Returns the font encoding.                  

      :rtype: :ref:`wx.FontEncoding`








   .. method:: GetFontFaceName(self)

      Returns the font face name.                  

      :rtype: `string`








   .. method:: GetFontFamily(self)

      Returns the font family.                  

      :rtype: :ref:`wx.FontFamily`








   .. method:: GetFontSize(self)

      Returns the font size in points.                  

      :rtype: `int`








   .. method:: GetFontStyle(self)

      Returns the font style.                  

      :rtype: :ref:`wx.FontStyle`








   .. method:: GetFontUnderlined(self)

      Returns ``True`` if the font is underlined.                  

      :rtype: `bool`








   .. method:: GetFontWeight(self)

      Returns the font weight.                  

      :rtype: :ref:`wx.FontWeight`








   .. method:: GetLeftIndent(self)

      Returns the left indent in tenths of a millimetre.                  

      :rtype: `long`








   .. method:: GetLeftSubIndent(self)

      Returns the left sub-indent in tenths of a millimetre.                  

      :rtype: `long`








   .. method:: GetLineSpacing(self)

      Returns the line spacing value, one of :ref:`wx.TextAttrLineSpacing`  values.                  

      :rtype: `int`








   .. method:: GetListStyleName(self)

      Returns the name of the list style.                  

      :rtype: `string`








   .. method:: GetOutlineLevel(self)

      Returns the outline level.                  

      :rtype: `int`








   .. method:: GetParagraphSpacingAfter(self)

      Returns the space in tenths of a millimeter after the paragraph.                  

      :rtype: `int`








   .. method:: GetParagraphSpacingBefore(self)

      Returns the space in tenths of a millimeter before the paragraph.                  

      :rtype: `int`








   .. method:: GetParagraphStyleName(self)

      Returns the name of the paragraph style.                  

      :rtype: `string`








   .. method:: GetRightIndent(self)

      Returns the right indent in tenths of a millimeter.                  

      :rtype: `long`








   .. method:: GetTabs(self)

      Returns an array of tab stops, each expressed in tenths of a millimeter.                  

      Each stop is measured from the left margin and therefore each value must be larger than the last.                  

      :rtype: `list of integers`








   .. method:: GetTextColour(self)

      Returns the text foreground colour.                  

      :rtype: :ref:`wx.Colour`








   .. method:: GetTextEffectFlags(self)

      Returns the text effect bits of interest.                  

      See :meth:`SetFlags`   for further information.                  

      :rtype: `int`








   .. method:: GetTextEffects(self)

      Returns the text effects, a bit list of styles.                  

      See :meth:`SetTextEffects`   for details.                  

      :rtype: `int`








   .. method:: GetURL(self)

      Returns the URL for the content.                  

      Content with ``wx.TEXT_ATTR_URL``  style causes :ref:`wx.richtext.RichTextCtrl`  to show a hand cursor over it, and :ref:`wx.richtext.RichTextCtrl`  generates a :ref:`wx.TextUrlEvent`  when the content is clicked.                  

      :rtype: `string`








   .. method:: GetUnderlineColour(self)

      Returns the underline color used.                  

      NullColour when the text colour is used. 

                

      :rtype: :ref:`wx.Colour`







      .. versionadded:: 4.1/wxWidgets-3.1.3  
     








   .. method:: GetUnderlineType(self)

      Returns the underline type, which is one of the TextAttrUnderlineType values.                  

                

      :rtype: :ref:`wx.TextAttrUnderlineType`







      .. versionadded:: 4.1/wxWidgets-3.1.3  
     








   .. method:: HasAlignment(self)

      Returns ``True`` if the attribute object specifies alignment.                  

      :rtype: `bool`








   .. method:: HasBackgroundColour(self)

      Returns ``True`` if the attribute object specifies a background colour.                  

      :rtype: `bool`








   .. method:: HasBulletName(self)

      Returns ``True`` if the attribute object specifies a standard bullet name.                  

      :rtype: `bool`








   .. method:: HasBulletNumber(self)

      Returns ``True`` if the attribute object specifies a bullet number.                  

      :rtype: `bool`








   .. method:: HasBulletStyle(self)

      Returns ``True`` if the attribute object specifies a bullet style.                  

      :rtype: `bool`








   .. method:: HasBulletText(self)

      Returns ``True`` if the attribute object specifies bullet text (usually specifying a symbol).                  

      :rtype: `bool`








   .. method:: HasCharacterStyleName(self)

      Returns ``True`` if the attribute object specifies a character style name.                  

      :rtype: `bool`








   .. method:: HasFlag(self, flag)

      Returns ``True`` if the `flag`  is present in the attribute object's flag bitlist.                  


      :param `flag`: 
      :type `flag`: long




      :rtype: `bool`








   .. method:: HasFont(self)

      Returns ``True`` if the attribute object specifies any font attributes.                  

      :rtype: `bool`








   .. method:: HasFontEncoding(self)

      Returns ``True`` if the attribute object specifies an encoding.                  

      :rtype: `bool`








   .. method:: HasFontFaceName(self)

      Returns ``True`` if the attribute object specifies a font face name.                  

      :rtype: `bool`








   .. method:: HasFontFamily(self)

      Returns ``True`` if the attribute object specifies a font family.                  

      :rtype: `bool`








   .. method:: HasFontItalic(self)

      Returns ``True`` if the attribute object specifies italic style.                  

      :rtype: `bool`








   .. method:: HasFontPixelSize(self)

      Returns ``True`` if the attribute object specifies a font pixel size.                  

      :rtype: `bool`








   .. method:: HasFontPointSize(self)

      Returns ``True`` if the attribute object specifies a font point size.                  

      :rtype: `bool`








   .. method:: HasFontSize(self)

      Returns ``True`` if the attribute object specifies a font point or pixel size.                  

      :rtype: `bool`








   .. method:: HasFontUnderlined(self)

      Returns ``True`` if the attribute object specifies either underlining or no underlining.                  

      :rtype: `bool`








   .. method:: HasFontWeight(self)

      Returns ``True`` if the attribute object specifies font weight (bold, light or normal).                  

      :rtype: `bool`








   .. method:: HasLeftIndent(self)

      Returns ``True`` if the attribute object specifies a left indent.                  

      :rtype: `bool`








   .. method:: HasLineSpacing(self)

      Returns ``True`` if the attribute object specifies line spacing.                  

      :rtype: `bool`








   .. method:: HasListStyleName(self)

      Returns ``True`` if the attribute object specifies a list style name.                  

      :rtype: `bool`








   .. method:: HasOutlineLevel(self)

      Returns ``True`` if the attribute object specifies an outline level.                  

      :rtype: `bool`








   .. method:: HasPageBreak(self)

      Returns ``True`` if the attribute object specifies a page break before this paragraph.                  

      :rtype: `bool`








   .. method:: HasParagraphSpacingAfter(self)

      Returns ``True`` if the attribute object specifies spacing after a paragraph.                  

      :rtype: `bool`








   .. method:: HasParagraphSpacingBefore(self)

      Returns ``True`` if the attribute object specifies spacing before a paragraph.                  

      :rtype: `bool`








   .. method:: HasParagraphStyleName(self)

      Returns ``True`` if the attribute object specifies a paragraph style name.                  

      :rtype: `bool`








   .. method:: HasRightIndent(self)

      Returns ``True`` if the attribute object specifies a right indent.                  

      :rtype: `bool`








   .. method:: HasTabs(self)

      Returns ``True`` if the attribute object specifies tab stops.                  

      :rtype: `bool`








   .. method:: HasTextColour(self)

      Returns ``True`` if the attribute object specifies a text foreground colour.                  

      :rtype: `bool`








   .. method:: HasTextEffects(self)

      Returns ``True`` if the attribute object specifies text effects.                  

      :rtype: `bool`








   .. method:: HasURL(self)

      Returns ``True`` if the attribute object specifies a URL.                  

      :rtype: `bool`








   .. method:: IsCharacterStyle(self)

      Returns ``True`` if the object represents a character style, that is, the flags specify a font or a text background or foreground colour.                  

      :rtype: `bool`








   .. method:: IsDefault(self)

      Returns ``False`` if we have any attributes set, ``True`` otherwise.                  

      :rtype: `bool`








   .. method:: IsParagraphStyle(self)

      Returns ``True`` if the object represents a paragraph style, that is, the flags specify alignment, indentation, tabs, paragraph spacing, or bullet style.                  

      :rtype: `bool`








   .. method:: Merge(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **Merge** `(self, overlay)`
      
      Copies all defined/valid properties from overlay to current object.                  
      
      
      :param `overlay`: 
      :type `overlay`: wx.TextAttr
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **Merge** `(base, overlay)`
      
      Creates a new  :ref:`wx.TextAttr`  which is a merge of  `base`  and `overlay`.                  
      
      Properties defined in `overlay`  take precedence over those in `base`. Properties undefined/invalid in both are undefined in the result.                  
      
      
      :param `base`: 
      :type `base`: wx.TextAttr
      :param `overlay`: 
      :type `overlay`: wx.TextAttr
      
      
      
      
      :rtype: :ref:`wx.TextAttr`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: SetAlignment(self, alignment)

      Sets the paragraph alignment.                  

      See :ref:`wx.TextAttrAlignment`  enumeration values. 

      Of these, ``wx.TEXT_ALIGNMENT_JUSTIFIED`` is unimplemented. In future justification may be supported when printing or previewing, only.                  


      :param `alignment`: 
      :type `alignment`: wx.TextAttrAlignment







   .. method:: SetBackgroundColour(self, colBack)

      Sets the background colour.                  


      :param `colBack`: 
      :type `colBack`: wx.Colour







   .. method:: SetBulletFont(self, font)

      Sets the name of the font associated with the bullet symbol.                  

      Only valid for attributes with ``TEXT_ATTR_BULLET_SYMBOL``.                  


      :param `font`: 
      :type `font`: string







   .. method:: SetBulletName(self, name)

      Sets the standard bullet name, applicable if the bullet style is ``wx.TEXT_ATTR_BULLET_STYLE_STANDARD``.                  

      See :meth:`GetBulletName`   for a list of supported names, and how to expand the range of supported types.                  


      :param `name`: 
      :type `name`: string







   .. method:: SetBulletNumber(self, n)

      Sets the bullet number.                  


      :param `n`: 
      :type `n`: int







   .. method:: SetBulletStyle(self, style)

      Sets the bullet style.                  

      The :ref:`wx.TextAttrBulletStyle`  enumeration values are all supported, except for ``wx.TEXT_ATTR_BULLET_STYLE_BITMAP``.                  


      :param `style`: 
      :type `style`: int







   .. method:: SetBulletText(self, text)

      Sets the bullet text, which could be a symbol, or (for example) cached outline text.                  


      :param `text`: 
      :type `text`: string







   .. method:: SetCharacterStyleName(self, name)

      Sets the character style name.                  


      :param `name`: 
      :type `name`: string







   .. method:: SetFlags(self, flags)

      Sets the flags determining which styles are being specified.                  

      The :ref:`wx.TextAttrFlags`  values can be passed in a bitlist.                  


      :param `flags`: 
      :type `flags`: long







   .. method:: SetFont(self, font, flags=TEXT_ATTR_FONT & ~TEXT_ATTR_FONT_PIXEL_SIZE)

      Sets the attributes for the given font.                  

      Note that :ref:`wx.TextAttr`  does not store an actual :ref:`wx.Font`  object.                  


      :param `font`: 
      :type `font`: wx.Font
      :param `flags`: 
      :type `flags`: int







   .. method:: SetFontEncoding(self, encoding)

      Sets the font encoding.                  


      :param `encoding`: 
      :type `encoding`: wx.FontEncoding







   .. method:: SetFontFaceName(self, faceName)

      Sets the font face name.                  


      :param `faceName`: 
      :type `faceName`: string







   .. method:: SetFontFamily(self, family)

      Sets the font family.                  


      :param `family`: 
      :type `family`: wx.FontFamily







   .. method:: SetFontPixelSize(self, pixelSize)

      Sets the font size in pixels.                  


      :param `pixelSize`: 
      :type `pixelSize`: int







   .. method:: SetFontPointSize(self, pointSize)

      Sets the font size in points.                  


      :param `pointSize`: 
      :type `pointSize`: int







   .. method:: SetFontSize(self, pointSize)

      Sets the font size in points.                  


      :param `pointSize`: 
      :type `pointSize`: int







   .. method:: SetFontStyle(self, fontStyle)

      Sets the font style (normal, italic or slanted).                  


      :param `fontStyle`: 
      :type `fontStyle`: wx.FontStyle







   .. method:: SetFontUnderlined(self, underlined)

      Sets the font underlining (solid line, text colour).                  


      :param `underlined`: 
      :type `underlined`: bool







   .. method:: SetFontUnderlineType(self, type, colour=NullColour)

      Sets the font underlining.                  




      :param `type`: Type of underline.  
      :type `type`: wx.TextAttrUnderlineType
      :param `colour`: Colour to use for underlining, text colour is used by default.  
      :type `colour`: wx.Colour






                  



      .. versionadded:: 4.1/wxWidgets-3.1.3  
     







      .. note:: 

         On wxMSW, ``wx.TEXT_ATTR_UNDERLINE_DOUBLE`` is shown as ``wx.TEXT_ATTR_UNDERLINE_SOLID``. There is only a limited number of colours supported, the ``RGB`` values are listed `here <https://docs.microsoft.com/en-us/windows/win32/api/tom/nf-tom-itextdocument2-geteffectcolor>`_. ``wx.TEXT_ATTR_UNDERLINE_SPECIAL`` is shown as a waved line.  







      .. note:: 

         On wxGTK, underline colour is only supported by ``GTK3``. ``wx.TEXT_ATTR_UNDERLINE_SPECIAL`` is shown as a waved line. GTK might overrule the colour of ``wx.TEXT_ATTR_UNDERLINE_SPECIAL``.  







      .. note:: 

         On wxOSX, ``wx.TEXT_ATTR_UNDERLINE_SPECIAL`` is shown as a dotted line.  








   .. method:: SetFontWeight(self, fontWeight)

      Sets the font weight.                  


      :param `fontWeight`: 
      :type `fontWeight`: wx.FontWeight







   .. method:: SetLeftIndent(self, indent, subIndent=0)

      Sets the left indent and left subindent in tenths of a millimetre.                  

      The sub-indent is an offset from the left of the paragraph, and is used for all but the first line in a paragraph. 

      A positive value will cause the first line to appear to the left of the subsequent lines, and a negative value will cause the first line to be indented relative to the subsequent lines. 

      :ref:`wx.richtext.RichTextBuffer`  uses indentation to render a bulleted item. The left indent is the distance between the margin and the bullet. The content of the paragraph, including the first line, starts at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the left of the actual paragraph is leftSubIndent.                  


      :param `indent`: 
      :type `indent`: int
      :param `subIndent`: 
      :type `subIndent`: int







   .. method:: SetLineSpacing(self, spacing)

      Sets the line spacing.                  

      `spacing`  is a multiple, where 10 means single-spacing, 15 means 1.5 spacing, and 20 means float spacing. The :ref:`wx.TextAttrLineSpacing`  values are defined for convenience.                  


      :param `spacing`: 
      :type `spacing`: int







   .. method:: SetListStyleName(self, name)

      Sets the list style name.                  


      :param `name`: 
      :type `name`: string







   .. method:: SetOutlineLevel(self, level)

      Specifies the outline level.                  

      Zero represents normal text. At present, the outline level is not used, but may be used in future for determining list levels and for applications that need to store document structure information.                  


      :param `level`: 
      :type `level`: int







   .. method:: SetPageBreak(self, pageBreak=True)

      Specifies a page break before this paragraph.                  


      :param `pageBreak`: 
      :type `pageBreak`: bool







   .. method:: SetParagraphSpacingAfter(self, spacing)

      Sets the spacing after a paragraph, in tenths of a millimetre.                  


      :param `spacing`: 
      :type `spacing`: int







   .. method:: SetParagraphSpacingBefore(self, spacing)

      Sets the spacing before a paragraph, in tenths of a millimetre.                  


      :param `spacing`: 
      :type `spacing`: int







   .. method:: SetParagraphStyleName(self, name)

      Sets the name of the paragraph style.                  


      :param `name`: 
      :type `name`: string







   .. method:: SetRightIndent(self, indent)

      Sets the right indent in tenths of a millimetre.                  


      :param `indent`: 
      :type `indent`: int







   .. method:: SetTabs(self, tabs)

      Sets the tab stops, expressed in tenths of a millimetre.                  

      Each stop is measured from the left margin and therefore each value must be larger than the last.                  


      :param `tabs`: 
      :type `tabs`: list of integers







   .. method:: SetTextColour(self, colText)

      Sets the text foreground colour.                  


      :param `colText`: 
      :type `colText`: wx.Colour







   .. method:: SetTextEffectFlags(self, flags)

      Sets the text effect bits of interest.                  

      You should also pass ``wx.TEXT_ATTR_EFFECTS`` to :meth:`SetFlags` . See :meth:`SetFlags`   for further information.                  


      :param `flags`: 
      :type `flags`: int







   .. method:: SetTextEffects(self, effects)

      Sets the text effects, a bit list of styles.                  

      The :ref:`wx.TextAttrEffects`  enumeration values can be used. 

      Of these, only ``wx.TEXT_ATTR_EFFECT_CAPITALS``, ``wx.TEXT_ATTR_EFFECT_STRIKETHROUGH``, ``wx.TEXT_ATTR_EFFECT_SUPERSCRIPT`` and ``wx.TEXT_ATTR_EFFECT_SUBSCRIPT`` are implemented. 

      ``wx.TEXT_ATTR_EFFECT_CAPITALS`` capitalises text when displayed (leaving the case of the actual buffer text unchanged), and ``wx.TEXT_ATTR_EFFECT_STRIKETHROUGH`` draws a line through text. 

      To set effects, you should also pass ``wx.TEXT_ATTR_EFFECTS`` to :meth:`SetFlags` , and call :meth:`SetTextEffectFlags`   with the styles (taken from the above set) that you are interested in setting.                  


      :param `effects`: 
      :type `effects`: int







   .. method:: SetURL(self, url)

      Sets the URL for the content.                  

      Sets the ``wx.TEXT_ATTR_URL`` style; content with this style causes :ref:`wx.richtext.RichTextCtrl`  to show a hand cursor over it, and :ref:`wx.richtext.RichTextCtrl`  generates a :ref:`wx.TextUrlEvent`  when the content is clicked.                  


      :param `url`: 
      :type `url`: string







   .. attribute:: Alignment

      See :meth:`~wx.TextAttr.GetAlignment` and :meth:`~wx.TextAttr.SetAlignment`


   .. attribute:: BackgroundColour

      See :meth:`~wx.TextAttr.GetBackgroundColour` and :meth:`~wx.TextAttr.SetBackgroundColour`


   .. attribute:: BulletFont

      See :meth:`~wx.TextAttr.GetBulletFont` and :meth:`~wx.TextAttr.SetBulletFont`


   .. attribute:: BulletName

      See :meth:`~wx.TextAttr.GetBulletName` and :meth:`~wx.TextAttr.SetBulletName`


   .. attribute:: BulletNumber

      See :meth:`~wx.TextAttr.GetBulletNumber` and :meth:`~wx.TextAttr.SetBulletNumber`


   .. attribute:: BulletStyle

      See :meth:`~wx.TextAttr.GetBulletStyle` and :meth:`~wx.TextAttr.SetBulletStyle`


   .. attribute:: BulletText

      See :meth:`~wx.TextAttr.GetBulletText` and :meth:`~wx.TextAttr.SetBulletText`


   .. attribute:: CharacterStyleName

      See :meth:`~wx.TextAttr.GetCharacterStyleName` and :meth:`~wx.TextAttr.SetCharacterStyleName`


   .. attribute:: Flags

      See :meth:`~wx.TextAttr.GetFlags` and :meth:`~wx.TextAttr.SetFlags`


   .. attribute:: Font

      See :meth:`~wx.TextAttr.GetFont` and :meth:`~wx.TextAttr.SetFont`


   .. attribute:: FontEncoding

      See :meth:`~wx.TextAttr.GetFontEncoding` and :meth:`~wx.TextAttr.SetFontEncoding`


   .. attribute:: FontFaceName

      See :meth:`~wx.TextAttr.GetFontFaceName` and :meth:`~wx.TextAttr.SetFontFaceName`


   .. attribute:: FontFamily

      See :meth:`~wx.TextAttr.GetFontFamily` and :meth:`~wx.TextAttr.SetFontFamily`


   .. attribute:: FontSize

      See :meth:`~wx.TextAttr.GetFontSize` and :meth:`~wx.TextAttr.SetFontSize`


   .. attribute:: FontStyle

      See :meth:`~wx.TextAttr.GetFontStyle` and :meth:`~wx.TextAttr.SetFontStyle`


   .. attribute:: FontUnderlined

      See :meth:`~wx.TextAttr.GetFontUnderlined` and :meth:`~wx.TextAttr.SetFontUnderlined`


   .. attribute:: FontWeight

      See :meth:`~wx.TextAttr.GetFontWeight` and :meth:`~wx.TextAttr.SetFontWeight`


   .. attribute:: LeftIndent

      See :meth:`~wx.TextAttr.GetLeftIndent` and :meth:`~wx.TextAttr.SetLeftIndent`


   .. attribute:: LeftSubIndent

      See :meth:`~wx.TextAttr.GetLeftSubIndent`


   .. attribute:: LineSpacing

      See :meth:`~wx.TextAttr.GetLineSpacing` and :meth:`~wx.TextAttr.SetLineSpacing`


   .. attribute:: ListStyleName

      See :meth:`~wx.TextAttr.GetListStyleName` and :meth:`~wx.TextAttr.SetListStyleName`


   .. attribute:: OutlineLevel

      See :meth:`~wx.TextAttr.GetOutlineLevel` and :meth:`~wx.TextAttr.SetOutlineLevel`


   .. attribute:: ParagraphSpacingAfter

      See :meth:`~wx.TextAttr.GetParagraphSpacingAfter` and :meth:`~wx.TextAttr.SetParagraphSpacingAfter`


   .. attribute:: ParagraphSpacingBefore

      See :meth:`~wx.TextAttr.GetParagraphSpacingBefore` and :meth:`~wx.TextAttr.SetParagraphSpacingBefore`


   .. attribute:: ParagraphStyleName

      See :meth:`~wx.TextAttr.GetParagraphStyleName` and :meth:`~wx.TextAttr.SetParagraphStyleName`


   .. attribute:: RightIndent

      See :meth:`~wx.TextAttr.GetRightIndent` and :meth:`~wx.TextAttr.SetRightIndent`


   .. attribute:: Tabs

      See :meth:`~wx.TextAttr.GetTabs` and :meth:`~wx.TextAttr.SetTabs`


   .. attribute:: TextColour

      See :meth:`~wx.TextAttr.GetTextColour` and :meth:`~wx.TextAttr.SetTextColour`


   .. attribute:: TextEffectFlags

      See :meth:`~wx.TextAttr.GetTextEffectFlags` and :meth:`~wx.TextAttr.SetTextEffectFlags`


   .. attribute:: TextEffects

      See :meth:`~wx.TextAttr.GetTextEffects` and :meth:`~wx.TextAttr.SetTextEffects`


   .. attribute:: URL

      See :meth:`~wx.TextAttr.GetURL` and :meth:`~wx.TextAttr.SetURL`


   .. attribute:: UnderlineColour

      See :meth:`~wx.TextAttr.GetUnderlineColour`


   .. attribute:: UnderlineType

      See :meth:`~wx.TextAttr.GetUnderlineType`

