LibreOffice Module vcl (master) 1
|
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 () |
FreetypeFont * | CreateFont (FreetypeFontInstance *pLogicalFont) |
Static Public Member Functions | |
static FreetypeManager & | get () |
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 () | |
FreetypeFontFile * | FindFontFile (const OString &rNativeFileName) |
Static Private Member Functions | |
static void | InitFreetype () |
Private Attributes | |
FontInfoList | m_aFontInfoList |
FontFileList | m_aFontFileList |
Friends | |
class | GenericUnixSalData |
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.
|
private |
Definition at line 105 of file glyphcache.hxx.
|
private |
Definition at line 104 of file glyphcache.hxx.
FreetypeManager::~FreetypeManager | ( | ) |
|
explicitprivate |
void FreetypeManager::AddFontFile | ( | const OString & | rNormalizedName, |
int | nFaceNum, | ||
int | nVariantNum, | ||
sal_IntPtr | nFontId, | ||
const FontAttributes & | |||
) |
void FreetypeManager::AnnounceFonts | ( | vcl::font::PhysicalFontCollection * | ) | const |
void FreetypeManager::ClearFontCache | ( | ) |
FreetypeFont * FreetypeManager::CreateFont | ( | FreetypeFontInstance * | pLogicalFont | ) |
|
private |
|
static |
|
staticprivate |
|
friend |
Definition at line 98 of file glyphcache.hxx.
|
private |
Definition at line 109 of file glyphcache.hxx.
|
private |
Definition at line 107 of file glyphcache.hxx.