View Single Post
Old 01-08-2024, 04:34 AM   #1
feuille
Connoisseur
feuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enough
 
Posts: 55
Karma: 666
Join Date: May 2020
Location: Germany
Device: android smartphone + tablet
QFont attributes

Is there a way to set the font styles in Calibre regardless of the environment?

I tried with:
Code:
font = QFont()
font.setStyleHint(QFont.SansSerif)
font.setFamily('Arial') # Windows
#font.setFamily('Helvetica') # Linux
as described in the Qt documentation.
But I get the error message "'QFont' object has no attribute 'SansSerif'". The same applies to QFont.Serif, QFont.TypeWriter, etc.

I suspect this is because Calibre uses its own abstraction for Qt.
feuille is offline   Reply With Quote