o
    Z*V.                     @   sH   d Z ddlmZmZmZmZ ddlmZ ddlm	Z	 G dd de	Z
dS )	z
Font-related proxy objects.
    )absolute_importdivisionprint_functionunicode_literals   )ColorFormat)ElementProxyc                   @   s  e Zd ZdZdZedd Zejdd Zedd Zejdd Zed	d
 Z	edd Z
e
jdd Z
edd Zejdd Zedd Zejdd Zedd Zejdd Zedd Zejdd Zedd Zejdd Zedd Zejdd Zed d! Zejd"d! Zed#d$ Zejd%d$ Zed&d' Zejd(d' Zed)d* Zejd+d* Zed,d- Zejd.d- Zed/d0 Zejd1d0 Zed2d3 Zejd4d3 Zed5d6 Zejd7d6 Zed8d9 Zejd:d9 Zed;d< Zejd=d< Zed>d? Zejd@d? ZedAdB ZejdCdB ZedDdE ZejdFdE ZedGdH ZejdIdH ZedJdK ZejdLdK ZedMdN Z e jdOdN Z edPdQ Z!e!jdRdQ Z!dSdT Z"dUdV Z#dWS )XFontz
    Proxy object wrapping the parent of a ``<w:rPr>`` element and providing
    access to character properties such as font name, font size, bold, and
    subscript.
     c                 C   
   |  dS )zT
        Read/write. Causes text in this font to appear in capital letters.
        caps_get_bool_propselfr
   r
   >D:\Projects\ConvertPro\env\Lib\site-packages\docx\text\font.pyall_caps      
zFont.all_capsc                 C      |  d| d S )Nr   _set_bool_propr   valuer
   r
   r   r         c                 C   r   )zI
        Read/write. Causes text in this font to appear in bold.
        br   r   r
   r
   r   bold#   r   z	Font.boldc                 C   r   )Nr   r   r   r
   r
   r   r   *   r   c                 C   s
   t | jS )zm
        A |ColorFormat| object providing a way to get and set the text color
        for this font.
        )r   _elementr   r
   r
   r   color.      
z
Font.colorc                 C   r   )z
        Read/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   r
   r
   r   complex_script6      
zFont.complex_scriptc                 C   r   )Nr   r   r   r
   r
   r   r    ?   r   c                 C   r   )z
        Read/write tri-state value. When |True|, causes the complex script
        characters in the run to be displayed in bold typeface.
        bCsr   r   r
   r
   r   cs_boldC   r   zFont.cs_boldc                 C   r   )Nr"   r   r   r
   r
   r   r#   K   r   c                 C   r   )z
        Read/write tri-state value. When |True|, causes the complex script
        characters in the run to be displayed in italic typeface.
        iCsr   r   r
   r
   r   	cs_italicO   r   zFont.cs_italicc                 C   r   )Nr$   r   r   r
   r
   r   r%   W   r   c                 C   r   )z
        Read/write tri-state value. When |True|, causes the text in the run
        to appear with double strikethrough.
        dstriker   r   r
   r
   r   double_strike[   r   zFont.double_strikec                 C   r   )Nr&   r   r   r
   r
   r   r'   c   r   c                 C   r   )z
        Read/write tri-state value. When |True|, causes the text in the run
        to appear as if raised off the page in relief.
        embossr   r   r
   r
   r   r(   g   r   zFont.embossc                 C   r   )Nr(   r   r   r
   r
   r   r(   o   r   c                 C   r   )z
        Read/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   r
   r
   r   hiddens   r!   zFont.hiddenc                 C   r   )Nr)   r   r   r
   r
   r   r*   |   r   c                 C      | j j}|du r
dS |jS )z
        A member of :ref:`WdColorIndex` indicating the color of highlighting
        applied, or `None` if no highlighting is applied.
        N)r   rPrhighlight_valr   r,   r
   r
   r   highlight_color   s   zFont.highlight_colorc                 C      | j  }||_d S N)r   get_or_add_rPrr-   r   r   r,   r
   r
   r   r/         

c                 C   r   )z
        Read/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   r
   r
   r   italic   r!   zFont.italicc                 C   r   )Nr5   r   r   r
   r
   r   r6      r   c                 C   r   )z
        Read/write tri-state value. When |True|, causes the text in the run
        to appear as if pressed into the page.
        imprintr   r   r
   r
   r   r7      r   zFont.imprintc                 C   r   )Nr7   r   r   r
   r
   r   r7      r   c                 C   r   )z
        Read/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   r
   r
   r   math   r   z	Font.mathc                 C   r   )Nr8   r   r   r
   r
   r   r9      r   c                 C   r+   )z
        Get or set the typeface name for this |Font| instance, causing 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   r,   rFonts_asciir.   r
   r
   r   name   s   z	Font.namec                 C   s   | j  }||_||_d S r1   )r   r2   r:   ZrFonts_hAnsir3   r
   r
   r   r;      s   

