
    ,h,                    B   d Z ddlmZ ddlmZm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mZmZ dd	lmZmZmZmZ erdd
lmZmZ ddlmZ  G d de      Z G d de      Z G d de      Z  G d de      Z! G d de      Z" G d de      Z# G d de      Z$y)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                  4    e Zd ZdZ ede      Z ede      Z	y)CT_ColorzL`w:color` element, specifying the color of a font and perhaps other objects.w:valzw:themeColorN)
__name__
__module____qualname____doc__r   r   valr   r   
themeColor     U/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/docx/oxml/text/font.pyr   r      s    V
G[
1C">?CJr    r   c                  J    e Zd ZU dZ ede      Zded<    ede      Zded<   y)CT_FontszW`<w:rFonts>` element.

    Specifies typeface name for the various language types.
    zw:ascii
str | Noneasciizw:hAnsihAnsiN)	r   r   r   r   r   r   r%   __annotations__r&   r   r    r!   r#   r#   $   s7    
 *9E:  *9E: r    r#   c                  .    e Zd ZU dZ ede      Zded<   y)CT_HighlightzE`w:highlight` element, specifying font highlighting/background color.r   r   r   N)r   r   r   r   r   r   r   r'   r   r    r!   r)   r)   2   s    O+C r    r)   c                  .    e Zd ZU dZ ede      Zded<   y)CT_HpsMeasurezJUsed for `<w:sz>` element and others, specifying font size in half-points.r   r   r   N)r   r   r   r   r   r   r   r'   r   r    r!   r+   r+   :   s    T#C r    r+   c                  j   e Zd ZU dZded<   ded<   ded<   ded	<   d
ed<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   dZ ededd       Zded<    ededd       Zded<    ed ed!d       Z	d"ed#<    ed$ed%d       Z
 ed&ed'd       Z ed(ed)d       Z ed*ed+d       Z ed,ed-d       Z ed.ed/d       Z ed0ed1d       Z ed2ed3d       Z ed4ed5d       Z ed6ed7d       Z ed8ed9d       Z ed:ed;d       Z ed<ed=d       Z ed>ed?d       Z ed@edAd       Z edBedCd       Z edDedEd       ZdFedG<    edHedId       ZdJedK<    edLedMd       ZdNedO<    edPedQd       ZdRedS<    edTedUd       Z edVedWd       Z edXedYd       Z  edZed[d       Z![d\ Z"e#dod]       Z$e$jJ                  dpd^       Z$e#dqd_       Z&e&jJ                  drd`       Z&e#dqda       Z'e'jJ                  dsdb       Z'e#dqdc       Z(e(jJ                  dtdd       Z(e#dude       Z)e)jJ                  dvdf       Z)e#dudg       Z*e*jJ                  dwdh       Z*e#dxdi       Z+e+jJ                  dydj       Z+e#dzdk       Z,e,jJ                  d{dl       Z,d|dmZ-d}dnZ.y)~CT_RPrz7`<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:oMathr:      N)
