Paper Office
paper-pptxAPI referencetext.text

Font

paper-pptx 0.2.0 API reference

Character properties object, providing font size, font name, bold, italic, etc.

Corresponds to a:rPr child element of a run. Also appears as a:defRPr and a:endParaRPr in paragraph and a:defRPr in list style elements.

Font(rPr: CT_TextCharacterProperties)

Attributes

bold

attributeboldbool | None

Get or set boolean bold value of Font, e.g. paragraph.font.bold = True.

If set to None, the bold setting is cleared and is inherited from an enclosing shape's setting, or a setting in a style or master. Returns None if no bold attribute is present, meaning the effective bold value is inherited from a master or the theme.

color

attributecolorColorFormat

The ColorFormat instance that provides access to the color settings for this font.

fill

attributefillFillFormat

FillFormat instance for this font.

Provides access to fill properties such as fill color.

italic

attributeitalicbool | None

Get or set boolean italic value of Font instance.

Has the same behaviors as bold with respect to None values.

language_id

attributelanguage_idMSO_LANGUAGE_ID | None

Get or set the language id of this Font instance.

The language id is a member of the :ref:MsoLanguageId enumeration. Assigning None removes any language setting, the same behavior as assigning MSO_LANGUAGE_ID.NONE.

name

attributenamestr | None

Get or set the typeface name for this Font instance.

Causes the text it controls to appear in the named font, if a matching font is found. Returns None if the typeface is currently inherited from the theme. Setting it to None removes any override of the theme typeface.

size

attributesizeLength | None

Indicates the font height in English Metric Units (EMU).

Read/write. None indicates the font size should be inherited from its style hierarchy, such as a placeholder or document defaults (usually 18pt). Length is a subclass of int having properties for convenient conversion into points or other length units. Likewise, the :class:pptx.util.Pt class allows convenient specification of point values::

font.size = Pt(24) font.size 304800 font.size.pt 24.0

underline

attributeunderlinebool | MSO_TEXT_UNDERLINE_TYPE | None

Indicaties the underline setting for this font.

Value is True, False, None, or a member of the :ref:MsoTextUnderlineType enumeration. None is the default and indicates the underline setting should be inherited from the style hierarchy, such as from a placeholder. True indicates single underline. False indicates no underline. Other settings such as double and wavy underlining are indicated with members of the :ref:MsoTextUnderlineType enumeration.

On this page