HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/docx/text/__pycache__/font.cpython-310.pyc
o

$weU5�@s�dZddlmZddlmZmZddlmZddlm	Z	ddl
mZmZer8ddlm
Z
ddlmZdd	l
mZGd
d�de�ZdS)
zFont-related proxy objects.�)�annotations)�
TYPE_CHECKING�Any)�ColorFormat)�WD_UNDERLINE)�ElementProxy�Emu)�WD_COLOR_INDEX)�CT_R)�LengthcsPeZdZdZdidj�fdd�
Zedkdd��Zejdldd��Zedkdd��Zejdldd��Zedd��Z	edkdd��Z
e
jdldd��Z
edkdd��Zejdldd��Zedkdd��Zejdldd��Zedkdd��Z
e
jdld d��Z
edkd!d"��Zejdld#d"��Zedkd$d%��Zejdld&d%��Zedmd(d)��Zejdnd*d)��Zedkd+d,��Zejdld-d,��Zedkd.d/��Zejdld0d/��Zedkd1d2��Zejdld3d2��Zedod5d6��Zejdpd7d6��Zedkd8d9��Zejdld:d9��Zedkd;d<��Zejdld=d<��Zedkd>d?��Zejdld@d?��ZedkdAdB��ZejdldCdB��ZedqdEdF��ZejdrdIdF��ZedkdJdK��ZejdldLdK��ZedkdMdN��ZejdldOdN��ZedkdPdQ��ZejdldRdQ��ZedkdSdT��ZejdldUdT��ZedkdVdW��ZejdldXdW��ZedkdYdZ��Zejdld[dZ��Zedsd]d^��Z e jdtd_d^��Z edkd`da��Z!e!jdldbda��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 | Nonecst��||�||_||_dS�N)�super�__init__�_element�_r)�selfr
r��	__class__��G/home/arjun/projects/env/lib/python3.10/site-packages/docx/text/font.pyrs
z
Font.__init__�return�bool | NonecC�
|�d�S)zTRead/write.

        Causes text in this font to appear in capital letters.
        �caps��_get_bool_prop�rrrr�all_caps�
z
Font.all_caps�value�NonecC�|�d|�dS)Nr��_set_bool_prop�rr#rrrr!"�cCr)zIRead/write.

        Causes text in this font to appear in bold.
        �brr rrr�bold&r"z	Font.boldcCr%)Nr*r&r(rrrr+.r)cCs
t|j�S)z[A |ColorFormat| object providing a way to get and set the text color for this
        font.)rrr rrr�color2s
z
Font.colorcCr)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.
        �csrr rrr�complex_script8�
zFont.complex_scriptcCr%)Nr-r&r(rrrr.Ar)cCr)z�Read/write tri-state value.

        When |True|, causes the complex script characters in the run to be displayed in
        bold typeface.
        �bCsrr rrr�cs_boldEr/zFont.cs_boldcCr%)Nr0r&r(rrrr1Nr)cCr)z�Read/write tri-state value.

        When |True|, causes the complex script characters in the run to be displayed in
        italic typeface.
        �iCsrr rrr�	cs_italicRr/zFont.cs_italiccCr%)Nr2r&r(rrrr3[r)cCr)zzRead/write tri-state value.

        When |True|, causes the text in the run to appear with double strikethrough.
        �dstrikerr rrr�
double_strike_r"zFont.double_strikecCr%)Nr4r&r(rrrr5gr)cCr)z�Read/write tri-state value.

        When |True|, causes the text in the run to appear as if raised off the page in
        relief.
        �embossrr rrrr6kr/zFont.embosscCr%)Nr6r&r(rrrr6tr)cCr)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.
        �vanishrr rrr�hiddenxr/zFont.hiddencCr%)Nr7r&r(rrrr8�r)�WD_COLOR_INDEX | NonecC�|jj}|dur
dS|jS)z:Color of highlighing applied or |None| if not highlighted.N)r�rPr�
highlight_val�rr;rrr�highlight_color�szFont.highlight_colorcC�|j��}||_dSr)r�get_or_add_rPrr<�rr#r;rrrr>��

cCr)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.
        �irr rrr�italic�r/zFont.italiccCr%)NrCr&r(rrrrD�r)cCr)z|Read/write tri-state value.

        When |True|, causes the text in the run to appear as if pressed into the page.
        �imprintrr rrrrE�r"zFont.imprintcCr%)NrEr&r(rrrrE�r)cCr)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.
        �oMathrr rrr�math�r/z	Font.mathcCr%)NrFr&r(rrrrG�r)�
str | NonecCr:)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)rr;�rFonts_asciir=rrr�name��z	Font.namecCs|j��}||_||_dSr)rr@rI�rFonts_hAnsirArrrrJ�s

cCr)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.
        �noProofrr rrr�no_proof�r/z
Font.no_proofcCr%)NrMr&r(rrrrN�r)cCr)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.
        �outlinerr rrrrO�s
zFont.outlinecCr%)NrOr&r(rrrrO�r)cCr)z{Read/write tri-state value.

        When |True| causes the text in the run to have right-to-left characteristics.
        �rtlrr rrrrP�r"zFont.rtlcCr%)NrPr&r(rrrrP�r)cCr)z�Read/write tri-state value.

        When |True| causes the text in the run to appear as if each character has a
        shadow.
        �shadowrr rrrrQ�r/zFont.shadowcCr%)NrQr&r(rrrrQ�r)�
Length | NonecCr:)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)rr;�sz_valr=rrr�size�sz	Font.size�emu�int | Length | NonecCs*|j��}|durd|_dSt|�|_dSr)rr@rrS)rrUr;rrrrTs
 cCr)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.
        �	smallCapsrr rrr�
small_capsr/zFont.small_capscCr%)NrWr&r(rrrrX!r)cCr)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.
        �
snapToGridrr rrr�snap_to_grid%r/zFont.snap_to_gridcCr%)NrYr&r(rrrrZ.r)cCr)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.
        �
specVanishrr rrr�spec_vanish2s
	zFont.spec_vanishcCr%)Nr[r&r(rrrr\=r)cCr)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.
        �strikerr rrrr]Ar/zFont.strikecCr%)Nr]r&r(rrrr]Jr)cCr:)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)rr;�	subscriptr=rrrr^NrKzFont.subscriptcCr?r)rr@r^rArrrr^ZrBcCr:)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)rr;�superscriptr=rrrr__szFont.superscriptcCr?r)rr@r_rArrrr_lrB�bool | WD_UNDERLINE | NonecCsH|jj}|dur
dS|j}|tjkrdS|tjkrdS|tjkr"dS|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)rr;�u_valr�	INHERITED�SINGLE�NONE)rr;�valrrr�	underlineqs
��
��
���zFont.underlinecCs4|j��}|durtjn|durtjn|}||_dS)NTF)rr@rrcrdra)rr#r;rerrrrf�s
���
cCr)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.
        �	webHiddenrr rrr�
web_hidden�r/zFont.web_hiddencCr%)Nrgr&r(rrrrh�r)rJ�strcCs|jj}|dur
dS|�|�S)z;Return the value of boolean child of `w:rPr` having `name`.N)rr;�
_get_bool_val)rrJr;rrrr�s
zFont._get_bool_propcCs|j��}|�||�dS)z6Assign `value` to the boolean child `name` of `w:rPr`.N)rr@�
_set_bool_val)rrJr#r;rrrr'�s
zFont._set_bool_propr)r
r
rr)rr)r#rrr$)rr9)r#r9)rrH)r#rHrr$)rrR)rUrVrr$)rr`)r#r`rr$)rJrirr)rJrir#r)%�__name__�
__module__�__qualname__�__doc__r�propertyr!�setterr+r,r.r1r3r5r6r8r>rDrErGrJrNrOrPrQrTrXrZr\r]r^r_rfrhrr'�
__classcell__rrrrrs�
	

rN)ro�
__future__r�typingrr�docx.dml.colorr�docx.enum.textr�docx.sharedrrr	�docx.oxml.text.runr
rrrrrr�<module>s