David Rose пре 16 година
родитељ
комит
62889f3fa6
2 измењених фајлова са 8 додато и 3 уклоњено
  1. 7 2
      panda/src/text/fontPool.cxx
  2. 1 1
      panda/src/text/fontPool.h

+ 7 - 2
panda/src/text/fontPool.cxx

@@ -166,11 +166,16 @@ ns_add_font(const string &str, TextFont *font) {
 //  Description: The nonstatic implementation of release_font().
 //  Description: The nonstatic implementation of release_font().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void FontPool::
 void FontPool::
-ns_release_font(const string &filename) {
+ns_release_font(const string &str) {
   LightMutexHolder holder(_lock);
   LightMutexHolder holder(_lock);
 
 
+  string index_str;
+  Filename filename;
+  int face_index;
+  lookup_filename(str, index_str, filename, face_index);
+
   Fonts::iterator ti;
   Fonts::iterator ti;
-  ti = _fonts.find(filename);
+  ti = _fonts.find(index_str);
   if (ti != _fonts.end()) {
   if (ti != _fonts.end()) {
     _fonts.erase(ti);
     _fonts.erase(ti);
   }
   }

+ 1 - 1
panda/src/text/fontPool.h

@@ -54,7 +54,7 @@ private:
   bool ns_has_font(const string &str);
   bool ns_has_font(const string &str);
   TextFont *ns_load_font(const string &str);
   TextFont *ns_load_font(const string &str);
   void ns_add_font(const string &str, TextFont *font);
   void ns_add_font(const string &str, TextFont *font);
-  void ns_release_font(const string &filename);
+  void ns_release_font(const string &str);
   void ns_release_all_fonts();
   void ns_release_all_fonts();
   int ns_garbage_collect();
   int ns_garbage_collect();
   void ns_list_contents(ostream &out) const;
   void ns_list_contents(ostream &out) const;