diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2016-12-16 09:16:29 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2016-12-16 14:57:14 +0000 |
commit | ab291ac3b8576a086cab60ffb64d60b046a271a2 (patch) | |
tree | de045d7164a5e0650b7ddb0982f16db32c0cfb6a /vcl/win/gdi | |
parent | 54c401d775c15e39d4939342ef2132132873ccf1 (diff) |
tdf#104159: Fix caching glyphs of non-UI fonts
Partially reverts "tdf#103725: Fix horizontal scaling on Windows",
which didn't work on newer Windows versions anyway.
This reverts commit a5750d92b2136d60d698b41ef5760f2efac0ffce.
Change-Id: Ia4bb426a21804517d3ec313ab7494ba121c5751b
Reviewed-on: https://gerrit.libreoffice.org/32068
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl/win/gdi')
-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 57ac16f8f8d6..b60ce1b4a54f 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -496,19 +496,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) { @@ -518,6 +508,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; |