Kaydet (Commit) ab291ac3 authored tarafından Khaled Hosny's avatar Khaled Hosny

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 a5750d92.

Change-Id: Ia4bb426a21804517d3ec313ab7494ba121c5751b
Reviewed-on: https://gerrit.libreoffice.org/32068Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKhaled Hosny <khaledhosny@eglug.org>
üst 54c401d7
......@@ -19,6 +19,7 @@
#include "CommonSalLayout.hxx"
#include <vcl/opengl/OpenGLHelper.hxx>
#include <vcl/unohelp.hxx>
#include <scrptrun.h>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
......@@ -195,7 +196,7 @@ CommonSalLayout::CommonSalLayout(HDC hDC, WinFontInstance& rWinFontInstance, con
}
// Calculate the mnAveWidthFactor, see the comment where it is used.
if (mrFontSelData.mnWidth)
if (mrFontSelData.mnWidth && ! OpenGLHelper::isVCLOpenGLEnabled())
{
double nUPEM = hb_face_get_upem(hb_font_get_face(mpHbFont));
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment