diff options
author | crupest <crupest@outlook.com> | 2019-05-24 23:45:58 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-05-24 23:45:58 +0800 |
commit | b6db663269201fa14a6a4aa1b9042645a9e8f859 (patch) | |
tree | 1984e2c2784fb9623d4c20fbdd6fc650792e133c /src/win/graph/win_font.cpp | |
parent | b9df1bcaea0c19b2e29479cdb1ad5a39e23c4ee7 (diff) | |
download | cru-b6db663269201fa14a6a4aa1b9042645a9e8f859.tar.gz cru-b6db663269201fa14a6a4aa1b9042645a9e8f859.tar.bz2 cru-b6db663269201fa14a6a4aa1b9042645a9e8f859.zip |
...
Diffstat (limited to 'src/win/graph/win_font.cpp')
-rw-r--r-- | src/win/graph/win_font.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
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 <array> #include <cassert> #include <utility> 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<wchar_t, LOCALE_NAME_MAX_LENGTH> buffer; - if (!::GetUserDefaultLocaleName(buffer.data(), static_cast<int>(buffer.size()))) + if (!::GetUserDefaultLocaleName(buffer.data(), + static_cast<int>(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_)); |