
    hi%5                        d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	 ddl
mZmZ erddlmZ ddlmZ dd	l
mZ  G d
 de          ZdS )zFont-related proxy objects.    )annotations)TYPE_CHECKINGAny)ColorFormat)WD_UNDERLINE)ElementProxyEmu)WD_COLOR_INDEX)CT_R)Lengthc                  0    e Zd ZdZdKdL fdZedMd
            Zej        dNd            ZedMd            Zej        dNd            Zed             Z	edMd            Z
e
j        dNd            Z
edMd            Zej        dNd            ZedMd            Zej        dNd            ZedMd            Zej        dNd            ZedMd            Zej        dNd            ZedMd            Zej        dNd            ZedOd            Zej        dPd            ZedMd             Zej        dNd!            ZedMd"            Zej        dNd#            ZedMd$            Zej        dNd%            ZedQd'            Zej        dRd(            ZedMd)            Zej        dNd*            ZedMd+            Zej        dNd,            ZedMd-            Zej        dNd.            ZedMd/            Zej        dNd0            ZedSd2            Zej        dTd5            ZedMd6            Zej        dNd7            ZedMd8            Zej        dNd9            ZedMd:            Zej        dNd;            ZedMd<            Zej        dNd=            ZedMd>            Zej        dNd?            ZedMd@            Zej        dNdA            ZedUdC            Z e j        dVdD            Z edMdE            Z!e!j        dNdF            Z!dWdIZ"dXdJZ# xZ$S )YFontzProxy object for parent of a `<w:rPr>` element and providing access to
    character properties such as font name, font size, bold, and subscript.Nrr   parent
Any | Nonec                h    t                                          ||           || _        || _        d S N)super__init___element_r)selfr   r   	__class__s      f/var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/docx/text/font.pyr   zFont.__init__   s/    F###    returnbool | Nonec                ,    |                      d          S )zTRead/write.

        Causes text in this font to appear in capital letters.
        caps_get_bool_propr   s    r   all_capszFont.all_caps   s     ""6***r   valueNonec                2    |                      d|           d S )Nr   _set_bool_propr   r$   s     r   r#   zFont.all_caps"   s    FE*****r   c                ,    |                      d          S )zIRead/write.

        Causes text in this font to appear in bold.
        br    r"   s    r   boldz	Font.bold&   s     ""3'''r   c                2    |                      d|           d S )Nr+   r'   r)   s     r   r,   z	Font.bold.       C'''''r   c                *    t          | j                  S )z[A |ColorFormat| object providing a way to get and set the text color for this
        font.)r   r   r"   s    r   colorz
Font.color2   s     4=)))r   c                ,    |                      d          S )zRead/write tri-state value.

        When |True|, causes the characters in the run to be treated as complex script
        regardless of their Unicode values.
        csr    r"   s    r   complex_scriptzFont.complex_script8   s     ""4(((r   c                2    |                      d|           d S )Nr2   r'   r)   s     r   r3   zFont.complex_scriptA   s    D%(((((r   c                ,    |                      d          S )zRead/write tri-state value.

        When |True|, causes the complex script characters in the run to be displayed in
        bold typeface.
        bCsr    r"   s    r   cs_boldzFont.cs_boldE        ""5)))r   c                2    |                      d|           d S )Nr6   r'   r)   s     r   r7   zFont.cs_boldN       E5)))))r   c                ,    |                      d          S )zRead/write tri-state value.

        When |True|, causes the complex script characters in the run to be displayed in
        italic typeface.
        iCsr    r"   s    r   	cs_italiczFont.cs_italicR   r8   r   c                2    |                      d|           d S )Nr<   r'   r)   s     r   r=   zFont.cs_italic[   r:   r   c                ,    |                      d          S )zzRead/write tri-state value.

        When |True|, causes the text in the run to appear with double strikethrough.
        dstriker    r"   s    r   double_strikezFont.double_strike_        ""9---r   c                2    |                      d|           d S )Nr@   r'   r)   s     r   rA   zFont.double_strikeg       Iu-----r   c                ,    |                      d          S )zRead/write tri-state value.

        When |True|, causes the text in the run to appear as if raised off the page in
        relief.
        embossr    r"   s    r   rF   zFont.embossk        ""8,,,r   c                2    |                      d|           d S )NrF   r'   r)   s     r   rF   zFont.embosst       He,,,,,r   c                ,    |                      d          S )zRead/write tri-state value.

        When |True|, causes the text in the run to be hidden from display, unless
        applications settings force hidden text to be shown.
        vanishr    r"   s    r   hiddenzFont.hiddenx   rG   r   c                2    |                      d|           d S )NrK   r'   r)   s     r   rL   zFont.hidden   rI   r   WD_COLOR_INDEX | Nonec                0    | j         j        }|dS |j        S )z:Color of highlighing applied or |None| if not highlighted.N)r   rPrhighlight_valr   rP   s     r   highlight_colorzFont.highlight_color   s!     m;4  r   c                F    | j                                         }||_        d S r   )r   get_or_add_rPrrQ   r   r$   rP   s      r   rS   zFont.highlight_color   s#    m**,,!r   c                ,    |                      d          S )zRead/write tri-state value.

        When |True|, causes the text of the run to appear in italics. |None| indicates
        the effective value is inherited from the style hierarchy.
        ir    r"   s    r   italiczFont.italic   s     ""3'''r   c                2    |                      d|           d S )NrX   r'   r)   s     r   rY   zFont.italic   r.   r   c                ,    |                      d          S )z|Read/write tri-state value.

        When |True|, causes the text in the run to appear as if pressed into the page.
        imprintr    r"   s    r   r\   zFont.imprint   rB   r   c                2    |                      d|           d S )Nr\   r'   r)   s     r   r\   zFont.imprint   rD   r   c                ,    |                      d          S )zRead/write tri-state value.

        When |True|, specifies this run contains WML that should be handled as though it
        was Office Open XML Math.
        oMathr    r"   s    r   mathz	Font.math   s     ""7+++r   c                2    |                      d|           d S )Nr_   r'   r)   s     r   r`   z	Font.math   s    GU+++++r   
