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 (vcl::font::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
 
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 78 of file glyphcache.hxx.

Member Typedef Documentation

◆ FontFileList

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

Definition at line 105 of file glyphcache.hxx.

◆ FontInfoList

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

Definition at line 104 of file glyphcache.hxx.

Constructor & Destructor Documentation

◆ ~FreetypeManager()

FreetypeManager::~FreetypeManager ( )

◆ FreetypeManager()

FreetypeManager::FreetypeManager ( )
explicitprivate

Member Function Documentation

◆ AddFontFile()

void FreetypeManager::AddFontFile ( const OString &  rNormalizedName,
int  nFaceNum,
int  nVariantNum,
sal_IntPtr  nFontId,
const FontAttributes  
)

◆ AnnounceFonts()

void FreetypeManager::AnnounceFonts ( vcl::font::PhysicalFontCollection ) const

◆ ClearFontCache()

void FreetypeManager::ClearFontCache ( )

◆ CreateFont()

FreetypeFont * FreetypeManager::CreateFont ( FreetypeFontInstance pLogicalFont)

◆ FindFontFile()

FreetypeFontFile * FreetypeManager::FindFontFile ( const OString &  rNativeFileName)
private

◆ get()

static FreetypeManager & FreetypeManager::get ( )
static

◆ InitFreetype()

static void FreetypeManager::InitFreetype ( )
staticprivate

Friends And Related Function Documentation

◆ GenericUnixSalData

friend class GenericUnixSalData
friend

Definition at line 98 of file glyphcache.hxx.

Member Data Documentation

◆ m_aFontFileList

FontFileList FreetypeManager::m_aFontFileList
private

Definition at line 109 of file glyphcache.hxx.

◆ m_aFontInfoList

FontInfoList FreetypeManager::m_aFontInfoList
private

Definition at line 107 of file glyphcache.hxx.


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