successorszCT_String | NonerStyler;      zCT_Fonts | NonerFontsr<      zCT_OnOff | Nonebr=      r>      r?      r@      rA      rB   	   rC   
   rD      rE      rF      rG      rH      rI      rJ      rK      rL      rM      zCT_HpsMeasure | NoneszrN      zCT_Highlight | None	highlightrO      zCT_Underline | NoneurP       zCT_VerticalAlignRun | None	vertAlignrQ   !   rR   "   rS   &   rT   '   c                0    t        dt        d      z        S )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_colorzCT_RPr._new_color   s    7'#,FGGr    c                8    | j                   }|y|j                  S )z|Value of `./w:highlight/@val`.

        Specifies font's highlight color, or `None` if the text is not highlighted.
        N)ro   r   )rz   ro   s     r!   highlight_valzCT_RPr.highlight_val   s      NN	}}r    c                X    || j                          y | j                         }||_        y N)r4   r.   r   )rz   valuero   s      r!   r}   zCT_RPr.highlight_val   s+    =""$--/		r    c                8    | j                   }|y|j                  S )a  The 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)rY   r%   rz   rY   s     r!   rFonts_asciizCT_RPr.rFonts_ascii   s     >||r    c                X    || j                          y | j                         }||_        y r   )r5   r/   r%   rz   r   rY   s      r!   r   zCT_RPr.rFonts_ascii   s+    =!'')r    c                8    | j                   }|y|j                  S )z:The value of `w:rFonts/@w:hAnsi` or |None| if not present.N)rY   r&   r   s     r!   rFonts_hAnsizCT_RPr.rFonts_hAnsi   s     >||r    c                P    || j                   y | j                         }||_        y r   )rY   r/   r&   r   s      r!   r   zCT_RPr.rFonts_hAnsi   s(    =T[[0'')r    c                8    | j                   }|y|j                  S )zBString in `./w:rStyle/@val`, or None if `w:rStyle` is not present.N)rW   r   )rz   rW   s     r!   stylezCT_RPr.style   s     >zzr    c                    || j                          y| j                  | j                  |       y|| j                  _        y)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   )r6   rW   r2   r   )rz   r   s     r!   r   zCT_RPr.style   s;     =![[ '#DKKOr    c                ^    | j                   }|y|j                  t        j                  k(  ryy)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)rs   r   r   	SUBSCRIPTrz   rs   s     r!   	subscriptzCT_RPr.subscript   s/     NN	==/999r    c                   || j                          y t        |      du r$t        j                  | j	                         _        y | j                  9| j                  j
                  t        j                  k(  r| j                          y y y NT)r9   boolr   r   r1   r   rs   rz   r   s     r!   r   zCT_RPr.subscript  sm    =""$%[D .A.K.KD%%'+^^'DNN,>,>BUB_B_,_""$ -`'r    c                ^    | j                   }|y|j                  t        j                  k(  ryy)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)rs   r   r   SUPERSCRIPTr   s     r!   superscriptzCT_RPr.superscript  s/     NN	==/;;;r    c                   || j                          y t        |      du r$t        j                  | j	                         _        y | j                  9| j                  j
                  t        j                  k(  r| j                          y y y r   )r9   r   r   r   r1   r   rs   r   s     r!   r   zCT_RPr.superscript  sm    =""$%[D .A.M.MD%%'+^^'DNN,>,>BUBaBa,a""$ -b'r    c                8    | j                   }|y|j                  S )z4The value of `w:sz/@w:val` or |None| if not present.N)rm   r   )rz   rm   s     r!   sz_valzCT_RPr.sz_val&  s     WW:vvr    c                X    || j                          y | j                         }||_        y r   )r7   r0   r   )rz   r   rm   s      r!   r   zCT_RPr.sz_val.  s)    =OO!r    c                8    | j                   }|y|j                  S )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)rq   r   )rz   rq   s     r!   u_valzCT_RPr.u_val6  s     FF9uur    c                T    | j                          ||| j                         _        y y r   )r8   r3   r   r   s     r!   r   zCT_RPr.u_valB  s%     %DKKM r    c                8    t        | |      }|y|j                  S )zIValue of boolean child with `name`, e.g. "w:b", "w:i", and "w:smallCaps".Ngetattrr   )rz   nameelements      r!   _get_bool_valzCT_RPr._get_bool_valH  s     $%?{{r    c                h    | t        | d|z                y  t        | d|z               }||_        y )Nz
_remove_%szget_or_add_%sr   )rz   r   r   r   s       r!   _set_bool_valzCT_RPr._set_bool_valO  s;    =.GD,-.07'$$ 679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   )/r   r   r   r   r'   _tag_seqr   rW   rY   r[   bCsiiCscaps	smallCapsstrikedstrikeoutlineshadowembossimprintnoProof
snapToGridvanish	webHiddencolorrm   ro   rq   rs   rtlcs
specVanishoMathr{   propertyr}   setterr   r   r   r   r   r   r   r   r   r   r    r!   r-   r-   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    r-   c                  .    e Zd ZU dZ ede      Zded<   y)CT_Underlinez<`<w:u>` element, specifying the underlining style for a run.r   r   r   N)r   r   r   r   r   r   r   r'   r   r    r!   r   r   W  s    F0 C	 r    r   c                  .    e Zd ZU dZ ede      Zded<   y)CT_VerticalAlignRunz=`<w:vertAlign>` element, specifying subscript or superscript.r   r   r   N)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)   r+   r-   r   r   r   r    r!   <module>r      s    > " * ) 7   &   4"D D ? O R_ Rj? / r    