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 FamilyName & GetFamilyName () const ynothrow
 
FontCache & GetCache () const ynothrow
 
const FontFamily & GetFontFamily () 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
 
Typeface & GetTypeface () 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.h 第 438 行定义.

构造及析构函数说明

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

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

自从
build 351

在文件 Font.h 第 457 行定义.

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.cpp 第 345 行定义.

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

函数调用图:

s8 Font::GetAscender ( ) const

取升部。

自从
build 280

在文件 Font.cpp 第 356 行定义.

参考 GetInternalInfo().

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

函数调用图:

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

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

在文件 Font.h 第 493 行定义.

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

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

s8 Font::GetDescender ( ) const

取降部。

自从
build 280

在文件 Font.cpp 第 361 行定义.

参考 GetInternalInfo().

函数调用图:

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

在文件 Font.h 第 492 行定义.

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

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

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

在文件 Font.h 第 494 行定义.

参考自 SetStyle().

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

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

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

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

在文件 Font.cpp 第 366 行定义.

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

参考自 GetAdvance().

函数调用图:

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

FontSize Font::GetHeight ( ) const

取字体对应的字符高度。

自从
build 280

在文件 Font.cpp 第 378 行定义.

参考 GetInternalInfo().

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

函数调用图:

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

FT_SizeRec & Font::GetInternalInfo ( ) const
private

取内部信息。

自从
build 280

在文件 Font.cpp 第 383 行定义.

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

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

函数调用图:

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

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

在文件 Font.h 第 495 行定义.

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

在文件 Font.h 第 496 行定义.

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

在文件 Font.h 第 513 行定义.

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

取字型引用。

自从
build 280

在文件 Font.h 第 529 行定义.

参考自 GetGlyph().

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

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

在文件 Font.h 第 468 行定义.

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

在文件 Font.h 第 469 行定义.

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

在文件 Font.h 第 471 行定义.

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

在文件 Font.h 第 470 行定义.

void Font::SetSize ( FontSize  s = DefaultSize)

设置字体大小。

在文件 Font.cpp 第 394 行定义.

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

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

函数调用图:

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

bool Font::SetStyle ( FontStyle  fs)

设置样式。

自从
build 280

在文件 Font.cpp 第 400 行定义.

参考 GetFontFamily() , 以及 scaler.

函数调用图:

类成员变量说明

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

在文件 Font.h 第 441 行定义.

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

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

在文件 Font.h 第 442 行定义.

参考自 SetSize().

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

在文件 Font.h 第 442 行定义.

参考自 SetSize().

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

在文件 Font.h 第 445 行定义.

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

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

字体样式。

自从
build 297

在文件 Font.h 第 450 行定义.


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