A logical and graphical time signature
TODO: Time signatures with differing character-length numerators and denominators (e.g. 12/8) currently display incorrectly as left-justified.
Convert a number to a list of SMuFL glyph names.
Args: number (int): The time signature number to derive from
list[str]: The time signature glyph names for the digits of
(pos_x, meter, staff)
(StaffUnit): The x position relative to the
(Beat): The length of a measure in this
time signature. The numerator and denominators
of this duration are used literally as the numbers
in the rendered representation of the signature.
While a 6/8 measure will take the same amount of time
as a 3/4 measure, the representations (and note groupings)
(Staff): The parent staff
— The upper glyph for the time signature
— The lower glyph for the time signature
— The length of one bar in this time signature
— The position of this object relative to the staff.
This position is in non-flowed space.
# TODO: Definitely cache me when property caching is implemented
— The interfaces for this object
Interface objects are created upon calling
Typically each GraphicObject will have one interface for each flowable line it appears in. Objects which fit completely in one visual line will typically have exactly one interface.
If this is an empty set, the object has not been rendered yet
— The breakable length of the object.
This is used to determine how and where rendering cuts should be made.
— The brush to draw outlines with
As a convenience, this may be set with a hex color string for a solid color brush of that color. For brushes using alpha channels and non-solid-color fill patterns, a fully initialized brush must be passed to this.
— The parent object.
If this is set to None, it defaults to the first page of the document.
— All objects who have self as their parent.
— All of the objects in the children subtree.
This recursively searches all of the object's children (and their children, etc.) and provides an iterator over them.
The current implementation performs a simple recursive DFS over the tree, and has the potential to be rather slow.
— All ancestors of this object.
Flowable or None
— The flowable this object belongs in.
page_index: —The index of the page this object appears on.
Yield all child descendants with a given class or its subclasses.
Args: graphic_object_class (type): The type to search for. This should be a subclass of GraphicObject.
Yield all child descendants with a given class.