YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
YSLib::Drawing::FontCache类 参考final

字体缓存。 更多...

#include <Font.h>

类 YSLib::Drawing::FontCache 继承关系图:
YSLib::Drawing::FontCache 的协作图:

Public 类型

using FaceSet = set< Typeface *, ystdex::deref_comp< const Typeface >>
 
using FamilyMap = unordered_map< FamilyName, unique_ptr< FontFamily >>
 字型家族组索引类型。 更多...
 

Public 成员函数

 FontCache (size_t=DefaultGlyphCacheSize)
 构造:分配指定大小的字形缓存空间。 更多...
 
 ~FontCache ()
 析构:释放空间。 更多...
 
 DefGetter (const ynothrow, const FaceSet &, Faces, sFaces) DefGetter(const ynothrow
 取字型组。 更多...
 
const FamilyMap mFamilies
const FontFamily
GetFontFamilyPtr (const FamilyName &) const
 < 取字型家族组索引。 更多...
 
const TypefaceGetDefaultTypefacePtr () const
 取默认字型指针。 更多...
 
const TypefaceGetTypefacePtr (const FamilyName &, const StyleName &) const
 取指定名称的字型指针。 更多...
 
size_t LoadTypefaces (const FontPath &)
 从字体文件组中载入字型信息。 更多...
 
void InitializeDefaultTypeface ()
 初始化默认字型。 更多...
 

Public 属性

const FamilyMap FamilyIndices
 

静态 Public 属性

static yconstexpr size_t DefaultGlyphCacheSize = 128U << 10
 字形缓冲区大小。 更多...
 

Protected 属性

FaceSet sFaces
 字型组。 更多...
 
FamilyMap mFamilies
 字型家族组索引。 更多...
 
TypefacepDefaultFace
 默认字型指针。 更多...
 

Private 成员函数

void operator+= (unique_ptr< FontFamily >)
 向字型家族组添加字型家族。 更多...
 
void operator+= (Typeface &)
 向字型组添加字型对象。 更多...
 
bool operator-= (FontFamily &)
 从字型家族组中移除指定字型对象。 更多...
 
bool operator-= (Typeface &)
 从字型组中移除指定字型对象。 更多...
 
void ClearContainers ()
 清除容器。 更多...
 
- Private 成员函数 继承自 ystdex::noncopyable
 noncopyable (const noncopyable &)=delete
 禁止复制构造。 更多...
 
noncopyableoperator= (const noncopyable &)=delete
 禁止赋值复制。 更多...
 
 noncopyable ()=default
 protected 构造:默认实现。 更多...
 
 ~noncopyable ()=default
 protected 析构:默认实现。 更多...
 

Private 属性

::FT_Library library
 库实例。 更多...
 

友元

class Typeface
 
class Font
 友元类:访问 scaler 等对象。 更多...
 

详细描述

字体缓存。

自从
build 209

在文件 Font.h415 行定义.

成员类型定义说明

字型组类型。

在文件 Font.h427 行定义.

using YSLib::Drawing::FontCache::FamilyMap = unordered_map<FamilyName, unique_ptr<FontFamily>>

字型家族组索引类型。

在文件 Font.h429 行定义.

构造及析构函数说明

YSLib::Drawing::FontCache::FontCache ( size_t  = DefaultGlyphCacheSize)
explicit

构造:分配指定大小的字形缓存空间。

注解
当前暂时忽略参数。
自从
build 316

在文件 Font.cpp378 行定义.

参考 platform::Descriptions::Alert, YSLib::Drawing::error(), library, ystdex::sfmt() , 以及 YB_LIKELY.

函数调用图:

YSLib::Drawing::FontCache::~FontCache ( )

析构:释放空间。

自从
build 461

在文件 Font.cpp393 行定义.

参考 ClearContainers() , 以及 library.

函数调用图:

成员函数说明

void YSLib::Drawing::FontCache::ClearContainers ( )
private

清除容器。

在文件 Font.cpp448 行定义.

参考 delete_obj, mFamilies , 以及 sFaces.

参考自 ~FontCache().

这是这个函数的调用关系图:

YSLib::Drawing::FontCache::DefGetter ( const ynothrow  ,
const FaceSet ,
Faces  ,
sFaces   
) const

取字型组。

自从
build 281
const Typeface * YSLib::Drawing::FontCache::GetDefaultTypefacePtr ( ) const

取默认字型指针。

异常
LoggedEvent记录异常事件。
自从
build 425

在文件 Font.cpp408 行定义.

参考 YSLib::FetchDefaultFontCache(), GetDefaultTypefacePtr() , 以及 pDefaultFace.

参考自 GetDefaultTypefacePtr() , 以及 YSLib::InitializeSystemFontCache().

函数调用图:

这是这个函数的调用关系图:

const FontFamily * YSLib::Drawing::FontCache::GetFontFamilyPtr ( const FamilyName family_name) const

< 取字型家族组索引。

取指定名称的字型家族指针。

在文件 Font.cpp400 行定义.

参考 mFamilies.

参考自 GetTypefacePtr().

这是这个函数的调用关系图:

const Typeface * YSLib::Drawing::FontCache::GetTypefacePtr ( const FamilyName family_name,
const StyleName style_name 
) const

取指定名称的字型指针。

在文件 Font.cpp415 行定义.

参考 YSLib::UI::f, GetFontFamilyPtr(), YSLib::Drawing::FontFamily::GetTypefacePtr() , 以及 YB_UNLIKELY.

函数调用图:

void YSLib::Drawing::FontCache::InitializeDefaultTypeface ( )

初始化默认字型。

在文件 Font.cpp486 行定义.

参考 pDefaultFace, sFaces , 以及 YB_LIKELY.

参考自 YSLib::InitializeSystemFontCache().

这是这个函数的调用关系图:

size_t YSLib::Drawing::FontCache::LoadTypefaces ( const FontPath path)

从字体文件组中载入字型信息。

返回
成功载入的字型数。
自从
build 316

在文件 Font.cpp456 行定义.

参考 YSLib::Drawing::face, library, Typeface, platform::ufexists(), YSLib::IO::VerifyDirectory , 以及 ynew.

参考自 YSLib::InitializeSystemFontCache().

函数调用图:

这是这个函数的调用关系图:

void YSLib::Drawing::FontCache::operator+= ( unique_ptr< FontFamily p_family)
private

向字型家族组添加字型家族。

自从
build 418

在文件 Font.cpp426 行定义.

参考 mFamilies.

void YSLib::Drawing::FontCache::operator+= ( Typeface face)
private

向字型组添加字型对象。

自从
build 277

在文件 Font.cpp431 行定义.

参考 sFaces.

bool YSLib::Drawing::FontCache::operator-= ( FontFamily family)
private

从字型家族组中移除指定字型对象。

自从
build 277

在文件 Font.cpp437 行定义.

参考 mFamilies.

bool YSLib::Drawing::FontCache::operator-= ( Typeface face)
private

从字型组中移除指定字型对象。

自从
build 277

在文件 Font.cpp442 行定义.

参考 pDefaultFace , 以及 sFaces.

友元及相关函数文档

friend class Font
friend

友元类:访问 scaler 等对象。

自从
build 280

在文件 Font.h423 行定义.

friend class Typeface
friend

在文件 Font.h418 行定义.

参考自 LoadTypefaces().

类成员变量说明

yconstexpr size_t YSLib::Drawing::FontCache::DefaultGlyphCacheSize = 128U << 10
static

字形缓冲区大小。

注解
单位为字节。
自从
build 277

在文件 Font.h436 行定义.

const FamilyMap YSLib::Drawing::FontCache::FamilyIndices

在文件 Font.h467 行定义.

::FT_Library YSLib::Drawing::FontCache::library
private

库实例。

在文件 Font.h439 行定义.

参考自 FontCache(), LoadTypefaces() , 以及 ~FontCache().

FamilyMap YSLib::Drawing::FontCache::mFamilies
protected

字型家族组索引。

在文件 Font.h443 行定义.

参考自 ClearContainers(), GetFontFamilyPtr(), operator+=() , 以及 operator-=().

Typeface* YSLib::Drawing::FontCache::pDefaultFace
protected

默认字型指针。

在文件 Font.h445 行定义.

参考自 GetDefaultTypefacePtr(), InitializeDefaultTypeface() , 以及 operator-=().

FaceSet YSLib::Drawing::FontCache::sFaces
protected

字型组。

在文件 Font.h442 行定义.

参考自 ClearContainers(), InitializeDefaultTypeface(), operator+=() , 以及 operator-=().


该类的文档由以下文件生成: