FT_New_Face is a quite heavy function and shouldn't be called for every StringWidth, StringHeight and DrawString call. We now keep it open in FontStyle and destroy it there too.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12006 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2005-03-25 21:02:40 +00:00
parent c98108eee3
commit 6d495dfc26
4 changed files with 18 additions and 10 deletions
+2 -1
View File
@@ -33,10 +33,11 @@ FTC_Manager ftmanager;
/*!
\brief Constructor
\param filepath path to a font file
\param face FreeType handle for the font file after it is loaded - for its info only
\param face FreeType handle for the font file after it is loaded - it will be kept open until the FontStyle is destroied
*/
FontStyle::FontStyle(const char *filepath, FT_Face face)
{
fFTFace = face;
fName=face->style_name;
cachedface=new CachedFaceRec;
cachedface->file_path=filepath;
+3 -1
View File
@@ -286,7 +286,9 @@ status_t FontServer::ScanDirectory(const char *fontspath)
else
validcount++;
FT_Done_Face(face);
// FT_Face is kept open in FontStyle and will be unset in the
// FontStyle destructor
} // end for(i<refcount)
dir.Unset();