Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-22-2017, 11:12 PM   #1
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 516
Karma: 32106
Join Date: Feb 2012
Device: Onyx Boox Leaf
Serif font in Browser Viewer?

Dear Kovid,

Thank you so much for popup footnote in the Browser Viewer - that is the important point for me as my books always have many notes. Great job.

However, I would like to read in serif fonts (as default, when no fonts are embedded). Current version forces me to use sans-serif.



And one issue that I have found: in black theme, the footnote text color is not changed, hence, blended into black background.
Click image for larger version

Name:	bf31d47b72fc008a76d7b82faaf14d7b.jpg
Views:	216
Size:	70.2 KB
ID:	160348

Last edited by DiapDealer; 12-03-2017 at 09:48 AM.
nqk is offline   Reply With Quote
Old 10-23-2017, 04:58 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,851
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...1730382b09bad1

https://github.com/kovidgoyal/calibr...77cec07f9eee28
kovidgoyal is online now   Reply With Quote
Advert
Old 11-03-2017, 03:19 AM   #3
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 516
Karma: 32106
Join Date: Feb 2012
Device: Onyx Boox Leaf
Thank you, Kovid, for the updates in version 3.11.1, which fixed the footnote text color issue.

However, I am still unable to get the books to display in serif font nor embedded fonts with font-family family properly declared in their respective css files. I then even entered the following in the User style sheet (new feature) box. But it still doesn't work. The font is still sans-serif for every single text.

body {
font-family: serif;
}


And there is this "reload" issue. When I tap on the "Reload" button, the book is downloaded again for offline reading - which is good - but all the css properties seem to be either broken or ignored. All texts are now the same and left aligned, as though they are raw texts in Notepad. After quitting Chrome and loading it back again, the book is ok (of course the font issue remains). (Edit) Ah, I found out that I don't have to quit Chrome, just hit refresh button of Chrome itself.

Last edited by nqk; 11-03-2017 at 03:27 AM.
nqk is offline   Reply With Quote
Old 11-03-2017, 03:37 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,851
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That rule will work only if the book in question does not specify its own fonts. If you want to override book fonts you need something like

Code:
* {
font-family: serif !important;
}
kovidgoyal is online now   Reply With Quote
Old 11-03-2017, 03:45 AM   #5
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 516
Karma: 32106
Join Date: Feb 2012
Device: Onyx Boox Leaf
Quote:
Originally Posted by kovidgoyal View Post
That rule will work only if the book in question does not specify its own fonts. If you want to override book fonts you need something like

Code:
* {
font-family: serif !important;
}
But even the book fonts are not displayed in serif, despite its declaration in embedded css.

I've attached a file as an example.
Attached Files
File Type: epub Epub Test - NQK.epub (2.0 KB, 158 views)
nqk is offline   Reply With Quote
Advert
Old 11-03-2017, 04:06 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,851
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That would imply your browser has no serif fonts available, or its serif family has been set to a sans-serif font. The viewer does not do anything to CSS in the book, it leaves it up to the browser to render.
kovidgoyal is online now   Reply With Quote
Old 11-03-2017, 04:20 AM   #7
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 516
Karma: 32106
Join Date: Feb 2012
Device: Onyx Boox Leaf
Quote:
Originally Posted by kovidgoyal View Post
That would imply your browser has no serif fonts available, or its serif family has been set to a sans-serif font. The viewer does not do anything to CSS in the book, it leaves it up to the browser to render.
I'm just using Chrome for Android and for Windows with no fancy settings. Hmm.
nqk is offline   Reply With Quote
Old 11-03-2017, 07:20 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,851
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Actually, it might be inherintg a default style, this should do the trick:

https://github.com/kovidgoyal/calibr...37b8a8986242a1
kovidgoyal is online now   Reply With Quote
Old 11-03-2017, 01:11 PM   #9
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
@kovid,

Just a note to say that I tried your Browser Viewer fixes by running calibre from source. Everything is working OK for me in Chrome for Android on a Samsung phone.

The attached screenshot is for an epub whose only internal CSS font-family styles are for an embedded font which is used for headings and dropcaps. The font displayed for main body text appears to be Droid Serif. I did not need to set up any User stylesheet to do this (ETA: at least not knowingly).
Attached Thumbnails
Click image for larger version

Name:	Screenshot.jpg
Views:	189
Size:	82.9 KB
ID:	159793  

Last edited by jackie_w; 11-03-2017 at 02:07 PM. Reason: ETA
jackie_w is offline   Reply With Quote
Old 11-03-2017, 07:34 PM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,851
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Hmm thinking about it, I realize that I do want books that dont specify any fonts to default to sans-serif. But it should be easily overridable, by either a user stylesheet or styles in the book itself. I guess the best way to do that would be to add an extra stylesheet at the top with

Code:
html { font-family: sans-serif }
Then if either the user stylesheet or the book stylesheet specify any fonts they will override the default.
kovidgoyal is online now   Reply With Quote
Old 11-03-2017, 07:50 PM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,851
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
This should achieve that: https://github.com/kovidgoyal/calibr...604b491852285b
kovidgoyal is online now   Reply With Quote
Old 11-03-2017, 08:05 PM   #12
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by kovidgoyal View Post
Hmm thinking about it, I realize that I do want books that dont specify any fonts to default to sans-serif.
I'm the opposite. I don't ever want sans-serif to display unless I've explicitly set it in a CSS class. I'd never use it for my main body text.


Quote:
Originally Posted by kovidgoyal View Post
But it should be easily overridable, by either a user stylesheet or styles in the book itself. I guess the best way to do that would be to add an extra stylesheet at the top with

Code:
html { font-family: sans-serif }
Then if either the user stylesheet or the book stylesheet specify any fonts they will override the default.
When you say 'add an extra stylesheet at the top', do you mean somewhere in the calibre prefs? As a Kobo user I'd never want to add 'font-family:serif' in the book CSS files because in many cases it would stop the on-device font selection feature working properly. In Kobo-land font-family:serif is equivalent to enforcing font-family:Georgia.
jackie_w is offline   Reply With Quote
Old 11-03-2017, 08:30 PM   #13
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
OK, if I use Browser Viewer in Chrome in Windows 10 I can right-click to access settings Preferences>User style sheet and add body{font-family:serif}. This seems to work fine.

However, when using Chrome for Android what is the equivalent of the right-click to access settings? It's not immediately obvious to me how I can create a User style sheet.
jackie_w is offline   Reply With Quote
Old 11-03-2017, 11:56 PM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,851
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Tap anywhere in the top quarter of the screen to access the controls.
kovidgoyal is online now   Reply With Quote
Old 11-04-2017, 06:47 AM   #15
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by kovidgoyal View Post
Tap anywhere in the top quarter of the screen to access the controls.
Thanks, that's working now I know where to press

For my info, should it also be possible, in the server's User style sheet, to define body's font-family such that it points to a font which is not embedded in the epub but which exists in a /font directory present in the Android phone's main memory?
jackie_w is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is K3 Sans Serif font? lkkmaths Amazon Kindle 0 04-27-2011 07:03 AM
Serif font for JBL demingite Ectaco jetBook 3 12-13-2010 09:41 PM
how to get a serif font to work in an epub Ray Tayek Calibre 3 11-29-2010 05:36 PM
What is the K3 default sans serif font? jswinden Amazon Kindle 4 09-20-2010 11:59 AM
Do you prefer the Reader's serif or its sans serif font? (poll) Alexander Turcic Sony Reader 9 11-25-2006 12:15 PM


All times are GMT -4. The time now is 10:18 PM.


MobileRead.com is a privately owned, operated and funded community.