aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/mapper/FontMapper.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-27 21:37:38 +0800
committercrupest <crupest@outlook.com>2022-01-27 21:37:38 +0800
commit103bcb137273729a0f23ff3771e26150a64454ba (patch)
tree5d75e869cc4b1bf0f2afdfbc9ed5ff0f78e0d030 /include/cru/ui/mapper/FontMapper.hpp
parent560c0ead613658a2b7444907c3d1d69e49be8c32 (diff)
downloadcru-103bcb137273729a0f23ff3771e26150a64454ba.tar.gz
cru-103bcb137273729a0f23ff3771e26150a64454ba.tar.bz2
cru-103bcb137273729a0f23ff3771e26150a64454ba.zip
...
Diffstat (limited to 'include/cru/ui/mapper/FontMapper.hpp')
-rw-r--r--include/cru/ui/mapper/FontMapper.hpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/cru/ui/mapper/FontMapper.hpp b/include/cru/ui/mapper/FontMapper.hpp
new file mode 100644
index 00000000..ad8c43b5
--- /dev/null
+++ b/include/cru/ui/mapper/FontMapper.hpp
@@ -0,0 +1,19 @@
+#pragma once
+#include "Mapper.hpp"
+#include "cru/common/Base.hpp"
+#include "cru/platform/graphics/Font.hpp"
+
+namespace cru::ui::mapper {
+class FontMapper : public BasicRefMapper<platform::graphics::IFont> {
+ public:
+ CRU_DEFAULT_CONSTRUCTOR_DESTRUCTOR(FontMapper)
+
+ public:
+ bool SupportMapFromXml() override { return true; }
+ bool XmlElementIsOfThisType(xml::XmlElementNode* node) override;
+
+ protected:
+ std::shared_ptr<platform::graphics::IFont> DoMapFromXml(
+ xml::XmlElementNode* node) override;
+};
+} // namespace cru::ui::mapper