Allow creating wxGraphicsFont without using wxFont.

This is mostly important to allow using wxImage-based wxGraphicsContext
without requiring X server connection under Unix: as wxFont can't be used
without X server, we needed another way to create wxGraphicsFont in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69360 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-10-09 22:07:29 +00:00
parent a95f35b07a
commit fa378d369f
8 changed files with 316 additions and 70 deletions

View File

@@ -453,6 +453,19 @@ public:
virtual wxGraphicsFont CreateFont(const wxFont& font,
const wxColour& col = *wxBLACK) const;
/**
Creates a font object with the specified attributes.
The use of overload taking wxFont is preferred, see
wxGraphicsRenderer::CreateFont() for more details.
@since 2.9.3
*/
virtual wxGraphicsFont CreateFont(double sizeInPixels,
const wxString& facename,
int flags = wxFONTFLAG_DEFAULT,
const wxColour& col = *wxBLACK) const;
/**
Creates a wxGraphicsContext from a native context. This native context
must be a CGContextRef for Core Graphics, a Graphics pointer for
@@ -1027,6 +1040,35 @@ public:
virtual wxGraphicsFont CreateFont(const wxFont& font,
const wxColour& col = *wxBLACK) = 0;
/**
Creates a graphics font with the given characteristics.
If possible, the CreateFont() overload taking wxFont should be used
instead. The main advantage of this overload is that it can be used
without X server connection under Unix when using Cairo.
@param sizeInPixels
Height of the font in user space units, i.e. normally pixels.
Notice that this is different from the overload taking wxFont as
wxFont size is specified in points.
@param facename
The name of the font. The same font name might not be available
under all platforms so the font name can also be empty to use the
default platform font.
@param flags
Combination of wxFontFlag enum elements. Currently only
@c wxFONTFLAG_ITALIC and @c wxFONTFLAG_BOLD are supported. By
default the normal font version is used.
@param col
The font colour, black by default.
@since 2.9.3
*/
virtual wxGraphicsFont CreateFont(double sizeInPixels,
const wxString& facename,
int flags = wxFONTFLAG_DEFAULT,
const wxColour& col = *wxBLACK) = 0;
/**
Creates a native brush with a linear gradient.