ooodev.format.inner.direct.write.char.font.font_position module

Module for managing character Font position.

New in version 0.9.0.

class ooodev.format.inner.direct.write.char.font.font_position.CharSpacingKind(value)[source]

Bases: Enum

Character Spacing

LOOSE = 3.0
NORMAL = 0.0
TIGHT = -1.5
VERY_LOOSE = 6.0
VERY_TIGHT = -3.0
class ooodev.format.inner.direct.write.char.font.font_position.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)

class ooodev.format.inner.direct.write.char.font.font_position.FontScriptKind(value)[source]

Bases: Enum

Font Script Type

NORMAL = 0

Normal

SUBSCRIPT = -14000

Subscript

SUPERSCRIPT = 14000

Superscript