- if (m_FontsTable[fb][fi][fu][ff][fs] == NULL) {
- m_FontsTable[fb][fi][fu][ff][fs] =
- new wxFont(
- m_FontsSizes[fs] * m_PixelScale,
- ff ? wxMODERN : wxSWISS,
- fi ? wxITALIC : wxNORMAL,
- fb ? wxBOLD : wxNORMAL,
- fu ? TRUE : FALSE, ff ? m_FontFaceFixed : m_FontFaceNormal);
+ wxString face = ff ? m_FontFaceFixed : m_FontFaceNormal;
+ wxString *faceptr = &(m_FontsFacesTable[fb][fi][fu][ff][fs]);
+ wxFont **fontptr = &(m_FontsTable[fb][fi][fu][ff][fs]);
+
+ if (*fontptr != NULL && *faceptr != face) {
+ delete *fontptr;
+ *fontptr = NULL;
+ }
+
+ if (*fontptr == NULL) {
+ *faceptr = face;
+ *fontptr = new wxFont(
+ m_FontsSizes[fs] * m_PixelScale,
+ ff ? wxMODERN : wxSWISS,
+ fi ? wxITALIC : wxNORMAL,
+ fb ? wxBOLD : wxNORMAL,
+ fu ? TRUE : FALSE, face);