01-08-2024, 04:34 AM | #1 |
Connoisseur
Posts: 59
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 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. |
01-08-2024, 05:55 AM | #2 |
creator of calibre
Posts: 44,391
Karma: 23798586
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No this has nothing to do with calibre. You need to use the full enum name. QFont.StyleHint.Whatever
|
01-08-2024, 01:17 PM | #3 |
Connoisseur
Posts: 59
Karma: 666
Join Date: May 2020
Location: Germany
Device: android smartphone + tablet
|
Thanks!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
tag attributes in random order | guich | Sigil | 6 | 11-14-2019 09:06 AM |
adding language attributes | roger64 | ePub | 1 | 02-07-2017 12:29 PM |
How do I create a recipe for content with these attributes | anleva | Recipes | 7 | 10-21-2016 09:45 AM |
Remove unused class attributes | phossler | Editor | 15 | 01-26-2016 01:06 PM |
What are DR1000 friendly pdf attributes, if there are any? | sarikan | iRex | 4 | 12-29-2008 11:31 AM |