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.
-
ascent
¶ Font ascent (maximum height above the baseline).
Returns: ascent – ascent of the font in CSS pixels. Return type: number
-
-
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:
toyplot.font.Font
Use Reportlab to access the metrics for a font.
Parameters: -
ascent
¶ Font ascent (maximum height above the baseline).
Returns: ascent – ascent of the font in CSS pixels. Return type: number
-
-
class
toyplot.font.
ReportlabLibrary
[source]¶ Bases:
toyplot.font.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
-