LibreOffice Module vcl (master)  1
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
FreetypeManager Class Referencefinal

The FreetypeManager caches various aspects of Freetype fonts. More...

#include <glyphcache.hxx>

Public Member Functions

 ~FreetypeManager ()
 
void AddFontFile (const OString &rNormalizedName, int nFaceNum, int nVariantNum, sal_IntPtr nFontId, const FontAttributes &)
 
void AnnounceFonts (PhysicalFontCollection *) const
 
void ClearFontCache ()
 
FreetypeFontCreateFont (FreetypeFontInstance *pLogicalFont)
 

Static Public Member Functions

static FreetypeManagerget ()
 

Private Types

typedef std::unordered_map< sal_IntPtr, std::shared_ptr< FreetypeFontInfo > > FontInfoList
 
typedef std::unordered_map< const char *, std::unique_ptr< FreetypeFontFile >, rtl::CStringHash, rtl::CStringEqual > FontFileList
 

Private Member Functions

 FreetypeManager ()
 
FreetypeFontFileFindFontFile (const OString &rNativeFileName)
 

Static Private Member Functions

static void InitFreetype ()
 

Private Attributes

FontInfoList m_aFontInfoList
 
sal_IntPtr m_nMaxFontId
 
FontFileList m_aFontFileList
 

Friends

class GenericUnixSalData
 

Detailed Description

The FreetypeManager caches various aspects of Freetype fonts.

It mainly consists of two std::unordered_map lists, which hold the items of the cache.

They form kind of a tree, with FreetypeFontFile as the roots, referenced by multiple FreetypeFontInfo entries, which are referenced by the FreetypeFont items.

All of these items have reference counters, but these don't control the items life-cycle, but that of the managed resources.

The respective resources are: FreetypeFontFile = holds the mmapped font file, as long as it's used by any FreetypeFontInfo. FreetypeFontInfo = holds the FT_FaceRec_ object, as long as it's used by any FreetypeFont. FreetypeFont = holds the FT_SizeRec_ and is owned by a FreetypeFontInstance

FreetypeFontInfo therefore is embedded in the Freetype subclass of PhysicalFontFace. FreetypeFont is owned by FreetypeFontInstance, the Freetype subclass of LogicalFontInstance.

Nowadays there is not really a reason to have separate files for the classes, as the FreetypeManager is just about handling of Freetype based fonts, not some abstract glyphs.

Definition at line 74 of file glyphcache.hxx.

Member Typedef Documentation

typedef std::unordered_map<const char*, std::unique_ptr<FreetypeFontFile>, rtl::CStringHash, rtl::CStringEqual> FreetypeManager::FontFileList
private

Definition at line 101 of file glyphcache.hxx.

typedef std::unordered_map<sal_IntPtr, std::shared_ptr<FreetypeFontInfo> > FreetypeManager::FontInfoList
private

Definition at line 100 of file glyphcache.hxx.

Constructor & Destructor Documentation

FreetypeManager::~FreetypeManager ( )
FreetypeManager::FreetypeManager ( )
explicitprivate

Member Function Documentation

void FreetypeManager::AddFontFile ( const OString &  rNormalizedName,
int  nFaceNum,
int  nVariantNum,
sal_IntPtr  nFontId,
const FontAttributes  
)
void FreetypeManager::AnnounceFonts ( PhysicalFontCollection ) const
void FreetypeManager::ClearFontCache ( )
FreetypeFont* FreetypeManager::CreateFont ( FreetypeFontInstance pLogicalFont)
FreetypeFontFile* FreetypeManager::FindFontFile ( const OString &  rNativeFileName)
private
static FreetypeManager& FreetypeManager::get ( )
static
static void FreetypeManager::InitFreetype ( )
staticprivate

Friends And Related Function Documentation

friend class GenericUnixSalData
friend

Definition at line 94 of file glyphcache.hxx.

Member Data Documentation

FontFileList FreetypeManager::m_aFontFileList
private

Definition at line 106 of file glyphcache.hxx.

FontInfoList FreetypeManager::m_aFontInfoList
private

Definition at line 103 of file glyphcache.hxx.

sal_IntPtr FreetypeManager::m_nMaxFontId
private

Definition at line 104 of file glyphcache.hxx.


The documentation for this class was generated from the following file: