vcl/win/gdi/salfont.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit a8d677035a6565ebc051375206786dab3a353578 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Mon Aug 19 11:06:36 2024 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Mon Aug 19 16:00:22 2024 +0200 Make sure to anti-alias fonts on Windows, when required GetUseFontAAFromSystem was introduced to make sure that texts in generated raster file match the requested antialiasing selection, not system display settings (VCL plugins usually render text according to system settings for screen display, even when lines are not anti-aliased). The use case there was disabling antialiasing, to produce clear output in tests - see commit e6538f5bdd876911ea30f84a6512c03908e620fd tdf#118966 vcl: add a flag to determine if AA of fonts is used from the system, 2018-07-28. But the opposite case is also valid: bitmap file export with antialiasing must smooth text, even when system display antialiasing is disabled. This has hit testTdf162259 on a particular buildbot, where the output happened to be black-and-while (see commit 7a08c89b5af8f98045ad825ace6be2f035ad91af Workaround a non-antialiased output on one of Windows buildbots, 2024-08-17). The problem turned out to be RDP settings used to connect that particular buildbot, which happened to disable AA. This basically means that output of '--convert-to png' would depend on the system where it's called. This change extends the effect of GetUseFontAAFromSystem to not only force disabled text AA, when it returns false and line AA is disabled, but also force enabled text AA, when it returns false and line AA is enabled. This is a Windows-only change. I will change the test to use this in a separate commit. Change-Id: I7071f1bdefb77cbb9156dde3f70feb4cf8be73f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172031 Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Tested-by: Jenkins diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index b18b842b3b26..4de061d74de7 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -719,10 +719,10 @@ void ImplGetLogFontFromFontSelect( const vcl::font::FontSelectPattern& rFont, // disable antialiasing if requested if ( rFont.mbNonAntialiased ) rLogFont.lfQuality = NONANTIALIASED_QUALITY; - else if (bAntiAliased || Application::GetSettings().GetStyleSettings().GetUseFontAAFromSystem()) - rLogFont.lfQuality = DEFAULT_QUALITY; + else if (Application::GetSettings().GetStyleSettings().GetUseFontAAFromSystem()) + rLogFont.lfQuality = DEFAULT_QUALITY; // for display on screen else - rLogFont.lfQuality = NONANTIALIASED_QUALITY; + rLogFont.lfQuality = bAntiAliased ? ANTIALIASED_QUALITY : NONANTIALIASED_QUALITY; } std::tuple<HFONT,bool,sal_Int32> WinSalGraphics::ImplDoSetFont(HDC hDC, vcl::font::FontSelectPattern const & i_rFont,