ooodev.format.writer.direct.char.font package

Module contents

class ooodev.format.writer.direct.char.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: StyleBase

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.0.

__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, 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

apply(obj: Any)[source]
apply(obj: Any, **kwargs)
apply(obj, **kwargs)

Applies styles to object

Parameters:

obj (object) – UNO object that has supports com.sun.star.style.CharacterProperties service.

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

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

  • self (_TFont) –

Returns:

Font with style added or removed

Return type:

Font

property bg_transparent: _TFont

Gets copy of instance with background transparent set

Return type:

TypeVar(_TFont, bound= Font)

property bold: _TFont

Gets copy of instance with bold set

Return type:

TypeVar(_TFont, bound= Font)

property italic: _TFont

Gets copy of instance with italic set

Return type:

TypeVar(_TFont, bound= Font)

property overline: _TFont

Gets copy of instance with overline set

Return type:

TypeVar(_TFont, bound= Font)

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_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

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: _TFont

Gets copy of instance with shadow set

Return type:

TypeVar(_TFont, bound= Font)

property spacing_loose: _TFont

Gets copy of instance with spacing set to loose value

Return type:

TypeVar(_TFont, bound= Font)

property spacing_normal: _TFont

Gets copy of instance with spacing set to normal value

Return type:

TypeVar(_TFont, bound= Font)

property spacing_tight: _TFont

Gets copy of instance with spacing set to tight value

Return type:

TypeVar(_TFont, bound= Font)

property spacing_very_loose: _TFont

Gets copy of instance with spacing set to very loose value

Return type:

TypeVar(_TFont, bound= Font)

property spacing_very_tight: _TFont

Gets copy of instance with spacing set to very tight value

Return type:

TypeVar(_TFont, bound= Font)

property strike: _TFont

Gets copy of instance with strike set

Return type:

TypeVar(_TFont, bound= Font)

property subscript: _TFont

Gets copy of instance with sub script set

Return type:

TypeVar(_TFont, bound= Font)

property superscript: _TFont

Gets copy of instance with super script set

Return type:

TypeVar(_TFont, bound= Font)

property underline: _TFont

Gets copy of instance with underline set

Return type:

TypeVar(_TFont, bound= Font)

property word_mode: _TFont

Gets copy of instance with word mode set

Return type:

TypeVar(_TFont, bound= Font)

class ooodev.format.writer.direct.char.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: StyleBase

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.0.

__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) – Specifies if the font is hidden.

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

Return type:

None

apply(obj: Any)[source]
apply(obj: Any, **kwargs)
apply(obj, **kwargs)

Applies styles to object

Parameters:
  • obj (object) – UNO object that has supports com.sun.star.style.CharacterProperties service.

  • kwargs (Any) –

Return type:

None

fmt_case(value=None)[source]

Gets copy of instance with case set or removed.

Parameters:
  • value (CaseMapEnum, optional) – The case value. If None style is removed. Default None

  • self (_TFontEffects) –

Returns:

Font with style added or removed

Return type:

FontEffects

fmt_color(value=None)[source]

Gets copy of instance with text color set or removed.

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

  • self (_TFontEffects) –

Returns:

Font with style added or removed

Return type:

FontEffects

fmt_hidden(value=None)[source]

Gets copy of instance with hidden set or removed.

Parameters:
  • value (bool, optional) – The hidden value. If None style is removed. Default None

  • self (_TFontEffects) –

Returns:

Font with style added or removed

Return type:

FontEffects

fmt_outline(value=None)[source]

Gets copy of instance with outline set or removed.

Parameters:
  • value (bool, optional) – The outline value. If None style is removed. Default None

  • self (_TFontEffects) –

Returns:

Font with style added or removed

Return type:

FontEffects

fmt_overline(value=None)[source]

Gets 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

  • self (_TFontEffects) –

Returns:

Font with style added or removed

Return type:

FontEffects

fmt_overline_color(value=None)[source]

Gets 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

  • self (_TFontEffects) –

Returns:

Font with style added or removed

Return type:

FontEffects

fmt_relief(value=None)[source]

Gets copy of instance with relief set or removed.

Parameters:
  • value (FontReliefEnum, optional) – The relief value. If None style is removed. Default None

  • self (_TFontEffects) –

