summaryrefslogtreecommitdiffstats
path: root/vcl/generic/glyphs
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2016-01-07 15:25:31 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2016-01-07 15:26:58 +1100
commitf5151af414f0ac0590d87040929cabe7f8db3106 (patch)
tree906a6927740aef3d9c63e54a3606bce07b4c737f /vcl/generic/glyphs
parentvcl: cleanup headers - remove unnecessary includes and fwd decls (diff)
downloadcore-f5151af414f0ac0590d87040929cabe7f8db3106.tar.gz
core-f5151af414f0ac0590d87040929cabe7f8db3106.zip
vcl: FtFont{Info|File} renamed to FreetypeFont{Info|Type}
Change-Id: I91621a177f27200c9d3413dd4953d5292a2ac15b
Diffstat (limited to 'vcl/generic/glyphs')
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.cxx56
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.hxx30
2 files changed, 43 insertions, 43 deletions
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index 686be0060ad0..f29399834330 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -74,7 +74,7 @@ static FT_Library aLibFT = nullptr;
// enable linking with old FT versions
static int nFTVERSION = 0;
-typedef std::unordered_map<const char*, std::shared_ptr<FtFontFile>, rtl::CStringHash, rtl::CStringEqual> FontFileList;
+typedef std::unordered_map<const char*, std::shared_ptr<FreetypeFontFile>, rtl::CStringHash, rtl::CStringEqual> FontFileList;
namespace { struct vclFontFileList : public rtl::Static< FontFileList, vclFontFileList > {}; }
@@ -91,7 +91,7 @@ static int nDefaultPrioAntiAlias = 1;
// FreetypeManager
-FtFontFile::FtFontFile( const OString& rNativeFileName )
+FreetypeFontFile::FreetypeFontFile( const OString& rNativeFileName )
: maNativeFileName( rNativeFileName ),
mpFileMap( nullptr ),
mnFileSize( 0 ),
@@ -117,7 +117,7 @@ FtFontFile::FtFontFile( const OString& rNativeFileName )
}
}
-FtFontFile* FtFontFile::FindFontFile( const OString& rNativeFileName )
+FreetypeFontFile* FreetypeFontFile::FindFontFile( const OString& rNativeFileName )
{
// font file already known? (e.g. for ttc, synthetic, aliased fonts)
const char* pFileName = rNativeFileName.getStr();
@@ -127,13 +127,13 @@ FtFontFile* FtFontFile::FindFontFile( const OString& rNativeFileName )
return it->second.get();
// no => create new one
- FtFontFile* pFontFile = new FtFontFile( rNativeFileName );
+ FreetypeFontFile* pFontFile = new FreetypeFontFile( rNativeFileName );
pFileName = pFontFile->maNativeFileName.getStr();
rFontFileList[pFileName].reset(pFontFile);
return pFontFile;
}
-bool FtFontFile::Map()
+bool FreetypeFontFile::Map()
{
if( mnRefCount++ <= 0 )
{
@@ -160,7 +160,7 @@ bool FtFontFile::Map()
return (mpFileMap != nullptr);
}
-void FtFontFile::Unmap()
+void FreetypeFontFile::Unmap()
{
if( (--mnRefCount > 0) || (mpFileMap == nullptr) )
return;
@@ -170,10 +170,10 @@ void FtFontFile::Unmap()
}
#if ENABLE_GRAPHITE
-// wrap FtFontInfo's table function
+// wrap FreetypeFontInfo's table function
const void * graphiteFontTable(const void* appFaceHandle, unsigned int name, size_t *len)
{
- const FtFontInfo * pFontInfo = static_cast<const FtFontInfo*>(appFaceHandle);
+ const FreetypeFontInfo * pFontInfo = static_cast<const FreetypeFontInfo*>(appFaceHandle);
typedef union {
char m_c[5];
unsigned int m_id;
@@ -196,11 +196,11 @@ const void * graphiteFontTable(const void* appFaceHandle, unsigned int name, siz
}
#endif
-FtFontInfo::FtFontInfo( const ImplFontAttributes& rDevFontAttributes,
+FreetypeFontInfo::FreetypeFontInfo( const ImplFontAttributes& rDevFontAttributes,
const OString& rNativeFileName, int nFaceNum, sal_IntPtr nFontId)
:
maFaceFT( nullptr ),
- mpFontFile( FtFontFile::FindFontFile( rNativeFileName ) ),
+ mpFontFile( FreetypeFontFile::FindFontFile( rNativeFileName ) ),
mnFaceNum( nFaceNum ),
mnRefCount( 0 ),
#if ENABLE_GRAPHITE
@@ -219,7 +219,7 @@ FtFontInfo::FtFontInfo( const ImplFontAttributes& rDevFontAttributes,
maDevFontAttributes.IncreaseQualityBy( mpFontFile->GetLangBoost() );
}
-FtFontInfo::~FtFontInfo()
+FreetypeFontInfo::~FreetypeFontInfo()
{
if( mpFontCharMap )
mpFontCharMap = nullptr;
@@ -230,14 +230,14 @@ FtFontInfo::~FtFontInfo()
#endif
}
-void FtFontInfo::InitHashes() const
+void FreetypeFontInfo::InitHashes() const
{
// TODO: avoid pointers when empty stl::hash_* objects become cheap
mpChar2Glyph = new Int2IntMap();
mpGlyph2Char = new Int2IntMap();
}
-FT_FaceRec_* FtFontInfo::GetFaceFT()
+FT_FaceRec_* FreetypeFontInfo::GetFaceFT()
{
if (!maFaceFT && mpFontFile->Map())
{
@@ -253,7 +253,7 @@ FT_FaceRec_* FtFontInfo::GetFaceFT()
}
#if ENABLE_GRAPHITE
-GraphiteFaceWrapper * FtFontInfo::GetGraphiteFace()
+GraphiteFaceWrapper * FreetypeFontInfo::GetGraphiteFace()
{
if (mbCheckedGraphite)
return mpGraphiteFace;
@@ -275,7 +275,7 @@ GraphiteFaceWrapper * FtFontInfo::GetGraphiteFace()
}
#endif
-void FtFontInfo::ReleaseFaceFT()
+void FreetypeFontInfo::ReleaseFaceFT()
{
if (--mnRefCount <= 0)
{
@@ -293,7 +293,7 @@ static const sal_uInt32 T_true = 0x74727565; /* 'true' */
static const sal_uInt32 T_ttcf = 0x74746366; /* 'ttcf' */
static const sal_uInt32 T_otto = 0x4f54544f; /* 'OTTO' */
-const unsigned char* FtFontInfo::GetTable( const char* pTag, sal_uLong* pLength ) const
+const unsigned char* FreetypeFontInfo::GetTable( const char* pTag, sal_uLong* pLength ) const
{
const unsigned char* pBuffer = mpFontFile->GetBuffer();
int nFileSize = mpFontFile->GetFileSize();
@@ -329,7 +329,7 @@ const unsigned char* FtFontInfo::GetTable( const char* pTag, sal_uLong* pLength
return nullptr;
}
-void FtFontInfo::AnnounceFont( PhysicalFontCollection* pFontCollection )
+void FreetypeFontInfo::AnnounceFont( PhysicalFontCollection* pFontCollection )
{
ImplFTSFontData* pFD = new ImplFTSFontData( this, maDevFontAttributes );
pFontCollection->Add( pFD );
@@ -380,7 +380,7 @@ void FreetypeManager::AddFontFile( const OString& rNormalizedName,
if( maFontList.find( nFontId ) != maFontList.end() )
return;
- FtFontInfo* pFontInfo = new FtFontInfo( rDevFontAttr,
+ FreetypeFontInfo* pFontInfo = new FreetypeFontInfo( rDevFontAttr,
rNormalizedName, nFaceNum, nFontId);
maFontList[ nFontId ] = pFontInfo;
if( mnMaxFontId < nFontId )
@@ -391,8 +391,8 @@ void FreetypeManager::AnnounceFonts( PhysicalFontCollection* pToAdd ) const
{
for( FontList::const_iterator it = maFontList.begin(); it != maFontList.end(); ++it )
{
- FtFontInfo* pFtFontInfo = it->second;
- pFtFontInfo->AnnounceFont( pToAdd );
+ FreetypeFontInfo* pFreetypeFontInfo = it->second;
+ pFreetypeFontInfo->AnnounceFont( pToAdd );
}
}
@@ -400,15 +400,15 @@ void FreetypeManager::ClearFontList( )
{
for( FontList::iterator it = maFontList.begin(); it != maFontList.end(); ++it )
{
- FtFontInfo* pFtFontInfo = it->second;
- delete pFtFontInfo;
+ FreetypeFontInfo* pFreetypeFontInfo = it->second;
+ delete pFreetypeFontInfo;
}
maFontList.clear();
}
ServerFont* FreetypeManager::CreateFont( const FontSelectPattern& rFSD )
{
- FtFontInfo* pFontInfo = nullptr;
+ FreetypeFontInfo* pFontInfo = nullptr;
// find a FontInfo matching to the font id
sal_IntPtr nFontId = reinterpret_cast<sal_IntPtr>( rFSD.mpFontData );
@@ -424,9 +424,9 @@ ServerFont* FreetypeManager::CreateFont( const FontSelectPattern& rFSD )
return pNew;
}
-ImplFTSFontData::ImplFTSFontData( FtFontInfo* pFI, const ImplFontAttributes& rDFA )
+ImplFTSFontData::ImplFTSFontData( FreetypeFontInfo* pFI, const ImplFontAttributes& rDFA )
: PhysicalFontFace( rDFA ),
- mpFtFontInfo( pFI )
+ mpFreetypeFontInfo( pFI )
{
SetBuiltInFontFlag( false );
SetOrientationFlag( true );
@@ -440,7 +440,7 @@ ImplFontEntry* ImplFTSFontData::CreateFontInstance( FontSelectPattern& rFSD ) co
// ServerFont
-ServerFont::ServerFont( const FontSelectPattern& rFSD, FtFontInfo* pFI )
+ServerFont::ServerFont( const FontSelectPattern& rFSD, FreetypeFontInfo* pFI )
: maGlyphList( 0),
maFontSelData(rFSD),
mnRefCount(1),
@@ -976,7 +976,7 @@ const FontCharMapPtr ServerFont::GetFontCharMap() const
return pFCMap;
}
-const FontCharMapPtr FtFontInfo::GetFontCharMap()
+const FontCharMapPtr FreetypeFontInfo::GetFontCharMap()
{
// check if the charmap is already cached
if( mpFontCharMap )
@@ -1000,7 +1000,7 @@ const FontCharMapPtr FtFontInfo::GetFontCharMap()
}
// TODO: merge into method GetFontCharMap()
-bool FtFontInfo::GetFontCodeRanges( CmapResult& rResult ) const
+bool FreetypeFontInfo::GetFontCodeRanges( CmapResult& rResult ) const
{
rResult.mbSymbolic = IsSymbolFont();
diff --git a/vcl/generic/glyphs/gcach_ftyp.hxx b/vcl/generic/glyphs/gcach_ftyp.hxx
index 32777770db03..acd74ec36263 100644
--- a/vcl/generic/glyphs/gcach_ftyp.hxx
+++ b/vcl/generic/glyphs/gcach_ftyp.hxx
@@ -28,13 +28,13 @@
class GraphiteFaceWrapper;
#endif
-// FtFontFile has the responsibility that a font file is only mapped once.
+// FreetypeFontFile has the responsibility that a font file is only mapped once.
// (#86621#) the old directly ft-managed solution caused it to be mapped
// in up to nTTC*nSizes*nOrientation*nSynthetic times
-class FtFontFile
+class FreetypeFontFile
{
public:
- static FtFontFile* FindFontFile( const OString& rNativeFileName );
+ static FreetypeFontFile* FindFontFile( const OString& rNativeFileName );
bool Map();
void Unmap();
@@ -45,7 +45,7 @@ public:
int GetLangBoost() const { return mnLangBoost; }
private:
- explicit FtFontFile( const OString& rNativeFileName );
+ explicit FreetypeFontFile( const OString& rNativeFileName );
const OString maNativeFileName;
unsigned char* mpFileMap;
@@ -54,14 +54,14 @@ private:
int mnLangBoost;
};
-// FtFontInfo corresponds to an unscaled font face
-class FtFontInfo
+// FreetypeFontInfo corresponds to an unscaled font face
+class FreetypeFontInfo
{
public:
- FtFontInfo( const ImplFontAttributes&,
+ FreetypeFontInfo( const ImplFontAttributes&,
const OString& rNativeFileName,
int nFaceNum, sal_IntPtr nFontId);
- ~FtFontInfo();
+ ~FreetypeFontInfo();
const unsigned char* GetTable( const char*, sal_uLong* pLength=nullptr ) const;
@@ -86,7 +86,7 @@ public:
private:
FT_FaceRec_* maFaceFT;
- FtFontFile* mpFontFile;
+ FreetypeFontFile* mpFontFile;
const int mnFaceNum;
int mnRefCount;
#if ENABLE_GRAPHITE
@@ -108,7 +108,7 @@ private:
// these two inlines are very important for performance
-inline int FtFontInfo::GetGlyphIndex( sal_UCS4 cChar ) const
+inline int FreetypeFontInfo::GetGlyphIndex( sal_UCS4 cChar ) const
{
if( !mpChar2Glyph )
return -1;
@@ -118,7 +118,7 @@ inline int FtFontInfo::GetGlyphIndex( sal_UCS4 cChar ) const
return it->second;
}
-inline void FtFontInfo::CacheGlyphIndex( sal_UCS4 cChar, int nIndex ) const
+inline void FreetypeFontInfo::CacheGlyphIndex( sal_UCS4 cChar, int nIndex ) const
{
if( !mpChar2Glyph )
InitHashes();
@@ -140,7 +140,7 @@ public:
ServerFont* CreateFont( const FontSelectPattern& );
private:
- typedef std::unordered_map<sal_IntPtr,FtFontInfo*> FontList;
+ typedef std::unordered_map<sal_IntPtr,FreetypeFontInfo*> FontList;
FontList maFontList;
sal_IntPtr mnMaxFontId;
@@ -149,14 +149,14 @@ private:
class ImplFTSFontData : public PhysicalFontFace
{
private:
- FtFontInfo* mpFtFontInfo;
+ FreetypeFontInfo* mpFreetypeFontInfo;
public:
- ImplFTSFontData( FtFontInfo*, const ImplFontAttributes& );
+ ImplFTSFontData( FreetypeFontInfo*, const ImplFontAttributes& );
virtual ImplFontEntry* CreateFontInstance( FontSelectPattern& ) const override;
virtual PhysicalFontFace* Clone() const override { return new ImplFTSFontData( *this ); }
- virtual sal_IntPtr GetFontId() const override { return mpFtFontInfo->GetFontId(); }
+ virtual sal_IntPtr GetFontId() const override { return mpFreetypeFontInfo->GetFontId(); }
};
#endif // INCLUDED_VCL_GENERIC_GLYPHS_GCACH_FTYP_HXX