|
|
#1 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() Posts: 64
Karma: 666
Join Date: May 2020
Location: Germany
Device: android smartphone + tablet with Moon Reader and ReadEra Apps.
|
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. |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,618
Karma: 28549044
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
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() Posts: 64
Karma: 666
Join Date: May 2020
Location: Germany
Device: android smartphone + tablet with Moon Reader and ReadEra Apps.
|
Thanks!
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| tag attributes in random order | guich | Sigil | 6 | 11-14-2019 10:06 AM |
| adding language attributes | roger64 | ePub | 1 | 02-07-2017 01:29 PM |
| How do I create a recipe for content with these attributes | anleva | Recipes | 7 | 10-21-2016 10:45 AM |
| Remove unused class attributes | phossler | Editor | 15 | 01-26-2016 02:06 PM |
| What are DR1000 friendly pdf attributes, if there are any? | sarikan | iRex | 4 | 12-29-2008 12:31 PM |