improvements in the rendering of OpenType fonts on Windows

This is essentially porting of the following commits from Qt 5:
qtproject/qtbase@51998eb4f65b92640176973ba0e0ed14adee561d
qtproject/qtbase@dde09c429ae8b7ad0df4e4b36b8459d2b85a1219
qtproject/qtbase@0a170be576153b84ee6249f1a2b7cbce1ef10d84