B
    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   s
   |  dS )zT
        Read/write. Causes text in this font to appear in capital letters.
        caps)_get_bool_prop)selfr
   r
   @/var/www/html/venv/lib/python3.7/site-packages/docx/text/font.pyall_caps   s    zFont.all_capsc             C   s   |  d| d S )Nr   )_set_bool_prop)r   valuer
   r
   r   r      s    c             C   s
   |  dS )zI
        Read/write. Causes text in this font to appear in bold.
        b)r   )r   r
   r
   r   bold#   s    z	Font.boldc             C   s   |  d| d S )Nr   )r   )r   r   r
   r
   r   r   *   s    c             C   s
   t | jS )zm
        A |ColorFormat| object providing a way to get and set the text color
        for this font.
        )r   _element)r   r
   r
   r   color.   s    z
Font.colorc             C   s
   |  dS )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.
        cs)r   )r   r
   r
   r   complex_script6   s    zFont.complex_scriptc             C   s   |  d| d S )Nr   )r   )r   r   r
   r
   r   r   ?   s    c             C   s
   |  dS )z
        Read/write tri-state value. When |True|, causes the complex script
        characters in the run to be displayed in bold typeface.
        bCs)r   )r   r
   r
   r   cs_boldC   s    zFont.cs_boldc             C   s   |  d| d S )Nr   )r   )r   r   r
   r
   r   r   K   s    c             C   s
   |  dS )z
        Read/write tri-state value. When |True|, causes the complex script
        characters in the run to be displayed in italic typeface.
        iCs)r   )r   r
   r
   r   	cs_italicO   s    zFont.cs_italicc             C   s   |  d| d S )Nr   )r   )r   r   r
   r
   r   r   W   s    c             C   s
   |  dS )z
        Read/write tri-state value. When |True|, causes the text in the run
        to appear with double strikethrough.
        dstrike)r   )r   r
   r
   r   double_strike[   s    zFont.double_strikec             C   s   |  d| d S )Nr   )r   )r   r   r
   r
   r   r   c   s    c             C   s
   |  dS )z
        Read/write tri-state value. When |True|, causes the text in the run
        to appear as if raised off the page in relief.
        emboss)r   )r   r
   r
   r   r   g   s    zFont.embossc             C   s   |  d| d S )Nr   )r   )r   r   r
   r
   r   r   o   s    c             C   s
   |  dS )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.
        vanish)r   )r   r
   r
   r   hiddens   s    zFont.hiddenc             C   s   |  d| d S )Nr   )r   )r   r   r
   r
   r   r    |   s    c             C   s   | j j}|dk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   s   | j  }||_d S )N)r   get_or_add_rPrr"   )r   r   r!   r
   r
   r   r#      s    
c             C   s
   |  dS )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.
        i)r   )r   r
   r
   r   italic   s    zFont.italicc             C   s   |  d| d S )Nr%   )r   )r   r   r
   r
   r   r&      s    c             C   s
   |  dS )z
        Read/write tri-state value. When |True|, causes the text in the run
        to appear as if pressed into the page.
        imprint)r   )r   r
   r
   r   r'      s    zFont.imprintc             C   s   |  d| d S )Nr'   )r   )r   r   r
   r
   r   r'      s    c             C   s
   |  dS )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.
        oMath)r   )r   r
   r
   r   math   s    z	Font.mathc             C   s   |  d| d S )Nr(   )r   )r   r   r
   r
   r   r)      s    c             C   s   | j j}|dkrdS |jS )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_ascii)r   r!   r
   r
   r   name   s    z	Font.namec             C   s   | j  }||_||_d S )N)r   r$   r*   ZrFonts_hAnsi)r   r   r!   r
   r
   r   r+      s    
c             C   s
   |  dS )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.
        noProof)r   )r   r
   r
   r   no_proof   s    zFont.no_proofc             C   s   |  d| d S )Nr,   )r   )r   r   r
   r
   r   r-      s    c             C   s
   |  dS )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.
        outline)r   )r   r
   r
   r   r.      s    zFont.outlinec             C   s   |  d| d S )Nr.   )r   )r   r   r
   r
   r   r.      s    c             C   s
   |  dS )z
        Read/write tri-state value. When |True| causes the text in the run
        to have right-to-left characteristics.
        rtl)r   )r   r
   r
   r   r/      s    zFont.rtlc             C   s   |  d| d S )Nr/   )r   )r   r   r
   r
   r   r/      s    c             C   s
   |  dS )z
        Read/write tri-state value. When |True| causes the text in the run
        to appear as if each character has a shadow.
        shadow)r   )r   r
   r
   r   r0      s    zFont.shadowc             C   s   |  d| d S )Nr0   )r   )r   r   r
   r
   r   r0      s    c             C   s   | j j}|dkrdS |jS )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_val)r   r!   r
   r
   r   size   s    z	Font.sizec             C   s   | j  }||_d S )N)r   r$   r1   )r   Zemur!   r
   r
   r   r2     s    
c             C   s
   |  dS )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.
        	smallCaps)r   )r   r
   r
   r   
small_caps  s    zFont.small_capsc             C   s   |  d| d S )Nr3   )r   )r   r   r
   r
   r   r4     s    c             C   s
   |  dS )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.
        
snapToGrid)r   )r   r
   r
   r   snap_to_grid!  s    zFont.snap_to_gridc             C   s   |  d| d S )Nr5   )r   )r   r   r
   r
   r   r6   *  s    c             C   s
   |  dS )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.
        
specVanish)r   )r   r
   r
   r   spec_vanish.  s    	zFont.spec_vanishc             C   s   |  d| d S )Nr7   )r   )r   r   r
   r
   r   r8   9  s    c             C   s
   |  dS )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.
        strike)r   )r   r
   r
   r   r9   =  s    zFont.strikec             C   s   |  d| d S )Nr9   )r   )r   r   r
   r
   r   r9   F  s    c             C   s   | j j}|dkrdS |jS )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!   	subscript)r   r!   r
   r
   r   r:   J  s    zFont.subscriptc             C   s   | j  }||_d S )N)r   r$   r:   )r   r   r!   r
   r
   r   r:   V  s    
c             C   s   | j j}|dkrdS |jS )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!   superscript)r   r!   r
   r
   r   r;   [  s    zFont.superscriptc             C   s   | j  }||_d S )N)r   r$   r;   )r   r   r!   r
   r
   r   r;   g  s    
c             C   s   | j j}|dkrdS |jS )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_val)r   r!   r
   r
   r   	underlinel  s    
zFont.underlinec             C   s   | j  }||_d S )N)r   r$   r<   )r   r   r!   r
   r
   r   r=   {  s    
c             C   s
   |  dS )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.
        	webHidden)r   )r   r
   r
   r   
web_hidden  s    zFont.web_hiddenc             C   s   |  d| d S )Nr>   )r   )r   r   r
   r
   r   r?     s    c             C   s   | j j}|dk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   r$   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#   r&   r'   r)   r+   r-   r.   r/   r0   r2   r4   r6   r8   r9   r:   r;   r=   r?   r   r   r
   r
   r
   r   r	      sr   										r	   N)rC   
__future__r   r   r   r   Z	dml.colorr   sharedr   r	   r
   r
   r
   r   <module>   s   