![]() |
Kiwano Engine
v1.2.x
|
字体 更多...
#include <Font.h>
Public 成员函数 | |
Font () | |
创建系统默认字体 | |
Font (const String &family_name, float size, uint32_t weight=FontWeight::Normal, FontPosture posture=FontPosture::Normal, FontStretch stretch=FontStretch::Normal) | |
通过字体族创建字体 更多... | |
String | GetFamilyName () const |
获取字体族 | |
float | GetSize () const |
获取字号 | |
uint32_t | GetWeight () const |
获取字体粗细值 | |
FontPosture | GetPosture () const |
获取字体形态 | |
FontStretch | GetStretch () const |
获取字体拉伸 | |
![]() | |
bool | IsValid () const override |
判断对象是否有效 | |
void * | GetNativePointer () const |
template<typename _NativeTy > | |
_NativeTy * | GetNativePointer () const |
virtual void | ResetNativePointer (void *native_pointer=nullptr) |
![]() | |
ObjectBase () | |
构造基础对象 | |
void | SetName (const String &name) |
设置对象名 | |
String | GetName () const |
获取对象名 | |
bool | IsName (const String &name) const |
判断对象的名称是否相同 更多... | |
void * | GetUserData () const |
获取用户数据 | |
void | SetUserData (void *data) |
设置用户数据 | |
uint64_t | GetObjectID () const |
获取对象ID | |
void | DoSerialize (Serializer *serializer) const override |
序列化 | |
void | DoDeserialize (Deserializer *deserializer) override |
反序列化 | |
ObjectStatus * | GetStatus () const |
获取对象状态 | |
void | SetStatus (const ObjectStatus &status) |
设置对象状态 | |
void | Fail (const String &msg, int code=ObjectStatus::fail) |
将对象标记为失败状态 | |
void | ClearStatus () |
清除对象状态 | |
![]() | |
void | Retain () |
增加引用计数 | |
void | Release () |
减少引用计数 | |
uint32_t | GetRefCount () const |
获取引用计数 | |
![]() | |
Vector< uint8_t > | Serialize () const |
序列化为字节串 | |
void | Deserialize (const Vector< uint8_t > &data) |
从字节串反序列化 | |
静态 Public 成员函数 | |
static FontPtr | Preload (const String &file) |
预加载字体 更多... | |
static FontPtr | Preload (const Resource &resource) |
预加载字体 更多... | |
![]() | |
static void | SetObjectPolicy (const ObjectPolicyFunc &policy) |
设置对象处理策略 | |
static bool | IsTracingLeaks () |
是否启用了内存泄漏追踪 | |
static void | StartTracingLeaks () |
开始追踪内存泄漏 | |
static void | StopTracingLeaks () |
停止追踪内存泄漏 | |
static void | DumpTracingObjects () |
打印所有追踪中的对象信息 | |
static Vector< ObjectBase * > & | GetTracingObjects () |
获取所有追踪中的对象 | |
![]() | |
static void * | operator new (size_t size) |
static void | operator delete (void *ptr) |
static void * | operator new (size_t size, std::nothrow_t const &) noexcept |
static void | operator delete (void *ptr, std::nothrow_t const &) noexcept |
static void * | operator new (size_t size, void *ptr) noexcept |
static void | operator delete (void *ptr, void *place) noexcept |
Protected 成员函数 | |
void | SetFamilyName (const String &name) |
获取字体族 | |
Protected 属性 | |
float | size_ |
uint32_t | weight_ |
FontPosture | posture_ |
FontStretch | stretch_ |
String | family_name_ |
![]() | |
void * | native_pointer_ |
字体
kiwano::Font::Font | ( | const String & | family_name, |
float | size, | ||
uint32_t | weight = FontWeight::Normal , |
||
FontPosture | posture = FontPosture::Normal , |
||
FontStretch | stretch = FontStretch::Normal |
||
) |
通过字体族创建字体
family_name | 字体族 |
size | 字号 |
weight | 字体粗细 |
posture | 字体形态 |
|
static |
预加载字体
file | 字体文件 |
|
static |
预加载字体
resource | 字体资源 |