
    h,                    L   S r SSKJr  SSKJrJr  SSKJr  SSKJ	r	J
r
  SSKJr  SSKJr  SSKJrJrJrJr  SS	KJrJrJrJr  \(       a  SS
KJrJr  SSKJr   " S S\5      r " S S\5      r " S S\5      r  " S S\5      r! " S S\5      r" " S S\5      r# " S S\5      r$g)z8Custom element classes related to run properties (font).    )annotations)TYPE_CHECKINGCallable)MSO_THEME_COLOR)WD_COLOR_INDEXWD_UNDERLINE)nsdecls)	parse_xml)ST_HexColorST_HpsMeasure	ST_StringST_VerticalAlignRun)BaseOxmlElementOptionalAttributeRequiredAttribute	ZeroOrOne)CT_OnOff	CT_String)Lengthc                  <    \ rS rSrSr\" S\5      r\" S\	5      r
Srg)CT_Color   zL`w:color` element, specifying the color of a font and perhaps other objects.w:valzw:themeColor N)__name__
__module____qualname____firstlineno____doc__r   r   valr   r   
themeColor__static_attributes__r       E/var/www/html/env/lib/python3.13/site-packages/docx/oxml/text/font.pyr   r      s    V
G[
1C">?CJr#   r   c                  R    \ rS rSr% Sr\" S\5      rS\S'   \" S\5      r	S\S'   Sr
g	)
CT_Fonts$   zO`<w:rFonts>` element.

Specifies typeface name for the various language types.
zw:ascii
str | Noneasciizw:hAnsihAnsir   N)r   r   r   r   r   r   r   r)   __annotations__r*   r"   r   r#   r$   r&   r&   $   s7    
 *9E:  *9E: r#   r&   c                  6    \ rS rSr% Sr\" S\5      rS\S'   Sr	g)CT_Highlight2   zE`w:highlight` element, specifying font highlighting/background color.r   r   r    r   N)
r   r   r   r   r   r   r   r    r+   r"   r   r#   r$   r-   r-   2   s    O+C r#   r-   c                  6    \ rS rSr% Sr\" S\5      rS\S'   Sr	g)CT_HpsMeasure:   zJUsed for `<w:sz>` element and others, specifying font size in half-points.r   r   r    r   N)
r   r   r   r   r   r   r   r    r+   r"   r   r#   r$   r0   r0   :   s    T#C r#   r0   c                     \ rS rSr% SrS\S'   S\S'   S\S'   S	\S
'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   Sr\" S\SS S9rS\S'   \" S\SS S9r	S\S '   \" S!\S"S S9r
S#\S$'   \" S%\S&S S9r\" S'\S(S S9r\" S)\S*S S9r\" S+\S,S S9r\" S-\S.S S9r\" S/\S0S S9r\" S1\S2S S9r\" S3\S4S S9r\" S5\S6S S9r\" S7\S8S S9r\" S9\S:S S9r\" S;\S<S S9r\" S=\S>S S9r\" S?\S@S S9r\" SA\SBS S9r\" SC\SDS S9r\" SE\SFS S9rSG\SH'   \" SI\SJS S9rSK\SL'   \" SM\SNS S9rSO\SP'   \" SQ\SRS S9rSS\ST'   \" SU\SVS S9r\" SW\SXS S9r \" SY\SZS S9r!\" S[\S\S S9r"CS] r#\$SqS^ j5       r%\%RL                  SrS_ j5       r%\$SsS` j5       r'\'RL                  StSa j5       r'\$SsSb j5       r(\(RL                  SuSc j5       r(\$SsSd j5       r)\)RL                  SvSe j5       r)\$SwSf j5       r*\*RL                  SxSg j5       r*\$SwSh j5       r+\+RL                  SySi j5       r+\$SzSj j5       r,\,RL                  S{Sk j5       r,\$S|Sl j5       r-\-RL                  S}Sm j5       r-S~Sn jr.SSo jr/Spr0g)CT_RPrB   z7`<w:rPr>` element, containing the properties for a run.zCallable[[], CT_Highlight]get_or_add_highlightzCallable[[], CT_Fonts]get_or_add_rFontszCallable[[], CT_HpsMeasure]get_or_add_szz!Callable[[], CT_VerticalAlignRun]get_or_add_vertAlignzCallable[..., CT_String]_add_rStylezCallable[[], CT_Underline]_add_uzCallable[[], None]_remove_highlight_remove_rFonts_remove_rStyle
_remove_sz	_remove_u_remove_vertAlign)'w:rStylew:rFontsw:bw:bCsw:iw:iCsw:capsw:smallCapsw:strike	w:dstrike	w:outlinew:shadoww:emboss	w:imprint	w:noProofw:snapToGridw:vanishw:webHiddenw:colorz	w:spacingzw:wzw:kernz
w:positionw:szzw:szCsw:highlightw:uzw:effectzw:bdrzw:shdz	w:fitTextw:vertAlignw:rtlw:cszw:emzw:langzw:eastAsianLayoutw:specVanishw:oMathrA      N)
successorszCT_String | NonerStylerB      zCT_Fonts | NonerFontsrC      zCT_OnOff | NonebrD      rE      rF      rG      rH      rI   	   rJ   
   rK      rL      rM      rN      rO      rP      rQ      rR      rS      rT      zCT_HpsMeasure | NoneszrU      zCT_Highlight | None	highlightrV      zCT_Underline | NoneurW       zCT_VerticalAlignRun | None	vertAlignrX   !   rY   "   rZ   &   r[   '   c                0    [        S[        S5      -  5      $ )zGOverride metaclass method to set `w:color/@val` to RGB black on create.z<w:color %s w:val="000000"/>w)r
   r	   )selfs    r$   
