diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index 40dda0af5e..6229cd863f 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -275,8 +275,6 @@ wxString wxCreateBrushFill(wxBrush& brush) void wxSetScaledScreenDCFont(wxScreenDC& sDC, const wxFont& font) { - sDC.SetFont(font); - const double scale = sDC.GetContentScaleFactor(); if ( scale > 1 ) { @@ -287,10 +285,14 @@ void wxSetScaledScreenDCFont(wxScreenDC& sDC, const wxFont& font) // We can't just divide the returned sizes by the scale factor, because // text does not scale linear (at least on Windows). Therefore, we scale // the font size instead. - wxFont scaledFont = sDC.GetFont(); + wxFont scaledFont = font; scaledFont.SetFractionalPointSize(scaledFont.GetFractionalPointSize() / scale); sDC.SetFont(scaledFont); } + else + { + sDC.SetFont(font); + } } } // anonymous namespace