From b6db663269201fa14a6a4aa1b9042645a9e8f859 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 24 May 2019 23:45:58 +0800 Subject: ... --- src/win/graph/win_font.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/win/graph/win_font.cpp') diff --git a/src/win/graph/win_font.cpp b/src/win/graph/win_font.cpp index 96983d3e..a359d73e 100644 --- a/src/win/graph/win_font.cpp +++ b/src/win/graph/win_font.cpp @@ -1,22 +1,23 @@ #include "cru/win/graph/win_font.hpp" #include "cru/win/exception.hpp" -#include "cru/win/graph/graph_manager.hpp" +#include "cru/win/graph/win_native_factory.hpp" #include #include #include namespace cru::win::graph { -WinFontDescriptor::WinFontDescriptor(GraphManager* graph_manager, +WinFontDescriptor::WinFontDescriptor(IWinNativeFactory* factory, const std::wstring_view& font_family, float font_size) { - assert(graph_manager); + assert(factory); std::array buffer; - if (!::GetUserDefaultLocaleName(buffer.data(), static_cast(buffer.size()))) + if (!::GetUserDefaultLocaleName(buffer.data(), + static_cast(buffer.size()))) throw Win32Error(::GetLastError(), "Failed to get locale."); - ThrowIfFailed(graph_manager->GetDWriteFactory()->CreateTextFormat( + ThrowIfFailed(factory->GetDWriteFactory()->CreateTextFormat( font_family.data(), nullptr, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, font_size, buffer.data(), &text_format_)); -- cgit v1.2.3