GraceFt v2.3
开源图形引擎 EGE(Easy Graphics Engine) 的高层封装库
 
载入中...
搜索中...
未找到
GFt::Font类 参考

字体类 更多...

#include <Font.h>

Public 成员函数

 Font (const Font &other)
 复制构造
 
 Font (const std::wstring &fontFamily, long size=literals::em(1))
 构造函数
 
 Font (Font &&other)
 移动构造
 
 ~Font ()
 
std::wstring fontFamily () const
 获取字体名称
 
bool italic () const
 获取字体是否为斜体
 
Fontoperator= (const Font &other)
 复制赋值
 
Fontoperator= (Font &&other)
 移动赋值
 
void setFontFamily (const std::wstring &fontFamily)
 设置字体名称
 
void setItalic (bool italic)
 设置字体是否为斜体
 
void setSize (long size)
 设置字体大小
 
void setStrikeOut (bool strikeOut)
 设置字体是否具有删除线
 
void setUnderline (bool underline)
 设置字体是否具有下划线
 
void setWeight (FontWeight weight)
 设置字体字重(粗细)
 
long size () const
 获取字体大小
 
bool strikeOut () const
 获取字体是否具有删除线
 
bool underline () const
 获取字体是否具有下划线
 
FontWeight weight () const
 获取字体字重(粗细)
 

友元

class Graphics
 
std::ostream & operator<< (std::ostream &os, const Font &font)
 输出流运算符重载
 

详细描述

字体类

字体类用于管理字体相关的属性,包括字体名称、大小、粗细、斜体、下划线、删除线等。

构造及析构函数说明

◆ Font() [1/3]

GFt::Font::Font ( const std::wstring & fontFamily,
long size = literals::em(1) )

构造函数

参数
fontFamily字体名称
size字体大小,默认16

◆ Font() [2/3]

GFt::Font::Font ( const Font & other)

复制构造

◆ Font() [3/3]

GFt::Font::Font ( Font && other)

移动构造

注解
对象被移动后原对象将失效, 它应该被弃置, 如果通过已被移动的对象访问其成员函数, 将引发空指针解引用(段错误)

◆ ~Font()

GFt::Font::~Font ( )

成员函数说明

◆ fontFamily()

std::wstring GFt::Font::fontFamily ( ) const

获取字体名称

◆ italic()

bool GFt::Font::italic ( ) const

获取字体是否为斜体

◆ operator=() [1/2]

Font & GFt::Font::operator= ( const Font & other)

复制赋值

◆ operator=() [2/2]

Font & GFt::Font::operator= ( Font && other)

移动赋值

注解
对象被移动后原对象将失效, 它应该被弃置, 如果通过已被移动的对象访问其成员函数, 将引发空指针解引用(段错误)

◆ setFontFamily()

void GFt::Font::setFontFamily ( const std::wstring & fontFamily)

设置字体名称

◆ setItalic()

void GFt::Font::setItalic ( bool italic)

设置字体是否为斜体

◆ setSize()

void GFt::Font::setSize ( long size)

设置字体大小

◆ setStrikeOut()

void GFt::Font::setStrikeOut ( bool strikeOut)

设置字体是否具有删除线

◆ setUnderline()

void GFt::Font::setUnderline ( bool underline)

设置字体是否具有下划线

◆ setWeight()

void GFt::Font::setWeight ( FontWeight weight)

设置字体字重(粗细)

◆ size()

long GFt::Font::size ( ) const

获取字体大小

◆ strikeOut()

bool GFt::Font::strikeOut ( ) const

获取字体是否具有删除线

◆ underline()

bool GFt::Font::underline ( ) const

获取字体是否具有下划线

◆ weight()

FontWeight GFt::Font::weight ( ) const

获取字体字重(粗细)

友元及相关符号说明

◆ Graphics

friend class Graphics
friend

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const Font & font )
friend

输出流运算符重载