[Libreoffice-commits] core.git: vcl/win

Tor Lillqvist tml at collabora.com
Thu May 12 14:47:53 UTC 2016


 vcl/win/gdi/salfont.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 0a986598cf64fc386d267693a78047c2dd71a61a
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu May 12 17:29:20 2016 +0300

    tdf#98983: Font fallback: Map 'MS Sans Serif' to the TrueType version
    
    Also, I don't see the point in using lstrcpynW() instead of a plain
    wcscpy(), as we were passing the manually specified very length of the
    source string (including terminating nul character) anyway. We did not
    use a copying function that would have taken the size of the
    destination buffer as a limit parameter, for instance.
    
    Change-Id: If9e2f56b16358201c113e06289f63ed3454e00c9

diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index d198dc6..62d3e61 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -1375,7 +1375,11 @@ HFONT WinSalGraphics::ImplDoSetFont( FontSelectPattern* i_pFont, float& o_rFontS
     && !bImplSalCourierScalable
     && bImplSalCourierNew
     && (ImplSalWICompareAscii( aLogFont.lfFaceName, "Courier" ) == 0) )
-        lstrcpynW( aLogFont.lfFaceName, L"Courier New", 12 );
+        wcscpy( aLogFont.lfFaceName, L"Courier New" );
+
+    // Prefer the scalable 'Microsoft Sans Serif' to the old raster 'MS Sans Serif'
+    if( ImplSalWICompareAscii( aLogFont.lfFaceName, "MS Sans Serif" ) == 0 )
+        wcscpy( aLogFont.lfFaceName, L"Microsoft Sans Serif" );
 
     // #i47675# limit font requests to MAXFONTHEIGHT
     // TODO: share MAXFONTHEIGHT font instance


More information about the Libreoffice-commits mailing list