diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-08-17 10:50:06 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-08-17 12:36:13 +0200 |
commit | 52a2dd0eea2ecf62b1db5f379cf65aed705446cb (patch) | |
tree | 68d78743be005c74482853b5f75ee217bd7aa5fb /vcl/win/gdi/salfont.cxx | |
parent | dac249a0de613cce6c3f3de756cd1a0c8464f38c (diff) |
Support for non-AA text on Windows
In commit 3ecd8f19a91ed7141304a2080fb11612b5ff30b3 (vcl cairo text
renderer: support non-AA text, 2018-07-26) and its follow-up commit
e6538f5bdd876911ea30f84a6512c03908e620fd (tdf#118966 vcl: add a flag
to determine if AA of fonts is used from the system, 2018-07-28),
non-antialiased text got supported in bitmap export using cairo.
This change makes that support available on Windiws, including Skia.
Change-Id: I1fae726539347f826e2d62246d35315e7954cf83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171967
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'vcl/win/gdi/salfont.cxx')
-rw-r--r-- | vcl/win/gdi/salfont.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index 2a70d671fd8e..b18b842b3b26 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -676,7 +676,7 @@ static int CALLBACK SalEnumQueryFontProcExW( const LOGFONTW*, const TEXTMETRICW* void ImplGetLogFontFromFontSelect( const vcl::font::FontSelectPattern& rFont, const vcl::font::PhysicalFontFace* pFontFace, - LOGFONTW& rLogFont ) + LOGFONTW& rLogFont, bool bAntiAliased) { OUString aName; if (pFontFace) @@ -712,7 +712,6 @@ void ImplGetLogFontFromFontSelect( const vcl::font::FontSelectPattern& rFont, rLogFont.lfEscapement = rFont.mnOrientation.get(); rLogFont.lfOrientation = rLogFont.lfEscapement; rLogFont.lfClipPrecision = CLIP_DEFAULT_PRECIS; - rLogFont.lfQuality = DEFAULT_QUALITY; rLogFont.lfOutPrecision = OUT_TT_PRECIS; if ( rFont.mnOrientation ) rLogFont.lfClipPrecision |= CLIP_LH_ANGLES; @@ -720,7 +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 + rLogFont.lfQuality = NONANTIALIASED_QUALITY; } std::tuple<HFONT,bool,sal_Int32> WinSalGraphics::ImplDoSetFont(HDC hDC, vcl::font::FontSelectPattern const & i_rFont, @@ -730,7 +732,7 @@ std::tuple<HFONT,bool,sal_Int32> WinSalGraphics::ImplDoSetFont(HDC hDC, vcl::fon HFONT hNewFont = nullptr; LOGFONTW aLogFont; - ImplGetLogFontFromFontSelect( i_rFont, i_pFontFace, aLogFont ); + ImplGetLogFontFromFontSelect( i_rFont, i_pFontFace, aLogFont, getAntiAlias()); bool bIsCJKVerticalFont = false; // select vertical mode for printing if requested and available |