\membersection{wxFontList::FindOrCreateFont}\label{findorcreatefont}
\func{wxFont *}{FindOrCreateFont}{\param{int}{ point\_size}, \param{int}{ family}, \param{int}{ style}, \param{int}{ weight}, \param{bool}{ underline = FALSE},
- \param{const wxString\& }{facename = NULL}}
+ \param{const wxString\& }{facename = NULL}, \param{wxFontEncoding }{encoding = wxFONTENCODING_DEFAULT}{}}
Finds a font of the given specification, or creates one and adds it to the list. See the \helpref{wxFont constructor}{wxfontconstr} for
details of the arguments.
#include "wx/string.h"
#include "wx/setup.h"
#include "wx/colour.h"
+#include "wx/font.h"
// ---------------------------------------------------------------------------
// forward declarations
void RemoveFont(wxFont *font);
wxFont *FindOrCreateFont(int pointSize, int family, int style, int weight,
bool underline = FALSE,
- const wxString& face = wxEmptyString);
+ const wxString& face = wxEmptyString,
+ wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
};
class WXDLLEXPORT wxColourDatabase : public wxList
}
wxFont *wxFontList::
- FindOrCreateFont (int PointSize, int FamilyOrFontId, int Style, int Weight, bool underline, const wxString& Face)
+ FindOrCreateFont (int PointSize, int FamilyOrFontId, int Style, int Weight, bool underline, const wxString& Face, wxFontEncoding encoding)
{
for (wxNode * node = First (); node; node = node->Next ())
{
#else
each_font->GetFamily() == FamilyOrFontId &&
#endif
- ((each_font->GetFaceName() == wxT("")) || each_font->GetFaceName() == Face))
+ ((each_font->GetFaceName() == wxT("")) || each_font->GetFaceName() == Face) &&
+ (encoding == wxFONTENCODING_DEFAULT || each_font->GetEncoding() == encoding))
//#endif
return each_font;
}
- wxFont *font = new wxFont (PointSize, FamilyOrFontId, Style, Weight, underline, Face);
+ wxFont *font = new wxFont (PointSize, FamilyOrFontId, Style, Weight, underline, Face, encoding);
font->SetVisible(TRUE);
return font;
}