[mapguide-commits] r5190 - trunk/MgDev/Common/Renderers
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri Sep 24 01:22:10 EDT 2010
Author: waltweltonlair
Date: 2010-09-24 05:22:10 +0000 (Fri, 24 Sep 2010)
New Revision: 5190
Modified:
trunk/MgDev/Common/Renderers/FontManager.cpp
trunk/MgDev/Common/Renderers/FontManager.h
Log:
FontManager cleanup
* get rid of unused get_face() method
* with get_face() gone, get rid of m_facemap member variable
Modified: trunk/MgDev/Common/Renderers/FontManager.cpp
===================================================================
--- trunk/MgDev/Common/Renderers/FontManager.cpp 2010-09-24 05:12:12 UTC (rev 5189)
+++ trunk/MgDev/Common/Renderers/FontManager.cpp 2010-09-24 05:22:10 UTC (rev 5190)
@@ -50,7 +50,7 @@
//-------------------------------------------------------------------------
-// Constructor/Desctructor
+// Constructor/Destructor
//-------------------------------------------------------------------------
@@ -68,22 +68,6 @@
{
AutoMutexLocker autoLocker(sm_mutex);
- FaceMapIterator it;
- FaceMapEntryType* pEntry = NULL;
- char* pData = NULL;
-
- it = m_facemap.begin();
-
- // clean up entries
- while (it != m_facemap.end())
- {
- pEntry = (FaceMapEntryType*)(*it).second;
- pData = pEntry->pData;
- free(pData);
- delete pEntry;
- ++it;
- }
-
// free up font map entries
for (FontMapIterator fmi = m_fontAliases.begin(); fmi != m_fontAliases.end(); fmi++)
{
@@ -93,15 +77,9 @@
m_fontAliases.clear();
- // clear map
- m_facemap.clear();
-
// clean up fontlist
- FontListIterator it_font;
RS_Font* font = NULL;
-
- it_font = m_fontlist.begin();
-
+ FontListIterator it_font = m_fontlist.begin();
while (it_font != m_fontlist.end())
{
font = (RS_Font*)(*it_font);
@@ -128,51 +106,6 @@
}
-int FontManager::get_face(const char* filename, FT_Long index, FT_Face* face)
-{
- AutoMutexLocker autoLocker(sm_mutex);
-
- int ret = 0; // our return error code
- FaceMapIterator it; // an interator
- FaceMapEntryType* pEntry = NULL; // pointer to loaded font data
-
- // look for face in map
- it = m_facemap.find(filename);
-
- if (it != m_facemap.end())
- {
- // found an entry
- pEntry = (FaceMapEntryType*)(*it).second;
-
- // create a new face
- ret = FT_New_Memory_Face(m_library, (FT_Byte*)pEntry->pData, (FT_Long)pEntry->length, index, face);
- }
- else
- {
- // ok, we have to load it
-// ret = FT_New_Face(m_library, filename, index, face);
-
- pEntry = load_file(filename);
-
- if (pEntry)
- {
- // insert the entry into the map
- m_facemap.insert(FaceMapPair(filename, pEntry));
-
- // create a new face
- ret = FT_New_Memory_Face(m_library, (FT_Byte*)pEntry->pData, (FT_Long)pEntry->length, index, face);
- }
- else
- {
- face = NULL;
- ret = -1;
- }
- }
-
- return ret;
-}
-
-
FaceMapEntryType* FontManager::load_file(const char* filename)
{
AutoMutexLocker autoLocker(sm_mutex);
@@ -337,11 +270,8 @@
do
{
- error = FT_New_Face(m_library, entryName.c_str(), index, &face);
-
// TODO: revisit using the font manager here
-// error = m_FM->get_face(entryName.c_str(), index, &face);
-
+ error = FT_New_Face(m_library, entryName.c_str(), index, &face);
if (!error)
{
// init num_faces if necessary
Modified: trunk/MgDev/Common/Renderers/FontManager.h
===================================================================
--- trunk/MgDev/Common/Renderers/FontManager.h 2010-09-24 05:12:12 UTC (rev 5189)
+++ trunk/MgDev/Common/Renderers/FontManager.h 2010-09-24 05:22:10 UTC (rev 5190)
@@ -62,8 +62,6 @@
~FontManager();
public:
- int get_face(const char* filename, FT_Long index, FT_Face* face);
-
void init_font_list();
void create_font(FT_Face face, FT_Long index, wchar_t const* filename);
@@ -81,7 +79,6 @@
private:
FT_Library m_library;
- FaceMap m_facemap;
FontList m_fontlist;
FontMap m_fontAliases;
More information about the mapguide-commits
mailing list