34#ifndef FONTRENDERABILITYCACHE_H
35#define FONTRENDERABILITYCACHE_H
37#include <wx/confbase.h>
39#include <wx/hashmap.h>
41#include <unordered_map>
76 void WriteTo(wxConfigBase *config)
const;
80 using RenderableCharsHash =
81 std::unordered_map<wxString, wxString, wxStringHash>;
84 static bool FontDisplaysChar(wxUniChar ch,
const wxFont &font);
86 static bool CharVisiblyDifferent(wxChar ch, wxChar otherChar,
90 RenderableCharsHash m_renderableChars;
92 RenderableCharsHash m_nonRenderableChars;
Caches which characters each font can actually render.
Definition: FontRenderabilityCache.h:65
bool FontRendersChar(wxUniChar ch, const wxFont &font)
True if we are confident that the font renders this char.
Definition: FontRenderabilityCache.cpp:32
void ReadFrom(wxConfigBase *config)
Reads the persisted verdicts from the configuration storage.
Definition: FontRenderabilityCache.cpp:60
void WriteTo(wxConfigBase *config) const
Persists the verdicts to the configuration storage.
Definition: FontRenderabilityCache.cpp:82
void ClearValues()
Forgets the cached verdicts (the known font names stay as empty entries).
Definition: FontRenderabilityCache.cpp:53