str | Nonec                0    | j         j        }|dS |j        S )zThe typeface name for this |Font|.

        Causes the text it controls to appear in the named font, if a matching font is
        found. |None| indicates the typeface is inherited from the style hierarchy.
        N)r   rP   rFonts_asciirR   s     r   namez	Font.name   s!     m;4r   c                T    | j                                         }||_        ||_        d S r   )r   rU   rd   rFonts_hAnsirV   s      r   re   z	Font.name   s+    m**,,  r   c                ,    |                      d          S )zRead/write tri-state value.

        When |True|, specifies that the contents of this run should not report any
        errors when the document is scanned for spelling and grammar.
        noProofr    r"   s    r   no_proofzFont.no_proof   s     ""9---r   c                2    |                      d|           d S )Nri   r'   r)   s     r   rj   zFont.no_proof   rD   r   c                ,    |                      d          S )zRead/write tri-state value.

        When |True| causes the characters in the run to appear as if they have an
        outline, by drawing a one pixel wide border around the inside and outside
        borders of each character glyph.
        outliner    r"   s    r   rm   zFont.outline   s     ""9---r   c                2    |                      d|           d S )Nrm   r'   r)   s     r   rm   zFont.outline   rD   r   c                ,    |                      d          S )z{Read/write tri-state value.

        When |True| causes the text in the run to have right-to-left characteristics.
        rtlr    r"   s    r   rp   zFont.rtl   s     ""5)))r   c                2    |                      d|           d S )Nrp   r'   r)   s     r   rp   zFont.rtl   r:   r   c                ,    |                      d          S )zRead/write tri-state value.

        When |True| causes the text in the run to appear as if each character has a
        shadow.
        shadowr    r"   s    r   rs   zFont.shadow   rG   r   c                2    |                      d|           d S )Nrs   r'   r)   s     r   rs   zFont.shadow   rI   r   Length | Nonec                0    | j         j        }|dS |j        S )a  Font height in English Metric Units (EMU).

        |None| indicates the font size should be inherited from the style hierarchy.
        |Length| is a subclass of |int| having properties for convenient conversion into
        points or other length units. The :class:`docx.shared.Pt` class allows
        convenient specification of point values::

            >>> font.size = Pt(24)
            >>> font.size
            304800
            >>> font.size.pt
            24.0

        N)r   rP   sz_valrR   s     r   sizez	Font.size   s       m;4zr   emuint | Length | Nonec                h    | j                                         }|d nt          |          |_        d S r   )r   rU   r	   rw   )r   ry   rP   s      r   rx   z	Font.size  s.    m**,, [TTc#hh


r   c                ,    |                      d          S )zRead/write tri-state value.

        When |True| causes the lowercase characters in the run to appear as capital
        letters two points smaller than the font size specified for the run.
        	smallCapsr    r"   s    r   
small_capszFont.small_caps       "";///r   c                2    |                      d|           d S )Nr}   r'   r)   s     r   r~   zFont.small_caps!      K/////r   c                ,    |                      d          S )zRead/write tri-state value.

        When |True| causes the run to use the document grid characters per line settings
        defined in the docGrid element when laying out the characters in this run.
        
snapToGridr    r"   s    r   snap_to_gridzFont.snap_to_grid%  s     ""<000r   c                2    |                      d|           d S )Nr   r'   r)   s     r   r   zFont.snap_to_grid.      L%00000r   c                ,    |                      d          S )u\  Read/write tri-state value.

        When |True|, specifies that the given run shall always behave as if it is
        hidden, even when hidden text is being displayed in the current document. The
        property has a very narrow, specialized use related to the table of contents.
        Consult the spec (§17.3.2.36) for more details.
        
