Added cache for the fonts.

Fixed a memory leak in the string meter.
Changed the library project to use precompiled headers.
This commit is contained in:
Kimmo Pekkola
2009-10-07 16:45:14 +00:00
parent 61df4e1bad
commit 0b4ba32924
38 changed files with 595 additions and 335 deletions

View File

@ -40,6 +40,8 @@ public:
virtual bool Draw(Gdiplus::Graphics& graphics);
virtual void BindMeasure(std::list<CMeasure*>& measures);
static void FreeFontCache();
private:
enum TEXTSTYLE
{
@ -83,6 +85,10 @@ private:
std::vector<std::wstring> m_MeasureNames;
std::vector<CMeasure*> m_Measures;
static std::wstring FontPropertiesToString(Gdiplus::REAL size, Gdiplus::FontStyle style);
static std::map<std::wstring, Gdiplus::FontFamily*> c_FontFamilies; // Cache for the font families
static std::map<std::wstring, Gdiplus::Font*> c_Fonts; // Cache for the fonts
};
#endif