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

Module for managing character font.

New in version 0.9.0.

class ooodev.format.inner.direct.write.char.font.font_only.FontLang(*, country='US', language='en', variant='')[source]

Bases: LocaleStruct

Class for Character Language

default: FontLang = None

Gets Lang default.

The language is determined by LibreOffice settings / language settings / languages / Local Setting

Static Property.

class ooodev.format.inner.direct.write.char.font.font_only.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