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
+4 -1
View File
@@ -140,7 +140,9 @@ public:
const char *GetPath(void);
font_height GetHeight(const float &size);
FT_Face GetFTFace() const { return fFTFace; }
// TODO: Re-enable when I understand how the FT2 Cache system changed from
// 2.1.4 to 2.1.8
// int16 ConvertToUnicode(uint16 c);
@@ -154,6 +156,7 @@ protected:
bool is_fixedwidth, is_scalable, has_kerning, has_bitmaps;
int32 tunedcount;
CachedFace cachedface;
FT_Face fFTFace;
uint8 format;
BRect fbounds;
uint16 fID;
+9 -7
View File
@@ -64,13 +64,15 @@ public:
void SetRotation(const float &value) { frotation=value; }
void SetFace(const uint32 &value) { fFace=value; }
bool IsFixedWidth(void) { return fStyle->IsFixedWidth(); }
bool IsScalable(void) { return fStyle->IsScalable(); }
bool HasKerning(void) { return fStyle->HasKerning(); }
bool HasTuned(void) { return fStyle->HasTuned(); }
int32 TunedCount(void) { return fStyle->TunedCount(); }
uint16 GlyphCount(void) { return fStyle->GlyphCount(); }
uint16 CharMapCount(void) { return fStyle->CharMapCount(); }
bool IsFixedWidth(void) const { return fStyle->IsFixedWidth(); }
bool IsScalable(void) const { return fStyle->IsScalable(); }
bool HasKerning(void) const { return fStyle->HasKerning(); }
bool HasTuned(void) const { return fStyle->HasTuned(); }
int32 TunedCount(void) const { return fStyle->TunedCount(); }
uint16 GlyphCount(void) const { return fStyle->GlyphCount(); }
uint16 CharMapCount(void) const { return fStyle->CharMapCount(); }
FT_Face GetFTFace() const { return fStyle->GetFTFace(); };
const char *GetStyle(void) const;
const char *GetFamily(void) const;