ooodev.format.calc.direct.cell.font package

Module contents

class ooodev.format.calc.direct.cell.font.Font(*, b=None, i=None, u=None, bg_color=None, bg_transparent=None, charset=None, color=None, family=None, name=None, overline=None, rotation=None, shadow_fmt=None, shadowed=None, size=None, slant=None, spacing=None, strike=None, subscript=None, superscript=None, underline=None, weight=None, word_mode=None)[source]

Bases: Font

Calc Character Font

Any properties starting with prop_ set or get current instance values.

All methods starting with fmt_ can be used to chain together font properties.

Many properties such as bold, italic, underline can be chained together.

Example

# chaining fonts together to add new properties
ft = Font().bold.italic.underline

ft_color = Font().style_color(CommonColor.GREEN).style_bg_color(CommonColor.LIGHT_BLUE)

New in version 0.9.4.

__init__(*, b=None, i=None, u=None, bg_color=None, bg_transparent=None, charset=None, color=None, family=None, name=None, overline=None, rotation=None, shadow_fmt=None, shadowed=None, size=None, slant=None, spacing=None, strike=None, subscript=None, superscript=None, underline=None, weight=None, word_mode=None)[source]

Font options used in styles.

Parameters:
  • b (bool, optional) – Shortcut to set weight to bold.

  • i (bool, optional) – Shortcut to set slant to italic.

  • u (bool, optional) – Shortcut ot set underline to underline.

  • bg_color (Color, optional) – The value of the text background color.

  • bg_transparent (bool, optional) – Determines if the text background color is set to transparent.

  • charset (CharSetEnum, optional) – The text encoding of the font.

  • color (Color, optional) – The value of the text color. Setting to -1 will cause automatic color.

  • family (FontFamilyEnum, optional) – Font Family.

  • name (str, optional) – This property specifies the name of the font style. It may contain more than one name separated by comma.

  • overline (FontLine, optional) – Character overline values.

  • rotation (int, Angle, optional) – Specifies the rotation of a character in degrees. Depending on the implementation only certain values may be allowed.

  • shadow_fmt (ShadowFormat | None) – (ShadowFormat, optional): Determines the type, color, and width of the shadow.

  • shadowed (bool, optional) – Specifies if the characters are formatted and displayed with a shadow effect.

  • size (float, UnitT, optional) – This value contains the size of the characters in pt (point) units or Class UnitT.

  • slant (FontSlant, optional) – The value of the posture of the document such as FontSlant.ITALIC.

  • spacing (CharSpacingKind, float, UnitT, optional) – Specifies character spacing in pt (point) units or Class UnitT.

  • strike (FontStrikeoutEnum, optional) – Determines the type of the strike out of the character.

  • subscript (bool, optional) – Subscript option.

  • superscript (bool, optional) – Superscript option.

  • underline (FontLine, optional) – Character underline values.

  • weight (FontWeightEnum, optional) – The value of the font weight.

  • word_mode (bool, optional) – If True, the underline and strike-through properties are not applied to white spaces.

Return type:

None

class ooodev.format.calc.direct.cell.font.FontEffects(*, color=None, transparency=None, overline=None, underline=None, strike=None, word_mode=None, case=None, relief=None, outline=None, hidden=None, shadowed=None)[source]

Bases: FontEffects

Calc Character Font Effects

Any properties starting with prop_ set or get current instance values.

All methods starting with fmt_ can be used to chain together font properties.

Many properties can be chained together.

New in version 0.9.4.

__init__(*, color=None, transparency=None, overline=None, underline=None, strike=None, word_mode=None, case=None, relief=None, outline=None, hidden=None, shadowed=None)[source]

Font options used in styles.

Parameters:
  • color (Color, optional) – The value of the text color. If value is -1 the automatic color is applied.

  • transparency (Intensity, int, optional) – The transparency value from 0 to 100 for the font color.

  • overline (FontLine, optional) – Character overline values.

  • underline (FontLine, optional) – Character underline values.

  • strike (FontStrikeoutEnum, optional) – Determines the type of the strike out of the character.

  • word_mode (bool, optional) – If True, the underline and strike-through properties are not applied to white spaces.

  • case (CaseMapEnum, optional) – Specifies the case of the font.

  • relief (FontReliefEnum, optional) – Specifies the relief of the font.

  • outline (bool, optional) – Specifies if the font is outlined.

  • hidden (bool, optional) – This property is Ignored in Calc. Included for compatibility.

  • shadowed (bool, optional) – Specifies if the characters are formatted and displayed with a shadow effect.

Return type:

None

fmt_hidden

Descriptor to raise an exception when a method is accessed when disabled.

prop_hidden

Descriptor to raise an exception when an attribute is accessed after deletion.

class ooodev.format.calc.direct.cell.font.FontOnly(*, name=None, size=None, font_style=None, lang=None)[source]

Bases: FontOnly

Calc Character Font

Any properties starting with prop_ set or get current instance values.

All methods starting with fmt_ can be used to chain together font properties.

New in version 0.9.4.

__init__(*, name=None, size=None, font_style=None, lang=None)[source]

Font options used in styles.

Parameters:
  • name (str, optional) – This property specifies the name of the font style. It may contain more than one name separated by comma.

  • size (float, UnitT, optional) – This value contains the size of the characters in pt (point) units or Class UnitT.

  • font_style (str, optional) – Font style name such as Bold.

  • lang (FontLangT, optional) – Font Language

Return type:

None

Hint

  • FontLang can be imported from ooodev.format.inner.direct.write.char.font.font_only