Returns:

Font with style added or removed

Return type:

FontEffects

fmt_shadowed(value=None)[source]

Gets copy of instance with shadowed set or removed.

Parameters:
  • value (bool, optional) – The shadowed value. If None style is removed. Default None

  • self (_TFontEffects) –

Returns:

Font with style added or removed

Return type:

FontEffects

fmt_strike(value=None)[source]

Gets 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

  • self (_TFontEffects) –

Returns:

Font with style added or removed

Return type:

FontEffects

fmt_transparency(value=None)[source]

Gets 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

  • self (_TFontEffects) –

Returns:

Font with style added or removed

Return type:

FontEffects

fmt_underline(value=None)[source]

Gets 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

  • self (_TFontEffects) –

Returns:

Font with style added or removed

Return type:

FontEffects

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

  • self (_TFontEffects) –

Returns:

Font with style added or removed

Return type:

FontEffects

fmt_word_mode(value=None)[source]

Gets 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

  • self (_TFontEffects) –

Returns:

Font with style added or removed

Return type:

FontEffects

classmethod from_obj(obj)[source]
classmethod from_obj(obj, **kwargs)
classmethod from_obj(obj, **kwargs)

Gets instance from object

Parameters:

obj (object) – UNO object.

Raises:

NotSupportedError – If obj is not supported.

Returns:

FontEffects instance that represents obj font effects.

Return type:

FontEffects

property case_lower: _TFontEffects

Gets copy of instance with case set to lower

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property case_none: _TFontEffects

Gets copy of instance with no case set

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property case_small_caps: _TFontEffects

Gets copy of instance with case set to small caps

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property case_title: _TFontEffects

Gets copy of instance with case set to title

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property case_upper: _TFontEffects

Gets copy of instance with case set to upper

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property color_auto: _TFontEffects

Gets copy of instance with color set to automatic

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property default: _TFontEffects

Gets Font Position default.

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property hidden: _TFontEffects

Gets copy of instance with hidden set

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property outline: _TFontEffects

Gets copy of instance with outline set

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property overline: _TFontEffects

Gets copy of instance with overline set

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property overline_color_auto: _TFontEffects

Gets copy of instance with overline color set to automatic

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property prop_case: CaseMapEnum | None

Gets/Sets Font Case Value

Return type:

CaseMapEnum | None

property prop_color: Color | None

Gets/Sets the value of the text color.

Return type:

Color | None

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

property prop_hidden: bool | None

Gets/Sets if the font is hidden

Return type:

bool | None

property prop_outline: bool | None

Gets/Sets if the font is outlined

Return type:

bool | None

property prop_overline: FontLine

This property contains the value for the character overline.

Return type:

FontLine

property prop_relief: FontReliefEnum | None

Gets/Sets Font Relief Value

Return type:

FontReliefEnum | None

property prop_shadowed: bool | None

Gets/Sets if the characters are formatted and displayed with a shadow effect.

Return type:

bool | None

property prop_strike: FontStrikeoutEnum | None

Gets/Sets the type of the strike out of the character.

Return type:

FontStrikeoutEnum | None

property prop_transparency: Intensity | None

Gets/Sets The transparency value

Return type:

Intensity | None

property prop_underline: FontLine

This property contains the value for the character underline.

Return type:

FontLine

property prop_word_mode: bool | None

Gets/Sets Character word mode. If this property is True, the underline and strike-through properties are not applied to white spaces.

Return type:

bool | None

property relief_embossed: _TFontEffects

Gets copy of instance with relief set to embossed

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property relief_engraved: _TFontEffects

Gets copy of instance with relief set to engraved

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property relief_none: _TFontEffects

Gets copy of instance with no relief set

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property shadowed: _TFontEffects

Gets copy of instance with shadow set

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property strike: _TFontEffects

Gets copy of instance with strike set

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property under_color_auto: _TFontEffects

Gets copy of instance with underline color set to automatic

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property underline: _TFontEffects

Gets copy of instance with underline set

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

property word_mode: _TFontEffects

Gets copy of instance with word mode set

Return type:

TypeVar(_TFontEffects, bound= FontEffects)

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

Bases: StyleMulti

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.0.

__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 (Lang, optional) – Font Language

Return type:

None

Hint

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

