summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2016-05-12 17:29:20 +0300
committerTor Lillqvist <tml@collabora.com>2016-05-12 17:46:46 +0300
commit0a986598cf64fc386d267693a78047c2dd71a61a (patch)
tree62c36a3c9d0da6d8ca1ef09a75c5ae930f17d72c
parent2ed28620955108d56f40fc6613185f2595572e60 (diff)
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
-rw-r--r--vcl/win/gdi/salfont.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index d198dc678319..62d3e611eead 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