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

字体:字模,包含字型、样式和大小。 更多...

#include <Font.h>

Public 成员函数

 Font ()
 默认构造:使用默认字型家族、大小和样式的字体对象。
 
 Font (const FontFamily &, FontSize=DefaultSize, FontStyle=FontStyle::Regular)
 构造:使用指定字型家族、大小和样式的字体对象。
 
bool IsBold () const ynothrow
 
bool IsItalic () const ynothrow
 
bool IsUnderline () const ynothrow
 
bool IsStrikeout () const ynothrow
 
s8 GetAdvance (ucs4_t, FTC_SBit={}) const
 取跨距。
 
s8 GetAscender () const
 取升部。
 
s8 GetDescender () const
 取降部。
 
const FamilyNameGetFamilyName () const ynothrow
 
FontCacheGetCache () const ynothrow
 
const FontFamilyGetFontFamily () const ynothrow
 
FontSize GetSize () const ynothrow
 
FontStyle Getstyle () const ynothrow
 
CharBitmap GetGlyph (ucs4_t c,::FT_UInt flags=FT_LOAD_RENDER|FT_LOAD_TARGET_NORMAL) const
 取当前字型和大小渲染的指定字符的字形。
 
FontSize GetHeight () const ynothrow
 取字体对应的字符高度。
 
StyleName GetStyleName () const ynothrow
 
TypefaceGetTypeface () const ynothrow
 取字型引用。
 
void SetSize (FontSize=DefaultSize)
 设置字体大小。
 
bool SetStyle (FontStyle)
 设置样式。
 

静态 Public 属性

static yconstexpr FontSize DefaultSize = 12
 
static yconstexpr FontSize MinimalSize = 4
 
static yconstexpr FontSize MaximalSize = 96
 

Private 成员函数

::FT_SizeRec & GetInternalInfo () const
 取内部信息。
 

Private 属性

mutable::FTC_ScalerRec scaler
 
FontStyle style
 字体样式。
 

详细描述

字体:字模,包含字型、样式和大小。

警告
非虚析构。
自从
build 145

在文件 Font.h438 行定义.

构造及析构函数说明

YSLib::Drawing::Font::Font ( )
inline

默认构造:使用默认字型家族、大小和样式的字体对象。

自从
build 351

在文件 Font.h457 行定义.

YSLib::Drawing::Font::Font ( const FontFamily ,
FontSize  = DefaultSize,
FontStyle  = FontStyle::Regular 
)
explicit

构造:使用指定字型家族、大小和样式的字体对象。

自从
build 351

成员函数说明

s8 Font::GetAdvance ( ucs4_t  c,
FTC_SBit  sbit = {} 
) const

取跨距。

自从
build 280

在文件 Font.cpp345 行定义.

参考 GetGlyph(),YB_LIKELY , 以及 YB_UNLIKELY.

函数调用图:

s8 Font::GetAscender ( ) const

取升部。

自从
build 280

在文件 Font.cpp356 行定义.

参考 GetInternalInfo().

参考自 YSLib::Drawing::GetTextLineBaseOf().

函数调用图:

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

FontCache& YSLib::Drawing::Font::GetCache ( ) const
inline

在文件 Font.h493 行定义.

参考自 GetGlyph() , 以及 GetInternalInfo().

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

s8 Font::GetDescender ( ) const

取降部。

自从
build 280

在文件 Font.cpp361 行定义.

参考 GetInternalInfo().

函数调用图:

const FamilyName& YSLib::Drawing::Font::GetFamilyName ( ) const
inline

在文件 Font.h492 行定义.

参考自 SettingPanel::operator<<().

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

const FontFamily& YSLib::Drawing::Font::GetFontFamily ( ) const
inline

在文件 Font.h494 行定义.

参考自 SetStyle().

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

CharBitmap Font::GetGlyph ( ucs4_t  c,
::FT_UInt  flags = FT_LOAD_RENDER | FT_LOAD_TARGET_NORMAL 
) const

取当前字型和大小渲染的指定字符的字形。

参数
c指定需要被渲染的字符。
flagsFreeType 渲染标识。
警告
flags 可能被移除,应仅用于内部实现。
自从
build 280

在文件 Font.cpp366 行定义.

参考 GetCache(),GetTypeface() , 以及 scaler.

参考自 GetAdvance().

函数调用图:

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

FontSize Font::GetHeight ( ) const

取字体对应的字符高度。

自从
build 280

在文件 Font.cpp378 行定义.

参考 GetInternalInfo().

参考自 DualScreenReader::Execute(),YSLib::Drawing::GetTextLineHeightExOf() , 以及 YSLib::Drawing::GetTextLineHeightOf().

函数调用图:

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

FT_SizeRec & Font::GetInternalInfo ( ) const
private

取内部信息。

自从
build 280

在文件 Font.cpp383 行定义.

参考 GetCache(),scaler , 以及 YB_UNLIKELY.

参考自 GetAscender(),GetDescender() , 以及 GetHeight().

函数调用图:

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

FontSize YSLib::Drawing::Font::GetSize ( ) const
inline

在文件 Font.h495 行定义.

FontStyle YSLib::Drawing::Font::Getstyle ( ) const
inline

在文件 Font.h496 行定义.

StyleName YSLib::Drawing::Font::GetStyleName ( ) const
inline

在文件 Font.h513 行定义.

Typeface& YSLib::Drawing::Font::GetTypeface ( ) const
inline

取字型引用。

自从
build 280

在文件 Font.h529 行定义.

参考自 GetGlyph().

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

bool YSLib::Drawing::Font::IsBold ( ) const
inline

在文件 Font.h468 行定义.

bool YSLib::Drawing::Font::IsItalic ( ) const
inline

在文件 Font.h469 行定义.

bool YSLib::Drawing::Font::IsStrikeout ( ) const
inline

在文件 Font.h471 行定义.

bool YSLib::Drawing::Font::IsUnderline ( ) const
inline

在文件 Font.h470 行定义.

void Font::SetSize ( FontSize  s = DefaultSize)

设置字体大小。

在文件 Font.cpp394 行定义.

参考 MaximalSize,MinimalSize,scaler,YB_LIKELY , 以及 yunseq().

参考自 YSLib::Drawing::TextRegion::InitializeFont() , 以及 DualScreenReader::SetFontSize().

函数调用图:

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

bool Font::SetStyle ( FontStyle  fs)

设置样式。

自从
build 280

在文件 Font.cpp400 行定义.

参考 GetFontFamily() , 以及 scaler.

函数调用图:

类成员变量说明

yconstexpr FontSize YSLib::Drawing::Font::DefaultSize = 12
static

在文件 Font.h441 行定义.

参考自 YSLib::Drawing::TextRegion::InitializeFont().

yconstexpr FontSize YSLib::Drawing::Font::MaximalSize = 96
static

在文件 Font.h442 行定义.

参考自 SetSize().

yconstexpr FontSize YSLib::Drawing::Font::MinimalSize = 4
static

在文件 Font.h442 行定义.

参考自 SetSize().

mutable ::FTC_ScalerRec YSLib::Drawing::Font::scaler
private

在文件 Font.h445 行定义.

参考自 GetGlyph(),GetInternalInfo(),SetSize() , 以及 SetStyle().

FontStyle YSLib::Drawing::Font::style
private

字体样式。

自从
build 297

在文件 Font.h450 行定义.


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