summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2016-12-16 09:16:29 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2016-12-16 21:37:06 +0000
commita813623240ac9614c8b2b8b890b9eb83663c72c1 (patch)
tree2d257285b6918a7ffe8a2e39ccc6a744a5e5d6f1 /vcl/win
parent83675eeb30c92a17dd272894df34b89628de0142 (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. Reviewed-on: https://gerrit.libreoffice.org/32068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> (cherry picked from commit ab291ac3b8576a086cab60ffb64d60b046a271a2) Change-Id: Ia4bb426a21804517d3ec313ab7494ba121c5751b Reviewed-on: https://gerrit.libreoffice.org/32094 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/gdi/winlayout.cxx16
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;