aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-04-04 15:43:09 +0800
committercrupest <crupest@outlook.com>2019-04-04 15:43:09 +0800
commitfcaf471275a67d718887430ee63a53890915c4c7 (patch)
tree4ef45647b01f7f325aac5c836b9ca7d3b985a751 /src
parentdcd866074615ba357b62b6128f1c64d56ed4ad16 (diff)
downloadcru-fcaf471275a67d718887430ee63a53890915c4c7.tar.gz
cru-fcaf471275a67d718887430ee63a53890915c4c7.tar.bz2
cru-fcaf471275a67d718887430ee63a53890915c4c7.zip
...
Diffstat (limited to 'src')
-rw-r--r--src/platform_win/win_graph_factory.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/platform_win/win_graph_factory.cpp b/src/platform_win/win_graph_factory.cpp
index b21c58d5..03031b32 100644
--- a/src/platform_win/win_graph_factory.cpp
+++ b/src/platform_win/win_graph_factory.cpp
@@ -4,9 +4,12 @@
#include "cru/platform/win/exception.hpp"
#include "cru/platform/win/graph_manager.hpp"
#include "cru/platform/win/win_brush.hpp"
+#include "cru/platform/win/win_font.hpp"
#include "cru/platform/win/win_geometry.hpp"
+#include "cru/platform/win/win_text_layout.hpp"
#include <cassert>
+#include <utility>
namespace cru::platform::win {
WinGraphFactory::WinGraphFactory(GraphManager* graph_manager) {
@@ -28,4 +31,16 @@ GeometryBuilder* WinGraphFactory::CreateGeometryBuilder() {
graph_manager_->GetD2D1Factory()->CreatePathGeometry(&geometry));
return new WinGeometryBuilder(std::move(geometry));
}
+
+FontDescriptor* WinGraphFactory::CreateFontDescriptor(
+ const std::wstring_view& font_family, float font_size) {
+ return new WinFontDescriptor(graph_manager_, font_family, font_size);
+}
+
+TextLayout* WinGraphFactory::CreateTextLayout(
+ std::shared_ptr<FontDescriptor> font, std::wstring text) {
+ const auto f = std::dynamic_pointer_cast<WinFontDescriptor>(font);
+ assert(f);
+ return new WinTextLayout(graph_manager_, std::move(f), std::move(text));
+}
} // namespace cru::platform::win