toyplot.font module¶
Font management and font metrics.
- class toyplot.font.Font[source]¶
Bases:
object
Abstract interface for objects that return information about a specific combination of typeface and size.
- property ascent¶
Font ascent (maximum height above the baseline).
- Returns
ascent – ascent of the font in CSS pixels.
- Return type
- property descent¶
Font descent (maximum height below the baseline).
- Returns
descent – descent of the font in CSS pixels.
- Return type
- class toyplot.font.Library[source]¶
Bases:
object
Abstract interface for objects that manage a collection of fonts.
- font(style)[source]¶
Lookup a font using CSS style information and return a corresponding Font object.
- Parameters
style (dict containing CSS style information) –
- Returns
font
- Return type
instance of
toyplot.font.Font
- class toyplot.font.ReportlabFont(family, size)[source]¶
Bases:
Font
Use Reportlab to access the metrics for a font.
- Parameters
- property ascent¶
Font ascent (maximum height above the baseline).
- Returns
ascent – ascent of the font in CSS pixels.
- Return type
- property descent¶
Font descent (maximum height below the baseline).
- Returns
descent – descent of the font in CSS pixels.
- Return type
- class toyplot.font.ReportlabLibrary[source]¶
Bases:
Library
Use Reportlab to provide information about standard PDF fonts.
- font(style)[source]¶
Lookup a font using CSS style information and return a corresponding Font object.
- Parameters
style (dict containing CSS style information) –
- Returns
font
- Return type
instance of
toyplot.font.ReportlabFont