ooodev.format.writer.direct.para.drop_caps package
Module contents
- class ooodev.format.writer.direct.para.drop_caps.DropCaps(*, count=0, spaces=0.0, lines=3, style=None, whole_word=None)[source]
Bases:
StyleMulti
Paragraph Drop Caps
New in version 0.9.0.
- __init__(*, count=0, spaces=0.0, lines=3, style=None, whole_word=None)[source]
Constructor
- Parameters:
count (int) – Specifies the number of characters in the drop cap. Must be from
0
to255
.spaces (float, UnitT) – Specifies the distance between the drop cap in the following text (in
mm
units) or Class UnitT.lines (int) – Specifies the number of lines used for a drop cap. Must be from
0
to255
.style (StyleCharKind, str, optional) – Specifies the character style name for drop caps.
whole_word (bool, optional) – specifies if Drop Cap is applied to the whole first word.
- Return type:
None
Note
If
count==-1
then onlystyle
can be updated. Ifcount==0
then all other arguments are ignored and instance set to remove drop caps whenapply()
is called.
- dispatch_reset()[source]
Resets the cursor at is current position/selection to remove any Drop Caps Formatting using a dispatch command.
- Return type:
None
Example
dc = DropCaps(count=1, style=StyleCharKind.DROP_CAPS) Write.append_para(cursor=cursor, text="Hello World!", styles=(dc,)) dc.dispatch_reset()
- 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:
DropCaps
instance that representsobj
Drop Caps.- Return type:
- 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
- property default: _TDropCaps
Gets
DropCaps
default.- Return type:
TypeVar
(_TDropCaps
, bound= DropCaps)
- property prop_format_kind: FormatKind
Gets the kind of style
- Return type:
- property prop_inner: DropCapStruct | None
Gets Drop Caps Format instance
- Return type:
DropCapStruct | None