02-23-2011, 10:30 AM | #1 |
Sigil developer
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
Is there a way to set font for messagebox details?
When using info_dialog, I now use the details option for added information. One annoying quirk is that, at least on Ubuntu 10.10, the font of the details box is not a fixed font, and its not using HTML. While this is fine for most things, it makes lining up columns of information difficult - so I either need to put the second column of data on the separate line (using spaces to indent) or accept a wavy column.
Haven't seen a way around this in searching. I think its using the system font which obviously I don't want to change. Any suggestions of settings/functions that can allow me to use a fixed font or HTML in the details section? |
02-23-2011, 10:31 AM | #2 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
dialog = info_dialog(..., show=False)
font = QFont() font.setFamily('monospace') dialog.det_msg.setFont(font) |
Advert | |
|
02-23-2011, 11:25 AM | #3 |
Sigil developer
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
Works perfectly. That was really beginning to bother me
again |
03-12-2011, 07:02 AM | #4 |
Sigil developer
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
An update on this - everything worked fine under Ubuntu, but on Windows I had to change it to
font.setFamily('Courier') font.setFixedPitch(True) Not sure Courier is needed, but the fixed pitch was otherwise it was ragged. |
03-12-2011, 07:14 AM | #5 |
Grand Sorcerer
Posts: 11,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
You would need to select a truetype/type 1 font family. Monospace probably selects the microsoft bitmapped system fonts.
If you can check for font existence, then (I think) 'Lucida Console' is a nicer font than Courier, because it is sans serif. |
Advert | |
|
03-12-2011, 10:52 AM | #6 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You need to set the stylehint on the qfont to moonospace, dont use an explicit family name.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Default font set? | brainycat | PocketBook | 13 | 06-03-2010 03:19 AM |
Book Details - Size of Font | adrian1944 | Calibre | 1 | 02-18-2010 06:12 PM |
feed to lrf, how do I change font (or have default font) | lovemov | Calibre | 3 | 03-16-2009 10:57 PM |
Set default font for LRF? | daruking | Calibre | 15 | 03-03-2009 06:26 PM |
PRS-500 Japanese Font Details? | damo | Sony Reader Dev Corner | 7 | 10-24-2007 05:51 PM |