From fd6742faa706a34a34d84cdefeeba3ff1322c22b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 19 Oct 2023 21:03:52 +0530 Subject: [PATCH] Fix #2039855 [Exception when opening LRF file - QFont.setPixelSize gets float instead of int](https://bugs.launchpad.net/calibre/+bug/2039855) --- src/calibre/gui2/lrf_renderer/text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/lrf_renderer/text.py b/src/calibre/gui2/lrf_renderer/text.py index 6158af6e1c..3c553079ad 100644 --- a/src/calibre/gui2/lrf_renderer/text.py +++ b/src/calibre/gui2/lrf_renderer/text.py @@ -401,7 +401,7 @@ class Line(QGraphicsItem): matches = self.__class__.whitespace.finditer(phrase) font = QFont(ts.font) if self.valign is not None: - font.setPixelSize(font.pixelSize()/1.5) + font.setPixelSize(int(font.pixelSize()/1.5)) fm = QFontMetrics(font) single_space_width = fm.horizontalAdvance(' ') height, descent = fm.height(), fm.descent()