YSTest
PreAlpha_b400_20130424
The YSLib Test Project
|
字体缓存。 更多...
#include <Font.h>
Public 类型 | |
typedef set< Typeface *, ystdex::deref_comp< const Typeface > > | FaceSet |
字型组类型。 | |
typedef map< FamilyName, FontFamily * > | FamilyMap |
字型家族组索引类型。 | |
Public 成员函数 | |
FontCache (size_t=DefaultGlyphCacheSize) | |
构造:分配指定大小的字形缓存空间。 | |
~FontCache () | |
析构:释放空间。 | |
const FaceSet & | GetFaces () const ynothrow |
取字型组。 | |
const FamilyMap & | GetFamilyIndices () const ynothrow |
取字型家族组索引。 | |
const FontFamily * | GetFontFamilyPtr (const FamilyName &) const |
取指定名称的字型家族指针。 | |
const Typeface * | GetDefaultTypefacePtr () const ythrow(LoggedEvent) |
取默认字型指针。 | |
const Typeface * | GetTypefacePtr (const FamilyName &, const StyleName &) const |
取指定名称的字型指针。 | |
void | ClearCache () |
清除缓存。 | |
size_t | LoadTypefaces (const FontPath &) |
从字体文件组中载入字型信息。 | |
void | InitializeDefaultTypeface () |
初始化默认字型。 | |
void | ResetGlyphCache () |
静态 Public 属性 | |
static yconstexpr size_t | DefaultGlyphCacheSize = 128U << 10 |
字形缓冲区大小。 | |
Protected 属性 | |
FaceSet | sFaces |
字型组。 | |
FamilyMap | mFamilies |
字型家族组索引。 | |
Typeface * | pDefaultFace |
默认字型指针。 | |
Private 成员函数 | |
::FT_Face | GetNativeFace (Typeface *) const |
取当前本机类型字型。 | |
void | operator+= (FontFamily &) |
向字型家族组添加字型对象。 | |
void | operator+= (Typeface &) |
向字型组添加字型对象。 | |
bool | operator-= (FontFamily &) |
从字型家族组中移除指定字型对象。 | |
bool | operator-= (Typeface &) |
从字型组中移除指定字型对象。 | |
void | ClearContainers () |
清除容器。 | |
void | LoadTypeface (const FontPath &, size_t) ynothrow |
从指定路径的字体文件中载入指定索引指定的字型信息。 | |
![]() | |
noncopyable (const noncopyable &)=delete | |
禁止复制构造。 | |
noncopyable & | operator= (const noncopyable &)=delete |
禁止赋值复制。 | |
noncopyable ()=default | |
protected 构造:默认实现。 | |
~noncopyable ()=default | |
protected 析构:默认实现。 | |
Private 属性 | |
::FT_Library | library |
库实例。 | |
::FTC_Manager | manager |
内存管理器实例。 | |
::FTC_CMapCache | cmapCache |
::FTC_SBitCache | sbitCache |
友元 | |
class | Typeface |
class | Font |
友元类:访问 scaler 等对象。 | |
typedef set<Typeface*, ystdex::deref_comp<const Typeface> > YSLib::Drawing::FontCache::FaceSet |
typedef map<FamilyName, FontFamily*> YSLib::Drawing::FontCache::FamilyMap |
|
explicit |
构造:分配指定大小的字形缓存空间。
参考 cmapCache,library,manager,sbitCache,ystdex::sfmt(),simpleFaceRequester() , 以及 YB_LIKELY.
FontCache::~FontCache | ( | ) |
void FontCache::ClearCache | ( | ) |
|
private |
清除容器。
参考 delete_obj,delete_second_mem,mFamilies , 以及 sFaces.
参考自 ClearCache() , 以及 ~FontCache().
const Typeface * FontCache::GetDefaultTypefacePtr | ( | ) | const |
|
inline |
|
inline |
const FontFamily * FontCache::GetFontFamilyPtr | ( | const FamilyName & | family_name | ) | const |
|
private |
const Typeface * FontCache::GetTypefacePtr | ( | const FamilyName & | family_name, |
const StyleName & | style_name | ||
) | const |
取指定名称的字型指针。
参考 GetFontFamilyPtr(),YSLib::Drawing::FontFamily::GetTypefacePtr() , 以及 YB_UNLIKELY.
void FontCache::InitializeDefaultTypeface | ( | ) |
|
private |
size_t FontCache::LoadTypefaces | ( | const FontPath & | path | ) |
从字体文件组中载入字型信息。
参考 ystdex::fexists(),YSLib::IO::GetFileNameOf(),library , 以及 LoadTypeface().
|
private |
向字型家族组添加字型对象。
|
private |
向字型组添加字型对象。
|
private |
从字型家族组中移除指定字型对象。
|
private |
从字型组中移除指定字型对象。
|
private |
参考自 FontCache().
|
static |
|
private |
|
private |
内存管理器实例。
参考自 ClearCache(),FontCache(),GetNativeFace(),YSLib::Drawing::Typeface::Typeface() , 以及 ~FontCache().
|
protected |
字型家族组索引。
参考自 ClearContainers(),GetFontFamilyPtr() , 以及 YSLib::Drawing::Typeface::Typeface().
|
protected |
|
private |
参考自 FontCache().
|
protected |