Add wxFontEnumerator::InvalidateCache()
This is necessary to recognize new fonts, for example those added using AddPrivateFont(), as being valid: otherwise they were not found in the cache and couldn't be used in wxGTK.
This commit is contained in:
@@ -74,6 +74,11 @@ public:
|
||||
// in the user's system
|
||||
static bool IsValidFacename(const wxString &str);
|
||||
|
||||
// Invalidate cache used by some of the methods of this class internally.
|
||||
// This should be called if the list of the fonts available on the system
|
||||
// changes, for whatever reason.
|
||||
static void InvalidateCache();
|
||||
|
||||
private:
|
||||
#ifdef wxHAS_UTF8_FONTS
|
||||
// helper for ports that only use UTF-8 encoding natively
|
||||
|
@@ -73,6 +73,17 @@ public:
|
||||
*/
|
||||
static bool IsValidFacename(const wxString& facename);
|
||||
|
||||
/**
|
||||
Invalidate cache used by some of the methods of this class internally.
|
||||
|
||||
This method should be called if the list of the fonts available on the
|
||||
system changes, for whatever reason. In particular, it is called
|
||||
automatically by wxFont::AddPrivateFont().
|
||||
|
||||
@since 3.1.1
|
||||
*/
|
||||
static void InvalidateCache();
|
||||
|
||||
/**
|
||||
Called by EnumerateFacenames() for each match.
|
||||
|
||||
|
@@ -127,6 +127,12 @@ bool wxFontEnumerator::IsValidFacename(const wxString &facename)
|
||||
return true;
|
||||
}
|
||||
|
||||
/* static */
|
||||
void wxFontEnumerator::InvalidateCache()
|
||||
{
|
||||
gs_allFacenames.clear();
|
||||
}
|
||||
|
||||
#ifdef wxHAS_UTF8_FONTS
|
||||
bool wxFontEnumerator::EnumerateEncodingsUTF8(const wxString& facename)
|
||||
{
|
||||
|
Reference in New Issue
Block a user