_new_colorCT_RPr._new_color   s    7'#,FGGr#   c                :    U R                   nUc  gUR                  $ )zlValue of `./w:highlight/@val`.

Specifies font's highlight color, or `None` if the text is not highlighted.
N)rv   r    )r   rv   s     r$   highlight_valCT_RPr.highlight_val   s      NN	}}r#   c                X    Uc  U R                  5         g U R                  5       nXl        g N)r;   r5   r    )r   valuerv   s      r$   r   r      s)    =""$--/	r#   c                :    U R                   nUc  gUR                  $ )zThe value of `w:rFonts/@w:ascii` or |None| if not present.

Represents the assigned typeface name. The rFonts element also specifies other
special-case typeface names; this method handles the case where just the common
name is required.
N)r`   r)   r   r`   s     r$   rFonts_asciiCT_RPr.rFonts_ascii   s     >||r#   c                X    Uc  U R                  5         g U R                  5       nXl        g r   )r<   r6   r)   r   r   r`   s      r$   r   r      s)    =!'')r#   c                :    U R                   nUc  gUR                  $ )z:The value of `w:rFonts/@w:hAnsi` or |None| if not present.N)r`   r*   r   s     r$   rFonts_hAnsiCT_RPr.rFonts_hAnsi   s     >||r#   c                R    Uc  U R                   c  g U R                  5       nXl        g r   )r`   r6   r*   r   s      r$   r   r      s&    =T[[0'')r#   c                :    U R                   nUc  gUR                  $ )zBString in `./w:rStyle/@val`, or None if `w:rStyle` is not present.N)r^   r    )r   r^   s     r$   styleCT_RPr.style   s     >zzr#   c                    Uc  U R                  5         gU R                  c  U R                  US9  gXR                  l        g)zSet `./w:rStyle/@val` to `style`, adding the `w:rStyle` element if necessary.

