YSTest
PreAlpha_b400_20130424
The YSLib Test Project
|
字体:字模,包含字型、样式和大小。 更多...
#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 |
字体样式。 | |
|
explicit |
构造:使用指定字型家族、大小和样式的字体对象。
s8 Font::GetAdvance | ( | ucs4_t | c, |
FTC_SBit | sbit = {} |
||
) | const |
s8 Font::GetAscender | ( | ) | const |
|
inline |
s8 Font::GetDescender | ( | ) | const |
|
inline |
|
inline |
CharBitmap Font::GetGlyph | ( | ucs4_t | c, |
::FT_UInt | flags = FT_LOAD_RENDER | FT_LOAD_TARGET_NORMAL |
||
) | const |
取当前字型和大小渲染的指定字符的字形。
c | 指定需要被渲染的字符。 |
flags | FreeType 渲染标识。 |
参考 GetCache(),GetTypeface() , 以及 scaler.
参考自 GetAdvance().
FontSize Font::GetHeight | ( | ) | const |
取字体对应的字符高度。
参考自 DualScreenReader::Execute(),YSLib::Drawing::GetTextLineHeightExOf() , 以及 YSLib::Drawing::GetTextLineHeightOf().
|
private |
取内部信息。
参考 GetCache(),scaler , 以及 YB_UNLIKELY.
参考自 GetAscender(),GetDescender() , 以及 GetHeight().
|
inline |
void Font::SetSize | ( | FontSize | s = DefaultSize | ) |
设置字体大小。
参考 MaximalSize,MinimalSize,scaler,YB_LIKELY , 以及 yunseq().
参考自 YSLib::Drawing::TextRegion::InitializeFont() , 以及 DualScreenReader::SetFontSize().
bool Font::SetStyle | ( | FontStyle | fs | ) |
|
static |
|
static |
|
static |
|
private |
参考自 GetGlyph(),GetInternalInfo(),SetSize() , 以及 SetStyle().