22 #include <kiwano/render/NativeObject.h> 23 #include <kiwano/core/Resource.h> 27 KGE_DECLARE_SMART_PTR(Font);
95 static FontPtr Preload(
const String& file);
100 static FontPtr Preload(
const Resource& resource);
117 String GetFamilyName()
const;
121 float GetSize()
const;
125 uint32_t GetWeight()
const;
138 void SetFamilyName(
const String& name);
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: Resource.h:40
含有本地指针的对象
Definition: NativeObject.h:42
void SetFamilyName(const String &name)
获取字体族
Definition: Font.h:227
FontPosture
字体形态
Definition: Font.h:60
FontStretch
字体拉伸
Definition: Font.h:71
Definition: Singleton.h:27
float GetSize() const
获取字号
Definition: Font.h:207
字体粗细值
Definition: Font.h:40
uint32_t GetWeight() const
获取字体粗细值
Definition: Font.h:212
FontPosture GetPosture() const
获取字体形态
Definition: Font.h:217
Value
Definition: Font.h:42
FontStretch GetStretch() const
获取字体拉伸
Definition: Font.h:222
纹理缓存
Definition: Font.h:152
String GetFamilyName() const
获取字体族
Definition: Font.h:202