aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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