diff options
| author | crupest <crupest@outlook.com> | 2019-06-27 15:29:13 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2019-06-27 15:29:13 +0800 |
| commit | 8c5b05bcfce96495b4ffc4209ab8feda12597729 (patch) | |
| tree | a0a8bc99d8ffb42dc231696a4e4dfd1e7607eea0 /src/win/graph/direct/font.cpp | |
| parent | baa7cf141b8121473edceae16c1a20a6d47bd202 (diff) | |
| download | cru-8c5b05bcfce96495b4ffc4209ab8feda12597729.tar.gz cru-8c5b05bcfce96495b4ffc4209ab8feda12597729.tar.bz2 cru-8c5b05bcfce96495b4ffc4209ab8feda12597729.zip | |
...
Diffstat (limited to 'src/win/graph/direct/font.cpp')
| -rw-r--r-- | src/win/graph/direct/font.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/win/graph/direct/font.cpp b/src/win/graph/direct/font.cpp index a359d73e..5d7b4483 100644 --- a/src/win/graph/direct/font.cpp +++ b/src/win/graph/direct/font.cpp @@ -1,21 +1,20 @@ -#include "cru/win/graph/win_font.hpp" +#include "cru/win/graph/direct/font.hpp" #include "cru/win/exception.hpp" -#include "cru/win/graph/win_native_factory.hpp" +#include "cru/win/graph/direct/exception.hpp" #include <array> #include <cassert> #include <utility> -namespace cru::win::graph { -WinFontDescriptor::WinFontDescriptor(IWinNativeFactory* factory, - const std::wstring_view& font_family, - float font_size) { +namespace cru::platform::graph::win::direct { +DWriteFont::DWriteFont(IDirectFactory* factory, + const std::wstring_view& font_family, float font_size) { assert(factory); std::array<wchar_t, LOCALE_NAME_MAX_LENGTH> buffer; if (!::GetUserDefaultLocaleName(buffer.data(), static_cast<int>(buffer.size()))) - throw Win32Error(::GetLastError(), "Failed to get locale."); + throw platform::win::Win32Error(::GetLastError(), "Failed to get locale."); ThrowIfFailed(factory->GetDWriteFactory()->CreateTextFormat( font_family.data(), nullptr, DWRITE_FONT_WEIGHT_NORMAL, @@ -26,4 +25,4 @@ WinFontDescriptor::WinFontDescriptor(IWinNativeFactory* factory, ThrowIfFailed( text_format_->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER)); } -} // namespace cru::win::graph +} // namespace cru::platform::graph::win::direct |