specVanishr    r"   s    r   spec_vanishzFont.spec_vanish2  s     ""<000r   c                2    |                      d|           d S )Nr   r'   r)   s     r   r   zFont.spec_vanish=  r   r   c                ,    |                      d          S )zRead/write tri-state value.

        When |True| causes the text in the run to appear with a single horizontal line
        through the center of the line.
        striker    r"   s    r   r   zFont.strikeA  rG   r   c                2    |                      d|           d S )Nr   r'   r)   s     r   r   zFont.strikeJ  rI   r   c                0    | j         j        }|dS |j        S )zBoolean indicating whether the characters in this |Font| appear as subscript.

        |None| indicates the subscript/subscript value is inherited from the style
        hierarchy.
        N)r   rP   	subscriptrR   s     r   r   zFont.subscriptN  s      m;4}r   c                F    | j                                         }||_        d S r   )r   rU   r   rV   s      r   r   zFont.subscriptZ  s     m**,,r   c                0    | j         j        }|dS |j        S )zBoolean indicating whether the characters in this |Font| appear as
        superscript.

        |None| indicates the subscript/superscript value is inherited from the style
        hierarchy.
        N)r   rP   superscriptrR   s     r   r   zFont.superscript_  s      m;4r   c                F    | j                                         }||_        d S r   )r   rU   r   rV   s      r   r   zFont.superscriptl  s     m**,,r   bool | WD_UNDERLINE | Nonec                    | j         j        }|dS |j        }|t          j        k    rdn%|t          j        k    rdn|t          j        k    rdn|S )a  The underline style for this |Font|.

        The value is one of |None|, |True|, |False|, or a member of :ref:`WdUnderline`.

        |None| indicates the font inherits its underline value from the style hierarchy.
        |False| indicates no underline. |True| indicates single underline. The values
        from :ref:`WdUnderline` are used to specify other outline styles such as double,
        wavy, and dotted.
        NTF)r   rP   u_valr   	INHERITEDSINGLENONE)r   rP   vals      r   	underlinezFont.underlineq  sl     m;4i l,,, D l)))  l''' 	
r   c                    | j                                         }|du rt          j        n|du rt          j        n|}||_        d S )NTF)r   rU   r   r   r   r   )r   r$   rP   r   s       r   r   zFont.underline  sN    m**,,
 $)D==L5TY>>l6G6G_d 	 			r   c                ,    |                      d          S )zRead/write tri-state value.

        When |True|, specifies that the contents of this run shall be hidden when the
        document is displayed in web page view.
        	webHiddenr    r"   s    r   
web_hiddenzFont.web_hidden  r   r   c                2    |                      d|           d S )Nr   r'   r)   s     r   r   zFont.web_hidden  r   r   re   strc                L    | j         j        }|dS |                    |          S )z;Return the value of boolean child of `w:rPr` having `name`.N)r   rP   _get_bool_val)r   re   rP   s      r   r!   zFont._get_bool_prop  s*    m;4  &&&r   c                d    | j                                         }|                    ||           dS )z6Assign `value` to the boolean child `name` of `w:rPr`.N)r   rU   _set_bool_val)r   re   r$   rP   s       r   r(   zFont._set_bool_prop  s1    m**,,$&&&&&r   r   )r   r   r   r   )r   r   )r$   r   r   r%   )r   rN   )r$   rN   )r   rb   )r$   rb   r   r%   )r   ru   )ry   rz   r   r%   )r   r   )r$   r   r   r%   )re   r   r   r   )re   r   r$   r   )%__name__
__module____qualname____doc__r   propertyr#   setterr,   r0   r3   r7   r=   rA   rF   rL   rS   rY   r\   r`   re   rj   rm   rp   rs   rx   r~   r   r   r   r   r   r   r   r!   r(   __classcell__)r   s   @r   r   r      s[       O O      
 + + + X+ _+ + + _+ ( ( ( X( 
[( ( ( [( * * X*
 ) ) ) X) ) ) ) ) * * * X* ^* * * ^* * * * X* * * * * . . . X. . . . . - - - X- ]- - - ]- - - - X- ]- - - ]- ! ! ! X! " " " " ( ( ( X( ]( ( ( ]( . . . X. ^. . . ^. , , , X, 
[, , , [, 	  	  	  X	  
[! ! ! [!
 . . . X. _. . . _. . . . X. ^. . . ^. * * * X* 	Z* * * Z* - - - X- ]- - - ]-    X( 
[7 7 7 [7 0 0 0 X0 0 0 0 0 1 1 1 X1 1 1 1 1 1 1 1 X1 1 1 1 1 - - - X- ]- - - ]- 	 	 	 X	     
 
 
 X
         
 
 
 X
0     0 0 0 X0 0 0 0 0' ' ' '' ' ' ' ' ' ' 'r   r   N)r   
__future__r   typingr   r   docx.dml.colorr   docx.enum.textr   docx.sharedr   r	   r
   docx.oxml.text.runr   r   r    r   r   <module>r      s    ! ! " " " " " " % % % % % % % % & & & & & & ' ' ' ' ' ' ) ) ) ) ) ) ) ) #------''''''""""""[' [' [' [' ['< [' [' [' [' ['r   