apply(obj: Any)[source]
apply(obj, **kwargs)

Applies styles to object

Parameters:

obj (object) – UNO object that has supports com.sun.star.style.CharacterProperties service.

Return type:

None

fmt_name(value=None)[source]

Get copy of instance with name set.

Parameters:
  • value (str, optional) – The name of the font.

  • self (_TFontOnly) –

Returns:

Font with style added or removed

Return type:

FontOnly

fmt_size(value=None)[source]

Get copy of instance with text size set.

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

  • self (_TFontOnly) –

Returns:

Font with style added

Return type:

FontOnly

fmt_style_name(value=None)[source]

Get copy of instance with style name set.

Parameters:
  • value (str, optional) – The style name of the font.

  • self (_TFontOnly) –

Returns:

Font with style added or removed

Return type:

FontOnly

classmethod from_obj(obj)[source]
classmethod from_obj(obj, **kwargs)
classmethod from_obj(obj, **kwargs)

Gets Font Only instance from object

Parameters:

obj (object) – UNO object.

Raises:

NotSupportedError – If obj is not supported.

Returns:

Font Only that represents obj Font.

Return type:

FontOnly

on_property_setting(source, event_args)[source]

Triggers for each property that is set

Parameters:
  • source (Any) – Event Source.

  • event_args (KeyValueCancelArgs) – Event Args

Return type:

None

default: FontOnly = None

Gets Font default.

The language is determined by LibreOffice settings / Basic Fonts / Default

Static Property.

default_caption: FontOnly = None

Gets Font caption default.

The language is determined by LibreOffice settings / Basic Fonts / Caption

Static Property.

default_heading: FontOnly = None

Gets Font heading default.

The language is determined by LibreOffice settings / Basic Fonts / Heading

Static Property.

default_index: FontOnly = None

Gets Font index default.

The language is determined by LibreOffice settings / Basic Fonts / Index

Static Property.

default_list: FontOnly = None

Gets Font list default.

The language is determined by LibreOffice settings / Basic Fonts / List

Static Property.

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

property prop_inner: FontLang

Gets Lang instance

Return type:

FontLang

property prop_name: str | None

This property specifies the name of the font style.

Return type:

str | None

property prop_size: UnitPT | None

This value contains the size of the characters in point.

Return type:

UnitPT | None

property prop_style_name: str | None

This property specifies the style name of the font style.

Return type:

str | None

class ooodev.format.writer.direct.char.font.FontPosition(*, script_kind=None, raise_lower=None, rel_size=None, rotation=None, scale=None, fit=None, spacing=None, pair=None)[source]

Bases: StyleBase

Character Font Position.

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.0.

__init__(*, script_kind=None, raise_lower=None, rel_size=None, rotation=None, scale=None, fit=None, spacing=None, pair=None)[source]

Constructor

Parameters:
  • script_kind (FontScriptKind, optional) – Specifies Superscript/Subscript option.

  • raise_lower (int, optional) – Specifies raise or Lower as percent value. Set to a value of 0 for automatic.

  • rel_size (int, Intensity, optional) – Specifies relative Font Size as percent value. Set this value to 0 for automatic; Otherwise value from 1 to 100.

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

  • scale (int, optional) – Specifies scale width as percent value. Min value is 1.

  • fit (bool, optional) – Specifies if rotation is fit to line.

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

  • pair (bool, optional) – Specifies pair kerning.

Return type:

None

apply(obj: Any)[source]
apply(obj, **kwargs)

Applies styles to object

Parameters:

obj (object) – UNO object that has supports com.sun.star.style.CharacterProperties service.

Return type:

None

fmt_fit(value=None)[source]

Get copy of instance with rotation fit set or removed.

Parameters:
  • value (bool, optional) – Rotation fit value. If None style is removed. Default None

  • self (_TFontPosition) –

Returns:

Font with style added or removed

Return type:

FontPosition

fmt_pair(value=None)[source]

Get copy of instance with pair kerning set or removed.

Parameters:
  • value (bool, optional) – Pair kerning value. If None style is removed. Default None

  • self (_TFontPosition) –

Returns:

Font with style added or removed

Return type:

FontPosition

fmt_raise_lower(value=None)[source]

Get copy of instance with raise/lower set or removed.

