Paper Office
paper-docxAPI referenceoxml.text.font

CT_RPr

paper-docx 0.2.0 API reference

<w:rPr> element, containing the properties for a run.

Attributes

b

attributebCT_OnOff | None
= ZeroOrOne('w:b', successors=(_tag_seq[3:]))

bCs

attributebCs
= ZeroOrOne('w:bCs', successors=(_tag_seq[4:]))

caps

attributecaps
= ZeroOrOne('w:caps', successors=(_tag_seq[7:]))

color

attributecolorCT_Color | None
= ZeroOrOne('w:color', successors=(_tag_seq[19:]))

cs

attributecs
= ZeroOrOne('w:cs', successors=(_tag_seq[34:]))

dstrike

attributedstrike
= ZeroOrOne('w:dstrike', successors=(_tag_seq[10:]))

emboss

attributeemboss
= ZeroOrOne('w:emboss', successors=(_tag_seq[13:]))

get_or_add_color

attributeget_or_add_colorCallable[[], CT_Color]

get_or_add_highlight

attributeget_or_add_highlightCallable[[], CT_Highlight]

get_or_add_rFonts

attributeget_or_add_rFontsCallable[[], CT_Fonts]

get_or_add_sz

attributeget_or_add_szCallable[[], CT_HpsMeasure]

get_or_add_vertAlign

attributeget_or_add_vertAlignCallable[[], CT_VerticalAlignRun]

highlight

attributehighlightCT_Highlight | None
= ZeroOrOne('w:highlight', successors=(_tag_seq[26:]))

highlight_val

attributehighlight_valWD_COLOR_INDEX | None

Value of ./w:highlight/@val.

Specifies font's highlight color, or None if the text is not highlighted.

i

attributei
= ZeroOrOne('w:i', successors=(_tag_seq[5:]))

iCs

attributeiCs
= ZeroOrOne('w:iCs', successors=(_tag_seq[6:]))

imprint

attributeimprint
= ZeroOrOne('w:imprint', successors=(_tag_seq[14:]))

noProof

attributenoProof
= ZeroOrOne('w:noProof', successors=(_tag_seq[15:]))

oMath

attributeoMath
= ZeroOrOne('w:oMath', successors=(_tag_seq[39:]))

outline

attributeoutline
= ZeroOrOne('w:outline', successors=(_tag_seq[11:]))

rFonts

attributerFontsCT_Fonts | None
= ZeroOrOne('w:rFonts', successors=(_tag_seq[2:]))

rFonts_ascii

attributerFonts_asciistr | None

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.

rFonts_hAnsi

attributerFonts_hAnsistr | None

The value of w:rFonts/@w:hAnsi or None if not present.

rStyle

attributerStyleCT_String | None
= ZeroOrOne('w:rStyle', successors=(_tag_seq[1:]))

rtl

attributertl
= ZeroOrOne('w:rtl', successors=(_tag_seq[33:]))

shadow

attributeshadow
= ZeroOrOne('w:shadow', successors=(_tag_seq[12:]))

smallCaps

attributesmallCaps
= ZeroOrOne('w:smallCaps', successors=(_tag_seq[8:]))

snapToGrid

attributesnapToGrid
= ZeroOrOne('w:snapToGrid', successors=(_tag_seq[16:]))

specVanish

attributespecVanish
= ZeroOrOne('w:specVanish', successors=(_tag_seq[38:]))

strike

attributestrike
= ZeroOrOne('w:strike', successors=(_tag_seq[9:]))

style

attributestylestr | None

String in ./w:rStyle/@val, or None if w:rStyle is not present.

subscript

attributesubscriptbool | None

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.

superscript

attributesuperscriptbool | None

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.

sz

attributeszCT_HpsMeasure | None
= ZeroOrOne('w:sz', successors=(_tag_seq[24:]))

sz_val

attributesz_valLength | None

The value of w:sz/@w:val or None if not present.

u

attributeuCT_Underline | None
= ZeroOrOne('w:u', successors=(_tag_seq[27:]))

u_val

attributeu_valWD_UNDERLINE | None

Value of w:u/@val, or None if not present.

Values WD_UNDERLINE.SINGLE and WD_UNDERLINE.NONE are mapped to True and False respectively.

vanish

attributevanish
= ZeroOrOne('w:vanish', successors=(_tag_seq[17:]))

vertAlign

attributevertAlignCT_VerticalAlignRun | None
= ZeroOrOne('w:vertAlign', successors=(_tag_seq[32:]))

webHidden

attributewebHidden
= ZeroOrOne('w:webHidden', successors=(_tag_seq[18:]))

xml

attributexmlstr

XML string for this element, suitable for testing purposes.

Pretty printed for readability and without an XML declaration at the top.

Functions

first_child_found_in

funcfirst_child_found_in(*tagnames: str) -> _Element | None

First child with tag in tagnames, or None if not found.

paramtagnamesstr
= ()

Returns

lxml.etree._Element | None

insert_element_before

funcinsert_element_before(elm: ElementBase, *tagnames: str)
paramelmElementBase
paramtagnamesstr
= ()

remove_all

funcremove_all(*tagnames: str) -> None

Remove child elements with tagname (e.g. "a:p") in tagnames.

paramtagnamesstr
= ()

Returns

None

xpath

funcxpath(xpath_str: str) -> Any

Override of lxml _Element.xpath() method.

Provides standard Open XML namespace mapping (nsmap) in centralized location.

paramxpath_strstr

Returns

typing.Any

On this page