o
    ýÞh%5  ã                   @  s„   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r8ddl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.é    )Úannotations)ÚTYPE_CHECKINGÚAny)ÚColorFormat)ÚWD_UNDERLINE)ÚElementProxyÚEmu)ÚWD_COLOR_INDEX)ÚCT_R)ÚLengthc                      sP  e Zd ZdZdidj‡ fdd„Zedkdd„ƒZejdldd„ƒZedkdd„ƒZejdldd„ƒZedd„ ƒZ	edkdd„ƒZ
e
jdldd„ƒZ
edkdd„ƒZejdldd„ƒZedkdd„ƒZejdldd„ƒZedkdd„ƒZejdld d„ƒZedkd!d"„ƒZejdld#d"„ƒZedkd$d%„ƒZejdld&d%„ƒZedmd(d)„ƒZejdnd*d)„ƒZedkd+d,„ƒZejdld-d,„ƒZedkd.d/„ƒZejdld0d/„ƒZedkd1d2„ƒZejdld3d2„ƒZedod5d6„ƒZejdpd7d6„ƒZedkd8d9„ƒZejdld:d9„ƒZedkd;d<„ƒZejdld=d<„ƒZedkd>d?„ƒZejdld@d?„ƒZedkdAdB„ƒZejdldCdB„ƒZedqdEdF„ƒZejdrdIdF„ƒZedkdJdK„ƒZejdldLdK„ƒZedkdMdN„ƒZejdldOdN„ƒZedkdPdQ„ƒZejdldRdQ„ƒZedkdSdT„ƒZejdldUdT„ƒZedkdVdW„ƒZejdldXdW„ƒZedkdYdZ„ƒZejdld[dZ„ƒZedsd]d^„ƒZ e jdtd_d^„ƒZ edkd`da„ƒZ!e!jdldbda„ƒZ!dudedf„Z"dvdgdh„Z#‡  Z$S )wÚFontz’Proxy 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                   s   t ƒ  ||¡ || _|| _d S ©N)ÚsuperÚ__init__Ú_elementÚ_r)Úselfr   r   ©Ú	__class__© úN/var/www/html/premium_crap/venv/lib/python3.10/site-packages/docx/text/font.pyr      s   
zFont.__init__Úreturnúbool | Nonec                 C  ó
   |   d¡S )zTRead/write.

        Causes text in this font to appear in capital letters.
        Úcaps©Ú_get_bool_prop©r   r   r   r   Úall_caps   ó   
zFont.all_capsÚvalueÚNonec                 C  ó   |   d|¡ d S )Nr   ©Ú_set_bool_prop©r   r#   r   r   r   r!   "   ó   c                 C  r   )zIRead/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 )z[A |ColorFormat| object providing a way to get and set the text color for this
        font.)r   r   r    r   r   r   Úcolor2   s   
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_script8   ó   
zFont.complex_scriptc                 C  r%   )Nr-   r&   r(   r   r   r   r.   A   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_boldE   r/   zFont.cs_boldc                 C  r%   )Nr0   r&   r(   r   r   r   r1   N   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_italicR   r/   zFont.cs_italicc                 C  r%   )Nr2   r&   r(   r   r   r   r3   [   r)   c                 C  r   )zzRead/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%   )Nr4   r&   r(   r   r   r   r5   g   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   r6   k   r/   zFont.embossc                 C  r%   )Nr6   r&   r(   r   r   r   r6   t   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   Úhiddenx   r/   zFont.hiddenc                 C  r%   )Nr7   r&   r(   r   r   r   r8   �   r)   úWD_COLOR_INDEX | Nonec                 C  ó   | j j}|du r
dS |jS )z:Color of highlighing applied or |None| if not highlighted.N)r   ÚrPrÚhighlight_val©r   r;   r   r   r   Úhighlight_color…   s   zFont.highlight_colorc                 C  ó   | j  ¡ }||_d S r   )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%   )NrC   r&   r(   r   r   r   rD   ›   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   rE   Ÿ   r"   zFont.imprintc                 C  r%   )NrE   r&   r(   r   r   r   rE   §   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%   )NrF   r&   r(   r   r   r   rG   ´   r)   ú
str | Nonec                 C  r:   )z×The 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   r;   ÚrFonts_asciir=   r   r   r   Úname¸   ó   z	Font.namec                 C  s   | j  ¡ }||_||_d S r   )r   r@   rI   ÚrFonts_hAnsirA   r   r   r   rJ   Ä   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%   )NrM   r&   r(   r   r   r   rN   Ó   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   rO   ×   s   
zFont.outlinec                 C  r%   )NrO   r&   r(   r   r   r   rO   á   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   rP   å   r"   zFont.rtlc                 C  r%   )NrP   r&   r(   r   r   r   rP   í   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   rQ   ñ   r/   zFont.shadowc                 C  r%   )NrQ   r&   r(   r   r   r   rQ   ú   r)   úLength | Nonec                 C  r:   )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   r;   Úsz_valr=   r   r   r   Úsizeþ   s   z	Font.sizeÚemuúint | Length | Nonec                 C  s*   | j  ¡ }|d u rd |_d S t|ƒ|_d S r   )r   r@   r   rS   )r   rU   r;   r   r   r   rT     s   
 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%   )NrW   r&   r(   r   r   r   rX   !  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%   )NrY   r&   r(   r   r   r   rZ   .  r)   c                 C  r   )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    r   r   r   Úspec_vanish2  s   
	zFont.spec_vanishc                 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 with a single horizontal line
        through the center of the line.
        Ústriker   r    r   r   r   r]   A  r/   zFont.strikec                 C  r%   )Nr]   r&   r(   r   r   r   r]   J  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   r^   N  rK   zFont.subscriptc                 C  r?   r   )r   r@   r^   rA   r   r   r   r^   Z  rB   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   r_   _  s   zFont.superscriptc                 C  r?   r   )r   r@   r_   rA   r   r   r   r_   l  rB   úbool | WD_UNDERLINE | Nonec                 C  sH   | j j}|du r
dS |j}|tjkrdS |tjkrdS |tjkr"dS |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   r;   Úu_valr   Ú	INHERITEDÚSINGLEÚNONE)r   r;   Úvalr   r   r   Ú	underlineq  s   
ÿÿ
ÿý
ÿûùzFont.underlinec                 C  s4   | j  ¡ }|du rtjn|du rtjn|}||_d S )NTF)r   r@   r   rc   rd   ra   )r   r#   r;   re   r   r   r   rf   Š  s   
ÿ
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%   )Nrg   r&   r(   r   r   r   rh   ž  r)   rJ   Ústrc                 C  s   | j j}|du r
dS | |¡S )z;Return the value of boolean child of `w:rPr` having `name`.N)r   r;   Ú_get_bool_val)r   rJ   r;   r   r   r   r   ¢  s   
zFont._get_bool_propc                 C  s   | j  ¡ }| ||¡ dS )z6Assign `value` to the boolean child `name` of `w:rPr`.N)r   r@   Ú_set_bool_val)r   rJ   r#   r;   r   r   r   r'   ©  s   
zFont._set_bool_propr   )r   r
   r   r   )r   r   )r#   r   r   r$   )r   r9   )r#   r9   )r   rH   )r#   rH   r   r$   )r   rR   )rU   rV   r   r$   )r   r`   )r#   r`   r   r$   )rJ   ri   r   r   )rJ   ri   r#   r   )%Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr!   Úsetterr+   r,   r.   r1   r3   r5   r6   r8   r>   rD   rE   rG   rJ   rN   rO   rP   rQ   rT   rX   rZ   r\   r]   r^   r_   rf   rh   r   r'   Ú__classcell__r   r   r   r   r      sÞ    
	


r   N)ro   Ú
__future__r   Útypingr   r   Údocx.dml.colorr   Údocx.enum.textr   Údocx.sharedr   r   r	   Údocx.oxml.text.runr
   r   r   r   r   r   r   Ú<module>   s    