ooodev.format.proto.write.char.font.font_t module

protocol ooodev.format.proto.write.char.font.font_t.FontT[source]

Bases: StyleT, Protocol

Font Protocol

Classes that implement this protocol must have the following methods / attributes:

__init__(*, b=Ellipsis, i=Ellipsis, u=Ellipsis, bg_color=Ellipsis, bg_transparent=Ellipsis, charset=Ellipsis, color=Ellipsis, family=Ellipsis, name=Ellipsis, overline=Ellipsis, rotation=Ellipsis, shadow_fmt=Ellipsis, shadowed=Ellipsis, size=Ellipsis, slant=Ellipsis, spacing=Ellipsis, strike=Ellipsis, subscript=Ellipsis, superscript=Ellipsis, underline=Ellipsis, weight=Ellipsis, word_mode=Ellipsis)[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, float, 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

fmt_bg_color(value=None)[source]

Get copy of instance with text background color set or removed.

Parameters:

value (Color, optional) – The text background color. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_bg_transparent(value=None)[source]

Get copy of instance with text background transparency set or removed.

Parameters:

value (bool, optional) – The text background transparency. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_charset(value=None)[source]

Gets a copy of instance with charset set or removed.

Parameters:

value (CharSetEnum, optional) – The text encoding of the font. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_color(value=None)[source]

Get copy of instance with text color set or removed.

Parameters:

value (Color, optional) – The text color. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_family(value=None)[source]

Gets a copy of instance with charset set or removed.

Parameters:

value (FontFamilyEnum, optional) – The Font Family. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_name(value=None)[source]

Get copy of instance with name set or removed.

Parameters:

value (str, optional) – The name of the font style. It may contain more than one name separated by comma. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_overline(value=None)[source]

Get copy of instance with overline set or removed.

Parameters:

value (FontUnderlineEnum, optional) – The size of the characters in point units. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_overline_color(value=None)[source]

Get copy of instance with text overline color set or removed.

Parameters:

value (Color, optional) – The color is used for an overline. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_rotation(value=None)[source]

Get copy of instance with rotation set or removed.

Parameters:

value (int, Angle, optional) – The rotation of a character in degrees. Depending on the implementation only certain values may be allowed. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_shadow_fmt(value=None)[source]

Get copy of instance with shadow format set or removed.

Parameters:

value (ShadowFormat, optional) – The type, color, and width of the shadow. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_size(value=None)[source]

Get copy of instance with text size set or removed.

Parameters:

value (float, UnitT, optional) – The size of the characters in pt (point) units Class UnitT. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_slant(value=None)[source]

Get copy of instance with slant set or removed.

Parameters:

value (FontSlant, optional) – The value of the posture of the document such as FontSlant.ITALIC. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

Note

This method changes or removes any italic settings.

fmt_spacing(value=None)[source]

Get copy of instance with spacing set or removed.

Parameters:

value (float, UnitT, optional) – The character spacing in pt (point) units Class UnitT. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_strike(value=None)[source]

Get copy of instance with strike set or removed.

Parameters:

value (FontStrikeoutEnum, optional) – The type of the strike out of the character. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_subscript(value=None)[source]

Get copy of instance with text subscript set or removed.

Parameters:

value (bool, optional) – The subscript. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_superscript(value=None)[source]

Get copy of instance with text superscript set or removed.

Parameters:

value (bool, optional) – The superscript. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_underline(value=None)[source]

Get copy of instance with underline set or removed.

Parameters:

value (FontUnderlineEnum, optional) – The value for the character underline. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_underline_color(value=None)[source]

Gets copy of instance with text underline color set or removed.

Parameters:

value (Color, optional) – The color is used for an underline. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

fmt_weight(value=None)[source]

Get copy of instance with weight set or removed.

Parameters:

value (FontWeightEnum, optional) – The value of the font weight. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

Note

This method changes or removes any bold settings.

fmt_word_mode(value=None)[source]

Get copy of instance with word mode set or removed.

The underline and strike-through properties are not applied to white spaces when set to True.

Parameters:

value (bool, optional) – The word mode. If None style is removed. Default None

Returns:

Font with style added or removed

Return type:

Font

__protocol_attrs__ = {'add_event_listener', 'add_event_observer', 'apply', 'backup', 'bg_transparent', 'bold', 'copy', 'fmt_bg_color', 'fmt_bg_transparent', 'fmt_charset', 'fmt_color', 'fmt_family', 'fmt_name', 'fmt_overline', 'fmt_overline_color', 'fmt_rotation', 'fmt_shadow_fmt', 'fmt_size', 'fmt_slant', 'fmt_spacing', 'fmt_strike', 'fmt_subscript', 'fmt_superscript', 'fmt_underline', 'fmt_underline_color', 'fmt_weight', 'fmt_word_mode', 'get_attrs', 'get_props', 'get_update_obj', 'has_update_obj', 'italic', 'on_applied', 'on_applying', 'on_property_backed_up', 'on_property_backing_up', 'on_property_restore_set', 'on_property_restore_setting', 'on_property_set', 'on_property_set_error', 'overline', 'prop_bg_color', 'prop_bg_color_transparent', 'prop_charset', 'prop_color', 'prop_family', 'prop_format_kind', 'prop_has_attribs', 'prop_has_backup', 'prop_is_bold', 'prop_is_italic', 'prop_is_underline', 'prop_name', 'prop_overline', 'prop_parent', 'prop_rotation', 'prop_shadow_fmt', 'prop_shadowed', 'prop_size', 'prop_slant', 'prop_spacing', 'prop_strike', 'prop_subscript', 'prop_superscript', 'prop_underline', 'prop_weight', 'prop_word_mode', 'remove_event_listener', 'remove_event_observer', 'restore', 'set_update_obj', 'shadowed', 'spacing_loose', 'spacing_normal', 'spacing_tight', 'spacing_very_loose', 'spacing_very_tight', 'strike', 'subscript', 'superscript', 'support_service', 'underline', 'update', 'word_mode'}
property bg_transparent: Self

Gets copy of instance with background transparent set

Return type:

Self

property bold: Self

Gets copy of instance with bold set

Return type:

Self

property italic: Self

Gets copy of instance with italic set

Return type:

Self

property overline: Self

Gets copy of instance with overline set

Return type:

Self

property prop_bg_color: Color | None

This property contains the text background color.

Return type:

Color | None

property prop_bg_color_transparent: bool | None

This property contains the text background color.

Return type:

bool | None

property prop_charset: CharSetEnum | None

This property contains the text encoding of the font.

Return type:

CharSetEnum | None

property prop_color: Color | None

This property contains the value of the text color.

Return type:

Color | None

property prop_family: FontFamilyEnum | None

This property contains font family.

Return type:

FontFamilyEnum | None

property prop_is_bold: bool

Specifies bold

Return type:

bool

property prop_is_italic: bool | None

Specifies italic

Return type:

bool | None

property prop_is_underline: bool | None

Specifies underline

Return type:

bool | None

property prop_name: str | None

This property specifies the name of the font style. It may contain more than one name separated by comma.

Return type:

str | None

property prop_overline: FontLine

This property contains the value for the character overline.

Return type:

FontLine

property prop_rotation: Angle | None

This optional property determines the rotation of a character in degrees.

Depending on the implementation only certain values may be allowed.

Return type:

Angle | None

property prop_shadow_fmt: ShadowFormat | None

This property specifies the type, color, and width of the shadow.

Return type:

ShadowFormat | None

property prop_shadowed: bool | None

This property specifies if the characters are formatted and displayed with a shadow effect.

Return type:

bool | None

property prop_size: UnitPT | None

This value contains the size of the characters in pt (point) units.

Return type:

UnitPT | None

property prop_slant: FontSlant | None

This property contains the value of the posture of the document such as FontSlant.ITALIC

Return type:

FontSlant | None

property prop_spacing: UnitPT | None

This value contains character spacing in pt (point) units

Return type:

UnitPT | None

property prop_strike: FontStrikeoutEnum | None

This property determines the type of the strike out of the character.

Return type:

FontStrikeoutEnum | None

property prop_subscript: bool | None

Specifies if the font is sub script

Return type:

bool | None

property prop_superscript: bool | None

Specifies if the font is super script

Return type:

bool | None

property prop_underline: FontLine

This property contains the value for the character underline.

Return type:

FontLine

property prop_weight: FontWeightEnum | None

This property contains the value of the font weight.

Return type:

FontWeightEnum | None

property prop_word_mode: bool | None

If this property is True, the underline and strike-through properties are not applied to white spaces.

Return type:

bool | None

property shadowed: Self

Gets copy of instance with shadow set

Return type:

Self

property spacing_loose: Self

Gets copy of instance with spacing set to loose value

Return type:

Self

property spacing_normal: Self

Gets copy of instance with spacing set to normal value

Return type:

Self

property spacing_tight: Self

Gets copy of instance with spacing set to tight value

Return type:

Self

property spacing_very_loose: Self

Gets copy of instance with spacing set to very loose value

Return type:

Self

property spacing_very_tight: Self

Gets copy of instance with spacing set to very tight value

Return type:

Self

property strike: Self

Gets copy of instance with strike set

Return type:

Self

property subscript: Self

Gets copy of instance with sub script set

Return type:

Self

property superscript: Self

Gets copy of instance with super script set

Return type:

Self

property underline: Self

Gets copy of instance with underline set

Return type:

Self

property word_mode: Self

Gets copy of instance with word mode set

Return type:

Self