Fix #2039855 [Exception when opening LRF file - QFont.setPixelSize gets float instead of int](https://bugs.launchpad.net/calibre/+bug/2039855)

This commit is contained in:
Kovid Goyal 2023-10-19 21:03:52 +05:30
parent 743a9690bb
commit fd6742faa7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -401,7 +401,7 @@ class Line(QGraphicsItem):
matches = self.__class__.whitespace.finditer(phrase) matches = self.__class__.whitespace.finditer(phrase)
font = QFont(ts.font) font = QFont(ts.font)
if self.valign is not None: if self.valign is not None:
font.setPixelSize(font.pixelSize()/1.5) font.setPixelSize(int(font.pixelSize()/1.5))
fm = QFontMetrics(font) fm = QFontMetrics(font)
single_space_width = fm.horizontalAdvance(' ') single_space_width = fm.horizontalAdvance(' ')
height, descent = fm.height(), fm.descent() height, descent = fm.height(), fm.descent()