;i%5dZddlmZddlmZmZddlmZddlm Z ddl m Z m Z erddlm Z ddlmZdd l mZGd d e Zd S) zFont-related proxy objects.) annotations) TYPE_CHECKINGAny) ColorFormat) WD_UNDERLINE) ElementProxyEmu)WD_COLOR_INDEX)CT_R)Lengthc0eZdZdZdKdLfd ZedMd ZejdNd ZedMdZejdNdZedZ edMdZ e jdNdZ edMdZ e jdNdZ edMdZ e jdNdZ edMdZ e jdNdZ edMdZejdNdZedMdZejdNdZedOdZejdPdZedMd ZejdNd!ZedMd"ZejdNd#ZedMd$ZejdNd%ZedQd'ZejdRd(ZedMd)ZejdNd*ZedMd+ZejdNd,ZedMd-ZejdNd.ZedMd/ZejdNd0ZedSd2ZejdTd5ZedMd6ZejdNd7ZedMd8ZejdNd9ZedMd:ZejdNd;ZedMd<ZejdNd=ZedMd>ZejdNd?ZedMd@ZejdNdAZedUdCZ e jdVdDZ edMdEZ!e!jdNdFZ!dWdIZ"dXdJZ#xZ$S)YFontzProxy object for parent of a `` element and providing access to character properties such as font name, font size, bold, and subscript.Nrr parent Any | Nonecht||||_||_dSN)super__init___element_r)selfrr __class__s BC:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\docx/text/font.pyrz Font.__init__s/ F### return bool | Nonec,|dS)zTRead/write. Causes text in this font to appear in capital letters. caps_get_bool_proprs rall_capsz Font.all_capss ""6***rvalueNonec2|d|dS)Nr_set_bool_proprr$s rr#z Font.all_caps"s FE*****rc,|dS)zIRead/write. Causes text in this font to appear in bold. br r"s rboldz Font.bold&s ""3'''rc2|d|dS)Nr+r'r)s rr,z Font.bold. C'''''rc*t|jS)z[A |ColorFormat| object providing a way to get and set the text color for this font.)rrr"s rcolorz Font.color2s4=)))rc,|dS)zRead/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"s rcomplex_scriptzFont.complex_script8s""4(((rc2|d|dS)Nr2r'r)s rr3zFont.complex_scriptAs D%(((((rc,|dS)zRead/write tri-state value. When |True|, causes the complex script characters in the run to be displayed in bold typeface. bCsr r"s rcs_boldz Font.cs_boldE""5)))rc2|d|dS)Nr6r'r)s rr7z Font.cs_boldN E5)))))rc,|dS)zRead/write tri-state value. When |True|, causes the complex script characters in the run to be displayed in italic typeface. iCsr r"s r cs_italiczFont.cs_italicRr8rc2|d|dS)Nr<r'r)s rr=zFont.cs_italic[r:rc,|dS)zzRead/write tri-state value. When |True|, causes the text in the run to appear with double strikethrough. dstriker r"s r double_strikezFont.double_strike_ ""9---rc2|d|dS)Nr@r'r)s rrAzFont.double_strikeg Iu-----rc,|dS)zRead/write tri-state value. When |True|, causes the text in the run to appear as if raised off the page in relief. embossr r"s rrFz Font.embossk""8,,,rc2|d|dS)NrFr'r)s rrFz Font.embosst He,,,,,rc,|dS)zRead/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"s rhiddenz Font.hiddenxrGrc2|d|dS)NrKr'r)s rrLz Font.hiddenrIrWD_COLOR_INDEX | Nonec0|jj}|dS|jS)z:Color of highlighing applied or |None| if not highlighted.N)rrPr highlight_valrrPs rhighlight_colorzFont.highlight_colors!m ;4  rcF|j}||_dSr)rget_or_add_rPrrQrr$rPs rrSzFont.highlight_colors#m**,,!rc,|dS)zRead/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"s ritalicz Font.italics""3'''rc2|d|dS)NrXr'r)s rrYz Font.italicr.rc,|dS)z|Read/write tri-state value. When |True|, causes the text in the run to appear as if pressed into the page. imprintr r"s rr\z Font.imprintrBrc2|d|dS)Nr\r'r)s rr\z Font.imprintrDrc,|dS)zRead/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"s rmathz Font.maths""7+++rc2|d|dS)Nr_r'r)s rr`z Font.maths GU+++++r str | Nonec0|jj}|dS|jS)zThe 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)rrP rFonts_asciirRs rnamez Font.names!m ;4rcT|j}||_||_dSr)rrUrd rFonts_hAnsirVs rrez Font.names+m**,,  rc,|dS)zRead/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"s rno_proofz Font.no_proofs""9---rc2|d|dS)Nrir'r)s rrjz Font.no_proofrDrc,|dS)zRead/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"s rrmz Font.outlines""9---rc2|d|dS)Nrmr'r)s rrmz Font.outlinerDrc,|dS)z{Read/write tri-state value. When |True| causes the text in the run to have right-to-left characteristics. rtlr r"s rrpzFont.rtls ""5)))rc2|d|dS)Nrpr'r)s rrpzFont.rtlr:rc,|dS)zRead/write tri-state value. When |True| causes the text in the run to appear as if each character has a shadow. shadowr r"s rrsz Font.shadowrGrc2|d|dS)Nrsr'r)s rrsz Font.shadowrIr Length | Nonec0|jj}|dS|jS)aFont 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)rrPsz_valrRs rsizez Font.sizes m ;4zremuint | Length | Nonech|j}|dnt||_dSr)rrUr rw)rryrPs rrxz Font.sizes.m**,, [TTc#hh rc,|dS)zRead/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"s r small_capszFont.small_caps"";///rc2|d|dS)Nr}r'r)s rr~zFont.small_caps! K/////rc,|dS)zRead/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"s r snap_to_gridzFont.snap_to_grid%s""<000rc2|d|dS)Nrr'r)s rrzFont.snap_to_grid. L%00000rc,|dS)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"s r spec_vanishzFont.spec_vanish2s""<000rc2|d|dS)Nrr'r)s rrzFont.spec_vanish=rrc,|dS)zRead/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"s rrz Font.strikeArGrc2|d|dS)Nrr'r)s rrz Font.strikeJrIrc0|jj}|dS|jS)zBoolean indicating whether the characters in this |Font| appear as subscript. |None| indicates the subscript/subscript value is inherited from the style hierarchy. N)rrP subscriptrRs rrzFont.subscriptNs m ;4}rcF|j}||_dSr)rrUrrVs rrzFont.subscriptZs m**,, rc0|jj}|dS|jS)zBoolean indicating whether the characters in this |Font| appear as superscript. |None| indicates the subscript/superscript value is inherited from the style hierarchy. N)rrP superscriptrRs rrzFont.superscript_s m ;4rcF|j}||_dSr)rrUrrVs rrzFont.superscriptls m**,,rbool | WD_UNDERLINE | Nonec|jj}|dS|j}|tjkrdn%|tjkrdn|tjkrdn|S)aThe 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)rrPu_valr INHERITEDSINGLENONE)rrPvals r underlinezFont.underlineqslm ;4il,,, Dl)))l''' rc|j}|dur tjn|dur tjn|}||_dS)NTF)rrUrrrr)rr$rPrs rrzFont.underlinesNm**,, $)D==L  5TY>>l6G6G_d  rc,|dS)zRead/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"s r web_hiddenzFont.web_hiddenrrc2|d|dS)Nrr'r)s rrzFont.web_hiddenrrrestrcL|jj}|dS||S)z;Return the value of boolean child of `w:rPr` having `name`.N)rrP _get_bool_val)rrerPs rr!zFont._get_bool_props*m ;4  &&&rcd|j}|||dS)z6Assign `value` to the boolean child `name` of `w:rPr`.N)rrU _set_bool_val)rrer$rPs rr(zFont._set_bool_props1m**,, $&&&&&rr)rr rr)rr)r$rrr%)rrN)r$rN)rrb)r$rbrr%)rru)ryrzrr%)rr)r$rrr%)rerrr)rerr$r)%__name__ __module__ __qualname____doc__rpropertyr#setterr,r0r3r7r=rArFrLrSrYr\r`rerjrmrprsrxr~rrrrrrrr!r( __classcell__)rs@rrrs[OO +++X+_+++_+(((X( [((([(**X* )))X)))))***X* ^***^****X*****...X.....---X- ]---]----X- ]---]-!!!X!""""(((X( ](((](...X. ^...^.,,,X, [,,,[,    X   [!!![! ...X._..._....X. ^...^.***X* Z***Z*---X- ]---]-X( [777[7000X00000111X11111111X11111---X- ]---]-   X    X        X 0000X00000''''''''''''rrN)r __future__rtypingrrdocx.dml.colorrdocx.enum.textr docx.sharedrr r docx.oxml.text.runr r rrrrs!!""""""%%%%%%%%&&&&&&''''''))))))))#------''''''""""""['['['['['<['['['['['r