neoscore.core.music_font

class neoscore.core.music_font.MusicFont[source]

Bases: Font

A SMuFL compliant music font

__init__(family_name: str, size: Union[Unit, Type[Unit]])[source]
Parameters
  • family_name – The font name

  • size – The font size, given either as the distance between two staff lines, or a unit type where unit(1) is that distance.

property unit: Type[Unit]

A unit type where unit(1) is a standard staff space in the font.

property engraving_defaults: Dict

The SMuFL engraving defaults for this font.

See SMuFL’s description of this data here.

modified(family_name: Optional[str] = None, unit: Optional[Type[Unit]] = None) MusicFont[source]

Derive a font from this one.

All properties not specified will be taken from the existing font.

glyph_info(glyph_name: str, alternate_number: Optional[int] = None) GlyphInfo[source]

Look up metadata on a glyph in this font.

Parameters
  • glyph_name – The canonical name of the glyph, or its main version if using an alternate number.

  • alternate_number – A glyph alternate number.

Raises

MusicFontGlyphNotFoundError – If the requested glyph could not be found in the font.