Parameters:
  • value (int, Intensity, optional) – Raise or Lower value. If None style is removed. Default None

  • self (_TFontPosition) –

Returns:

Font with style added or removed

Return type:

FontPosition

fmt_rel_size(value=None)[source]

Get copy of instance with relative size set or removed.

Parameters:
  • value (int, optional) – relative size value. If None style is removed. Default None

  • self (_TFontPosition) –

Returns:

Font with style added or removed

Return type:

FontPosition

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

  • self (_TFontPosition) –

Returns:

Font with style added or removed

Return type:

FontPosition

fmt_scale(value=None)[source]

Get copy of instance with scale width set or removed.

Parameters:
  • value (int, optional) – scale width value. If None style is removed. Default None

  • self (_TFontPosition) –

Returns:

Font with style added or removed

Return type:

FontPosition

fmt_scrip_kind(value=None)[source]

Get copy of instance with superscript/subscript set or removed.

Parameters:
  • value (FontScriptKind, optional) – font script kind. If None style is removed. Default None

  • self (_TFontPosition) –

Returns:

Font with style added or removed

Return type:

FontPosition

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

  • self (_TFontPosition) –

Returns:

Font with style added or removed

Return type:

FontPosition

classmethod from_obj(obj)[source]
classmethod from_obj(obj, **kwargs)
classmethod from_obj(obj, **kwargs)

Gets instance from object

Parameters:

obj (object) – UNO object that supports com.sun.star.style.CharacterProperties service.

Raises:

NotSupportedError – If obj is not supported.

Returns:

FontPosition instance that represents obj font position.

Return type:

FontPosition

on_property_setting(source, event_args)[source]

Triggers for each property that is set

Parameters:
  • event_args (KeyValueCancelArgs) – Event Args

  • source (Any) –

Return type:

None

property default: _TFontPosition

Gets Font Position default.

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property fit: _TFontPosition

Gets copy of instance with rotation fit to line set to True

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property normal: _TFontPosition

Gets copy of instance set to Position Normal

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property pair: _TFontPosition

Gets copy of instance with rotation pair kerning set to True

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property prop_fit: bool | None

Gets/Sets if rotation is fit to line

Return type:

bool | None

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

property prop_pair: bool | None

Gets/Sets pair kerning

Return type:

bool | None

property prop_raise_lower: int | None

Gets/Sets raise or lower amount, A value of 0 means automatic.

Return type:

int | None

property prop_rel_size: Intensity | None

Gets/Sets relative font size

Return type:

Intensity | None

property prop_rotation: Angle | None

Gets/Sets Font Rotation

Return type:

Angle | None

property prop_scale: int | None

Gets/Sets scale width

Return type:

int | None

property prop_script_kind: FontScriptKind | None
Return type:

FontScriptKind | None

property prop_spacing: UnitPT | None

This value contains character spacing in point units

Return type:

UnitPT | None

property raise_lower_auto: _TFontPosition

Gets copy of instance with raise/lower set to automatic

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property rotation_270: _TFontPosition

Gets copy of instance with rotation set to 270

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property rotation_90: _TFontPosition

Gets copy of instance with rotation set to 90

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property rotation_none: _TFontPosition

Gets copy of instance with rotation set to 0

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property script_kind_normal: _TFontPosition

Gets copy of instance set to Position Normal

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property script_kind_subscript: _TFontPosition

Gets copy of instance set to Position Subscript

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property script_kind_superscript: _TFontPosition

Gets copy of instance set to Position Superscript

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property spacing_loose: _TFontPosition

Gets copy of instance with spacing set to loose value

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property spacing_normal: _TFontPosition

Gets copy of instance with spacing set to normal value

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property spacing_tight: _TFontPosition

Gets copy of instance with spacing set to tight value

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property spacing_very_loose: _TFontPosition

Gets copy of instance with spacing set to very loose value

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property spacing_very_tight: _TFontPosition

Gets copy of instance with spacing set to very tight value

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property subscript: _TFontPosition

Gets copy of instance set to Position Subscript

Return type:

TypeVar(_TFontPosition, bound= FontPosition)

property superscript: _TFontPosition

Gets copy of instance set to Position Superscript

Return type:

TypeVar(_TFontPosition, bound= FontPosition)