aboutsummaryrefslogtreecommitdiff
path: root/src/platform/graphics/direct2d/Font.cpp
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-11-15 16:43:25 +0800
committerYuqian Yang <crupest@crupest.life>2025-11-16 00:01:49 +0800
commit246eb9266b9349b44cbe96f3f839124ab30cbb89 (patch)
tree31604c8a4764d3a601d56599e56c98d91bd97758 /src/platform/graphics/direct2d/Font.cpp
parentb92aa78ac19476049ab881b49c51b1a970a4a973 (diff)
downloadcru-246eb9266b9349b44cbe96f3f839124ab30cbb89.tar.gz
cru-246eb9266b9349b44cbe96f3f839124ab30cbb89.tar.bz2
cru-246eb9266b9349b44cbe96f3f839124ab30cbb89.zip
Impl win subprocess.
Diffstat (limited to 'src/platform/graphics/direct2d/Font.cpp')
-rw-r--r--src/platform/graphics/direct2d/Font.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/platform/graphics/direct2d/Font.cpp b/src/platform/graphics/direct2d/Font.cpp
index 50f7c266..18a4a2c7 100644
--- a/src/platform/graphics/direct2d/Font.cpp
+++ b/src/platform/graphics/direct2d/Font.cpp
@@ -16,13 +16,13 @@ DWriteFont::DWriteFont(DirectGraphicsFactory* factory, std::string font_family,
throw platform::win::Win32Error(
::GetLastError(), "Failed to get locale when create dwrite font.");
- ThrowIfFailed(factory->GetDWriteFactory()->CreateTextFormat(
+ CheckHResult(factory->GetDWriteFactory()->CreateTextFormat(
string::ToUtf16(font_family_).c_str(), nullptr, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, font_size,
buffer.data(), &text_format_));
- ThrowIfFailed(text_format_->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
- ThrowIfFailed(
+ CheckHResult(text_format_->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
+ CheckHResult(
text_format_->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR));
}