22#include <kiwano/core/Resource.h>
23#include <kiwano/platform/NativeObject.hpp>
27KGE_DECLARE_SMART_PTR(Font);
95 static FontPtr
Preload(
const String& file);
159 void AddFont(
size_t key, FontPtr font);
163 void AddFontByFamily(
const String& font_family, FontPtr font);
167 FontPtr GetFont(
size_t key)
const;
171 FontPtr GetFontByFamily(
const String& font_family)
const;
175 void RemoveFont(
size_t key);
179 void RemoveFontByFamily(
const String& font_family);
190 String TransformFamily(String family)
const;
193 using FontMap = UnorderedMap<size_t, FontPtr>;
196 using FontFamilyMap = UnorderedMap<String, FontPtr>;
197 FontFamilyMap font_family_cache_;
纹理缓存
Definition: Font.h:153
Font()
创建系统默认字体
Definition: Font.cpp:87
float GetSize() const
获取字号
Definition: Font.h:207
void SetFamilyName(const String &name)
获取字体族
Definition: Font.h:227
uint32_t GetWeight() const
获取字体粗细值
Definition: Font.h:212
FontPosture GetPosture() const
获取字体形态
Definition: Font.h:217
static FontPtr Preload(const String &file)
预加载字体
Definition: Font.cpp:29
FontStretch GetStretch() const
获取字体拉伸
Definition: Font.h:222
String GetFamilyName() const
获取字体族
Definition: Font.h:202
含有本地指针的对象
Definition: NativeObject.hpp:34
资源
Definition: Resource.h:41
Definition: Singleton.h:28
FontPosture
字体形态
Definition: Font.h:61
FontStretch
字体拉伸
Definition: Font.h:72
字体粗细值
Definition: Font.h:41
Value
Definition: Font.h:43
@ Bold
加粗
Definition: Font.h:49
@ Normal
正常
Definition: Font.h:47