openpyxl.styles.fonts module

class openpyxl.styles.fonts.Font(name=None, sz=None, b=None, i=None, charset=None, u=None, strike=None, color=None, scheme=None, family=None, size=None, bold=None, italic=None, strikethrough=None, underline=None, vertAlign=None, outline=None, shadow=None, condense=None, extend=None)[source]

Bases: openpyxl.descriptors.serialisable.Serialisable

Font options used in styles.

UNDERLINE_DOUBLE = 'double'
UNDERLINE_DOUBLE_ACCOUNTING = 'doubleAccounting'
UNDERLINE_SINGLE = 'single'
UNDERLINE_SINGLE_ACCOUNTING = 'singleAccounting'
b

Values must be of type <class ‘bool’>

bold

Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptve name is desired (eg. “underline” for “u”)

charset

Values must be of type <class ‘int’>

color

Values must be of type <class ‘openpyxl.styles.colors.Color’>

condense

Values must be of type <class ‘bool’>

extend

Values must be of type <class ‘bool’>

family

Values must be of type <class ‘float’>

classmethod from_tree(node)[source]

Set default value for underline if child element is present

i

Values must be of type <class ‘bool’>

italic

Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptve name is desired (eg. “underline” for “u”)

name

Values must be of type <class ‘str’>

outline

Values must be of type <class ‘bool’>

scheme

Value must be one of {‘major’, ‘minor’}

shadow

Values must be of type <class ‘bool’>

size

Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptve name is desired (eg. “underline” for “u”)

strike

Values must be of type <class ‘bool’>

strikethrough

Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptve name is desired (eg. “underline” for “u”)

sz

Values must be of type <class ‘float’>

tagname = 'font'
u

Value must be one of {‘double’, ‘singleAccounting’, ‘doubleAccounting’, ‘single’}

underline

Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptve name is desired (eg. “underline” for “u”)

vertAlign

Value must be one of {‘baseline’, ‘superscript’, ‘subscript’}