phoenix_title wx.lib.graphics.GraphicsFont

A GraphicsFont is an adapter to allow using wx.Font with a GraphicsContext when drawing text.


class_hierarchy Class Hierarchy

Inheritance diagram for class GraphicsFont:

super_classes Known Superclasses

wx.lib.graphics.GraphicsObject


method_summary Methods Summary

__init__

Constructs a new GraphicsFont.

Apply

Apply this font’s properties to the given context.

CreateFromFont

Create a ``GraphicsFont from a wx.Font.

IsNull

Returns whether the object is valid.


property_summary Properties Summary

Brush

A GraphicsBrush to use for filling the text when using this

Colour

The color to be associated with this font. It will be used as the

PointSize

The size in points of the font.


api Class API

class GraphicsFont(GraphicsObject)

A GraphicsFont is an adapter to allow using wx.Font with a GraphicsContext when drawing text.


Methods

__init__(self)

Constructs a new GraphicsFont.

Note

Currently user code should be using CreateFromFont instead of creating new GraphicsFont 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.

Parameters:
  • font (wx.Font) – A wx.Font to use as a source of properties to be used when creating the Cairo font.

  • colour (wx.Colour) – An optional colour to associate with the font.



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:

GraphicsBrush



Colour

The color to be associated with this font. It will be used as the fill when drawing text with this font.

Type:

wx.Colour



PointSize

The size in points of the font.

Type:

int or float