Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

egl: expose functions for font load/unload

Credit pieh for finding/fixing this as the cause of a crash when reloading a
window
  • Loading branch information...
commit 7d32a8cba2e5b9fa58d2c0e21dada3c1fa39a8fd 1 parent b218bfc
Cory Fields authored
Showing with 14 additions and 1 deletion.
  1. +11 −0 xbmc/guilib/GUIFontManager.cpp
  2. +3 −1 xbmc/guilib/GUIFontManager.h
View
11 xbmc/guilib/GUIFontManager.cpp
@@ -239,6 +239,17 @@ void GUIFontManager::ReloadTTFFonts(void)
}
}
+void GUIFontManager::UnloadTTFFonts()
+{
+ for (vector<CGUIFontTTFBase*>::iterator i = m_vecFontFiles.begin(); i != m_vecFontFiles.end(); i++)
+ delete (*i);
+
+ m_vecFontFiles.clear();
+
+ for (vector<CGUIFont*>::iterator i = m_vecFonts.begin(); i != m_vecFonts.end(); i++)
+ (*i)->SetFont(NULL);
+}
+
void GUIFontManager::Unload(const CStdString& strFontName)
{
for (vector<CGUIFont*>::iterator iFont = m_vecFonts.begin(); iFont != m_vecFonts.end(); ++iFont)
View
4 xbmc/guilib/GUIFontManager.h
@@ -78,9 +78,11 @@ class GUIFontManager : public IMsgTargetCallback
bool IsFontSetUnicode(const CStdString& strFontSet);
bool GetFirstFontSetUnicode(CStdString& strFontSet);
+ void ReloadTTFFonts();
+ void UnloadTTFFonts();
+
protected:
void RescaleFontSizeAndAspect(float *size, float *aspect, const RESOLUTION_INFO &sourceRes, bool preserveAspect) const;
- void ReloadTTFFonts();
void LoadFonts(const TiXmlNode* fontNode);
CGUIFontTTFBase* GetFontFile(const CStdString& strFontFile);
bool OpenFontFile(CXBMCTinyXML& xmlDoc);
Please sign in to comment.
Something went wrong with that request. Please try again.