diff options
Diffstat (limited to 'vcl/win/gdi/winlayout.cxx')
-rw-r--r-- | vcl/win/gdi/winlayout.cxx | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 2d351758b2c6..cefe4b1b9edc 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -3341,19 +3341,9 @@ std::vector<Rectangle> D2DWriteTextOutRenderer::GetGlyphInkBoxes(uint16_t * pGid bool D2DWriteTextOutRenderer::GetDWriteFaceFromHDC(HDC hDC, IDWriteFontFace ** ppFontFace, float * lfSize) const { bool succeeded = false; - IDWriteFont* pFont; - - LOGFONTW aLogFont; - HFONT hFont = static_cast<HFONT>(::GetCurrentObject(hDC, OBJ_FONT)); - GetObjectW(hFont, sizeof(LOGFONTW), &aLogFont); try { - succeeded = SUCCEEDED(mpGdiInterop->CreateFontFromLOGFONT(&aLogFont, &pFont)); - if (succeeded) - { - succeeded = SUCCEEDED(pFont->CreateFontFace(ppFontFace)); - pFont->Release(); - } + succeeded = SUCCEEDED(mpGdiInterop->CreateFontFaceFromHdc(hDC, ppFontFace)); } catch (const std::exception& e) { @@ -3363,6 +3353,10 @@ bool D2DWriteTextOutRenderer::GetDWriteFaceFromHDC(HDC hDC, IDWriteFontFace ** p if (succeeded) { + LOGFONTW aLogFont; + HFONT hFont = static_cast<HFONT>(::GetCurrentObject(hDC, OBJ_FONT)); + + GetObjectW(hFont, sizeof(LOGFONTW), &aLogFont); float dpix, dpiy; mpRT->GetDpi(&dpix, &dpiy); *lfSize = aLogFont.lfHeight * 96.0f / dpiy; |