c                 C   r   )z
        Read/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   r
   r
   r   no_proof   r!   zFont.no_proofc                 C   r   )Nr<   r   r   r
   r
   r   r=      r   c                 C   r   )z
        Read/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   r
   r
   r   r>      r!   zFont.outlinec                 C   r   )Nr>   r   r   r
   r
   r   r>      r   c                 C   r   )z
        Read/write tri-state value. When |True| causes the text in the run
        to have right-to-left characteristics.
        rtlr   r   r
   r
   r   r?      r   zFont.rtlc                 C   r   )Nr?   r   r   r
   r
   r   r?      r   c                 C   r   )z
        Read/write tri-state value. When |True| causes the text in the run
        to appear as if each character has a shadow.
        shadowr   r   r
   r
   r   r@      r   zFont.shadowc                 C   r   )Nr@   r   r   r
   r
   r   r@      r   c                 C   r+   )a$  
        Read/write |Length| value or |None|, indicating the 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   r,   sz_valr.   r
   r
   r   size   s   z	Font.sizec                 C   r0   r1   )r   r2   rA   )r   Zemur,   r
   r
   r   rB     r4   c                 C   r   )z
        Read/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   r
   r
   r   
small_caps  r!   zFont.small_capsc                 C   r   )NrC   r   r   r
   r
   r   rD     r   c                 C   r   )z
        Read/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   r
   r
   r   snap_to_grid!  r!   zFont.snap_to_gridc                 C   r   )NrE   r   r   r
   r
   r   rF   *  r   c                 C   r   )ud  
        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   r
   r
   r   spec_vanish.  s   
	zFont.spec_vanishc                 C   r   )NrG   r   r   r
   r
   r   rH   9  r   c                 C   r   )z
        Read/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   r
   r
   r   rI   =  r!   zFont.strikec                 C   r   )NrI   r   r   r
   r
   r   rI   F  r   c                 C   r+   )z
        Boolean indicating whether the characters in this |Font| appear as
        subscript. |None| indicates the subscript/subscript value is
        inherited from the style hierarchy.
        N)r   r,   	subscriptr.   r
   r
   r   rJ   J     zFont.subscriptc                 C   r0   r1   )r   r2   rJ   r3   r
   r
   r   rJ   V  r4   c                 C   r+   )z
        Boolean indicating whether the characters in this |Font| appear as
        superscript. |None| indicates the subscript/superscript value is
        inherited from the style hierarchy.
        N)r   r,   superscriptr.   r
   r
   r   rL   [  rK   zFont.superscriptc                 C   r0   r1   )r   r2   rL   r3   r
   r
   r   rL   g  r4   c                 C   r+   )a  
        The underline style for this |Font|, one of |None|, |True|, |False|,
        or a value from :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.
        N)r   r,   u_valr.   r
   r
   r   	underlinel  s   
zFont.underlinec                 C   r0   r1   )r   r2   rM   r3   r
   r
   r   rN   {  r4   c                 C   r   )z
        Read/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   r
   r
   r   
web_hidden  r!   zFont.web_hiddenc                 C   r   )NrO   r   r   r
   r
   r   rP     r   c                 C   s   | j j}|du r
dS ||S )zM
        Return the value of boolean child of `w:rPr` having *name*.
        N)r   r,   Z_get_bool_val)r   r;   r,   r
   r
   r   r     s   
zFont._get_bool_propc                 C   s   | j  }||| dS )zH
        Assign *value* to the boolean child *name* of `w:rPr`.
        N)r   r2   Z_set_bool_val)r   r;   r   r,   r
   r
   r   r     s   
zFont._set_bool_propN)$__name__
__module____qualname____doc__	__slots__propertyr   setterr   r   r    r#   r%   r'   r(   r*   r/   r6   r7   r9   r;   r=   r>   r?   r@   rB   rD   rF   rH   rI   rJ   rL   rN   rP   r   r   r
   r
   r
   r   r	      s    






















































	r	   N)rT   Z
__future__r   r   r   r   Z	dml.colorr   sharedr   r	   r
   r
   r
   r   <module>   s
   