字体类 更多...
#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 |
| 获取字体是否为斜体 | |
| Font & | operator= (const Font &other) |
| 复制赋值 | |
| Font & | operator= (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) |
| 输出流运算符重载 | |
字体类
字体类用于管理字体相关的属性,包括字体名称、大小、粗细、斜体、下划线、删除线等。
| GFt::Font::Font | ( | const std::wstring & | fontFamily, |
| long | size = literals::em(1) ) |
构造函数
| fontFamily | 字体名称 |
| size | 字体大小,默认16 |
| GFt::Font::Font | ( | const Font & | other | ) |
复制构造
| GFt::Font::Font | ( | Font && | other | ) |
移动构造
| GFt::Font::~Font | ( | ) |
| std::wstring GFt::Font::fontFamily | ( | ) | const |
获取字体名称
| bool GFt::Font::italic | ( | ) | const |
获取字体是否为斜体
移动赋值
| void GFt::Font::setFontFamily | ( | const std::wstring & | fontFamily | ) |
设置字体名称
| void GFt::Font::setItalic | ( | bool | italic | ) |
设置字体是否为斜体
| void GFt::Font::setSize | ( | long | size | ) |
设置字体大小
| void GFt::Font::setStrikeOut | ( | bool | strikeOut | ) |
设置字体是否具有删除线
| void GFt::Font::setUnderline | ( | bool | underline | ) |
设置字体是否具有下划线
| void GFt::Font::setWeight | ( | FontWeight | weight | ) |
设置字体字重(粗细)
| long GFt::Font::size | ( | ) | const |
获取字体大小
| bool GFt::Font::strikeOut | ( | ) | const |
获取字体是否具有删除线
| bool GFt::Font::underline | ( | ) | const |
获取字体是否具有下划线
| FontWeight GFt::Font::weight | ( | ) | const |
获取字体字重(粗细)
|
friend |
|
friend |
输出流运算符重载