neoscore.core.has_music_font
- class neoscore.core.has_music_font.HasMusicFont[source]
Bases:
objectA mixin for classes which have an associated staff measurement.
This is useful for integration with SMuFL fonts, where glyphs and their metadata are measured relative to a staff space.
A naive and slow implementation of the
music_fontproperty is provided which returns the nearest music found in the object’s ancestors. Subclasses will often want to override this.- static find_music_font(obj: PositionedObject) MusicFont[source]
Return the music font from
objor its nearest ancestor with one.This checks
objand then its ancestors for whether they have amusic_fontattribute, returning the first value found. If no font is found, this raises aNoAncestorWithMusicFontError.