diff --git a/src/calibre/gui2/splash_screen.py b/src/calibre/gui2/splash_screen.py index 505d8a87b7..7d8e688b63 100644 --- a/src/calibre/gui2/splash_screen.py +++ b/src/calibre/gui2/splash_screen.py @@ -5,9 +5,9 @@ from __future__ import (unicode_literals, division, absolute_import, print_function) -from PyQt5.Qt import Qt, QSplashScreen, QIcon, QApplication, QTransform +from PyQt5.Qt import Qt, QSplashScreen, QIcon, QApplication, QTransform, QPainterPath, QBrush -from calibre.constants import __appname__ +from calibre.constants import __appname__, iswindows from calibre.utils.monotonic import monotonic class SplashScreen(QSplashScreen): @@ -24,6 +24,7 @@ class SplashScreen(QSplashScreen): painter.save() painter.setPen(Qt.black) painter.setRenderHint(painter.TextAntialiasing, True) + painter.setRenderHint(painter.Antialiasing, True) f = painter.font() f.setPixelSize(18) painter.setFont(f) @@ -31,7 +32,13 @@ class SplashScreen(QSplashScreen): t.translate(330, 450) painter.setTransform(t) painter.rotate(-98) - painter.drawText(0, 0, self.message()) + if iswindows: + # On windows Qt cannot anti-alias rotated text + p = QPainterPath() + p.addText(0, 0, f, self.message()) + painter.fillPath(p, QBrush(Qt.black)) + else: + painter.drawText(0, 0, self.message()) painter.restore() def show_message(self, msg): @@ -51,10 +58,13 @@ class SplashScreen(QSplashScreen): ev.accept() QApplication.instance().quit() -if __name__ == '__main__': +def main(): from calibre.gui2 import Application app = Application([]) spl = SplashScreen(develop=True) spl.show() spl.show_message('Testing the splash screen message...') app.exec_() + +if __name__ == '__main__': + main()