wx.lib.graphics.GraphicsFont¶
A GraphicsFont
is an adapter to allow using wx.Font
with a
GraphicsContext
when drawing text.
Class Hierarchy¶
Known Superclasses¶
wx.lib.graphics.GraphicsObject
Methods Summary¶
Constructs a new |
|
Apply this font’s properties to the given context. |
|
Returns whether the object is valid. |
Properties Summary¶
A |
|
The color to be associated with this font. It will be used as the |
|
The size in points of the font. |
Class API¶
- class GraphicsFont(GraphicsObject)¶
A
GraphicsFont
is an adapter to allow usingwx.Font
with aGraphicsContext
when drawing text.
Methods¶
- __init__(self)¶
Constructs a new
GraphicsFont
.Note
Currently user code should be using
CreateFromFont
instead of creating newGraphicsFont
instances themselves.
- Apply(self, ctx, colour)¶
Apply this font’s properties to the given context. Called by
GraphicsContext
as needed.
- static CreateFromFont(font, colour=None)¶
Create a
GraphicsFont from a :class:`wx.Font`. Currently this is the only way to construct a ``GraphicsFont
.
- IsNull(self)¶
Returns whether the object is valid.
Properties¶
- Brush¶
A
GraphicsBrush
to use for filling the text when using this font. An alternative to using a plain colour.- Type:
- Colour¶
The color to be associated with this font. It will be used as the fill when drawing text with this font.
- Type:
- PointSize¶
The size in points of the font.
- Type:
int or float