neoscore.interface.font_interface

class neoscore.interface.font_interface.FontInterface[source]

Bases: object

An interface for fonts, exposing some commonly used metadata.

family_name: str
size: Unit
weight: Optional[int]
italic: bool
ascent: Unit

The ascent of the font.

The ascent is the vertical distance between the font baseline and the highest any font characters reach.

descent: Unit

The descent of the font.

The ascent is the vertical distance between the font baseline and the lowest any font characters reach.

x_height: Unit

The x-height for the font.

This is generally similar, if not identical, to the em size.

qt_object: PyQt5.QtGui.QFont
__init__(family_name: str, size: Unit, weight: Optional[int], italic: bool) None
bounding_rect_of(text: str) Rect[source]

Calculate the tight bounding rectangle around a string in this font.