If `style` is |None|, remove `w:rStyle` element if present.
N)r    )r=   r^   r9   r    )r   r   s     r$   r   r      s9     =![[ '#KKOr#   c                b    U R                   nUc  gUR                  [        R                  :X  a  gg)z|True| if `./w:vertAlign/@w:val` is "subscript".

|False| if `w:vertAlign/@w:val` contains any other value. |None| if
`w:vertAlign` is not present.
NTF)rz   r    r   	SUBSCRIPTr   rz   s     r$   	subscriptCT_RPr.subscript   s/     NN	==/999r#   c                   Uc  U R                  5         g [        U5      SL a$  [        R                  U R	                  5       l        g U R                  b:  U R                  R
                  [        R                  :X  a  U R                  5         g g g NT)r@   boolr   r   r8   r    rz   r   r   s     r$   r   r     sm    =""$%[D .A.K.KD%%'+^^'DNN,>,>BUB_B_,_""$ -`'r#   c                b    U R                   nUc  gUR                  [        R                  :X  a  gg)z|True| if `w:vertAlign/@w:val` is 'superscript'.

|False| if `w:vertAlign/@w:val` contains any other value. |None| if
`w:vertAlign` is not present.
NTF)rz   r    r   SUPERSCRIPTr   s     r$   superscriptCT_RPr.superscript  s/     NN	==/;;;r#   c                   Uc  U R                  5         g [        U5      SL a$  [        R                  U R	                  5       l        g U R                  b:  U R                  R
                  [        R                  :X  a  U R                  5         g g g r   )r@   r   r   r   r8   r    rz   r   s     r$   r   r     sm    =""$%[D .A.M.MD%%'+^^'DNN,>,>BUBaBa,a""$ -b'r#   c                :    U R                   nUc  gUR                  $ )z4The value of `w:sz/@w:val` or |None| if not present.N)rt   r    )r   rt   s     r$   sz_valCT_RPr.sz_val&  s     WW:vvr#   c                X    Uc  U R                  5         g U R                  5       nXl        g r   )r>   r7   r    )r   r   rt   s      r$   r   r   .  s'    =OO!r#   c                :    U R                   nUc  gUR                  $ )zValue of `w:u/@val`, or None if not present.

Values `WD_UNDERLINE.SINGLE` and `WD_UNDERLINE.NONE` are mapped to `True` and
`False` respectively.
N)rx   r    )r   rx   s     r$   u_valCT_RPr.u_val6  s     FF9uur#   c                T    U R                  5         Ub  XR                  5       l        g g r   )r?   r:   r    r   s     r$   r   r   B  s#     %KKM r#   c                8    [        X5      nUc  gUR                  $ )zIValue of boolean child with `name`, e.g. "w:b", "w:i", and "w:smallCaps".Ngetattrr    )r   nameelements      r$   _get_bool_valCT_RPr._get_bool_valH  s    $%?{{r#   c                h    Uc  [        U SU-  5      " 5         g [        U SU-  5      " 5       nX#l        g )Nz
_remove_%szget_or_add_%sr   )r   r   r   r   s       r$   _set_bool_valCT_RPr._set_bool_valO  s5    =D,-.0$$ 679r#   r   )returnWD_COLOR_INDEX | None)r   r   r   None)r   r(   )r   r(   r   r   )r   r(   )r   r(   r   r   )r   bool | None)r   r   r   r   )r   r   )r   Length | None)r   r   )r   WD_UNDERLINE | None)r   r   )r   strr   r   )r   r   r   r   )1r   r   r   r   r   r+   _tag_seqr   r^   r`   rb   bCsiiCscaps	smallCapsstrikedstrikeoutlineshadowembossimprintnoProof
snapToGridvanish	webHiddencolorrt   rv   rx   rz   rtlcs
specVanishoMathr   propertyr   setterr   r   r   r   r   r   r   r   r   r"   r   r#   r$   r3   r3   B   s   A44--..;;))&&))&&&&""!!))(HR  )x| F  (x|FO  #(12,A  G
5C%HQRL1A
G
5CX(12,7D-HQRLAIzhqrl;F>G>Gzhrsm<Fzhrsm<F>G>G>hrsmDJzhrsm<F-HRSMBIiHRSM:E(8BC= B  &/(23-&I"  '(23-A  -6(23--I)  G
6C	6hrsm	4B>hrsmDJiHRSM:EH     
 
         \\
$ 
$   % %   % %   ]]  	 	 \\& &
r#   r3   c                  6    \ rS rSr% Sr\" S\5      rS\S'   Sr	g)CT_UnderlineiW  z<`<w:u>` element, specifying the underlining style for a run.r   r   r    r   N)
r   r   r   r   r   r   r   r    r+   r"   r   r#   r$   r   r   W  s    F0 C	 r#   r   c                  6    \ rS rSr% Sr\" S\5      rS\S'   Sr	g)CT_VerticalAlignRuni_  z=`<w:vertAlign>` element, specifying subscript or superscript.r   r   r    r   N)
r   r   r   r   r   r   r   r    r+   r"   r   r#   r$   r   r   _  s    G $C r#   r   N)%r   
__future__r   typingr   r   docx.enum.dmlr   docx.enum.textr   r   docx.oxml.nsr	   docx.oxml.parserr
   docx.oxml.simpletypesr   r   r   r   docx.oxml.xmlchemyr   r   r   r   docx.oxml.sharedr   r   docx.sharedr   r   r&   r-   r0   r3   r   r   r   r#   r$   <module>r      s    > " * ) 7   &   4"D D ? O R_ Rj? / r#   