Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-04-2017, 08:34 AM   #16
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,853
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I dont know, depends on how the browser does font loading. The viewer just passes the styleshet unmodified to the browser. Experiment and see.
kovidgoyal is offline   Reply With Quote
Old 11-04-2017, 08:58 AM   #17
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
To experiment it would be helpful if I knew where to find the phone's local copies of
  • User style sheet
  • Books already opened in Browser Viewer
It might give me a clue of urls to try in User stylesheet @font-faces.
jackie_w is offline   Reply With Quote
Advert
Old 11-04-2017, 11:34 AM   #18
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,853
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
They're stored in indexedDB and are loaded via BLOB URLs. You cant use relative paths, you would have to use absolute paths.
kovidgoyal is offline   Reply With Quote
Old 11-04-2017, 03:07 PM   #19
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
They're stored in indexedDB and are loaded via BLOB URLs. You cant use relative paths, you would have to use absolute paths.
My *nix knowledge isn't good enough to figure out the absolute path required. I've tried a lot of alternatives but haven't hit on one that works yet. If you have time please will you look at the 2 screencaps below to see whether it's obvious to you what the absolute url path should be.

My font .ttf files are in /fonts in phone internal storage. Using an Android file manager I can navigate to them in 2 ways:
  1. The easier way via Internal storage > fonts (image 1).
  2. From the phone's root directory (image 2).
    To arrive at this location I actually navigated via root > mnt > sdcard > fonts
    but it shows as something???/storage/self/primary/fonts
    once I get there.

To minimise typing until I can get it working (or not). I'm assuming the User style sheet would look something like this:
Code:
@font-face {font-family: MyFont; src: url("abs_path_to_fonts/MyFont-Regular.ttf")}

body {font-family: MyFont, serif}
Attached Thumbnails
Click image for larger version

Name:	image1.jpg
Views:	141
Size:	54.9 KB
ID:	159811   Click image for larger version

Name:	image2.jpg
Views:	137
Size:	50.1 KB
ID:	159812  
jackie_w is offline   Reply With Quote
Old 11-04-2017, 09:22 PM   #20
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,853
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Sorry I spend almost no time exploring the internals of phone OSes, which I regard as computers dumbed down to the point of near uselessness. But as a workaround, simply upload the fonts somewhere on the web and use an http URL to the font in your stylesheet. To make it robust you would set the cache control headers to never expire, that way the browser on your phone should never need to reload the fonts, after the first time they are downloaded.
kovidgoyal is offline   Reply With Quote
Advert
Old 11-04-2017, 10:31 PM   #21
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,799
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by jackie_w View Post
My *nix knowledge isn't good enough to figure out the absolute path required. I've tried a lot of alternatives but haven't hit on one that works yet. If you have time please will you look at the 2 screencaps below to see whether it's obvious to you what the absolute url path should be.

My font .ttf files are in /fonts in phone internal storage. Using an Android file manager I can navigate to them in 2 ways:
  1. The easier way via Internal storage > fonts (image 1).
  2. From the phone's root directory (image 2).
    To arrive at this location I actually navigated via root > mnt > sdcard > fonts
    but it shows as something???/storage/self/primary/fonts
    once I get there.

To minimise typing until I can get it working (or not). I'm assuming the User style sheet would look something like this:
Code:
@font-face {font-family: MyFont; src: url("abs_path_to_fonts/MyFont-Regular.ttf")}

body {font-family: MyFont, serif}
the first slash implies root, so that is the absolute path.
./ would be relative to the current dir
theducks is offline   Reply With Quote
Old 11-05-2017, 05:55 AM   #22
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
Thanks for your suggestions but I'll have to admit defeat on this one. I don't have a website. I'm sure embedding a body font in every epub would work but that's neither practical nor desirable.

Maybe some day someone with better knowledge who cares about font usage on Android phones will stop by and post a neat solution.
jackie_w is offline   Reply With Quote
Old 11-24-2017, 08:16 PM   #23
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 jackie_w View Post
Thanks for your suggestions but I'll have to admit defeat on this one. I don't have a website. I'm sure embedding a body font in every epub would work but that's neither practical nor desirable.

Maybe some day someone with better knowledge who cares about font usage on Android phones will stop by and post a neat solution.
I use Google fonts and the Browser Viewer handles them nicely. For special fonts (symbols, etc.) I would physically embed them to the epubs.

Sent from my ONEPLUS A3000 using Tapatalk
nqk is offline   Reply With Quote
Old 11-29-2017, 12:31 PM   #24
MizSuz
Connoisseur
MizSuz began at the beginning.
 
Posts: 63
Karma: 10
Join Date: Jul 2011
Device: Sony Touch, Nook Simple Touch, Kobo Aura, Android w/CoolReader
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;
}
Once again I must insist that, Kovid, you are a God.

Honestly, this fixed all my heartache with the browser reader. Thanks so much.

ETA: Using Calibre 3.12 with Android Galaxy Note 3 on Chrome for Android browser. I haven't tried the browser viewer with the samsung browser since it recently update as the earlier version didn't work, but now that I've thought of it I guess I'll have a look.

But the bit of code you posted put into the css stylesheet spot under preferences in the browser viewer put me back on serif fonts, which has negated my need to use another piece of software. Total. Win.

UPDATE: Calibre's Browser Viewer now seems to work with the updated Samsung Browser. I feel like Kovid has given me the majority of my holiday gifts.

Last edited by MizSuz; 11-29-2017 at 12:44 PM.
MizSuz is offline   Reply With Quote
Old 11-29-2017, 12:55 PM   #25
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,853
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You are welcome
kovidgoyal is offline   Reply With Quote
Old 11-30-2017, 08:34 PM   #26
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
Dear Kovid,

I created a shortcut (Home screen) to the content server, which has been improved now and I decided to keep a computer running Calibre permanently for the first time, and anytime I tap on such Chrome shortcut it opens the book but not in fullscreen mode. I need to tap and tap to activate fullscreen again. Is it something that you can fix or it is a Chrome feature?

Regarding the Page Layout, can you add {title} {author} or custom fields to the footer where reading progress is indicated now?

Last edited by nqk; 11-30-2017 at 08:40 PM.
nqk is offline   Reply With Quote
Old 11-30-2017, 10:26 PM   #27
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,853
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Browsers require explicit user action to enter full screen mode.

Creating a template for headers/footers is on my TODO list (it requires some code to get the current chapter name as well, so you can use that in your headers and footers).
kovidgoyal is offline   Reply With Quote
Old 12-02-2017, 03:11 AM   #28
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
Dear Kovid,

I'm seriously trying Browser Viewer now and I have encountered a number of issues that may need your golden touches. Sorry that the contents of the thread have gone far from the intended title.

1) I created a number of virtual libraries and set user accessibility accordingly. It works. However users are able to see the full list of VLs, even the search commands applied. Is it possible that the users can only see VLs that they CAN access to? An option to turn off VL selection button applicable to certain users?

2) Users with "write access" now can sync their reading progresses. But does that mean they will be able to change the books in the future when you implement such features?

3) I think you should include link color in Themes as well. Default blue links look bad in dark background themes. Of course I can overwrite these with a {color: yellow;} but then switching themes requires manual changes to the user style sheet, too.

Last edited by nqk; 12-02-2017 at 03:14 AM.
nqk is offline   Reply With Quote
Old 12-02-2017, 03:57 AM   #29
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,853
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
1) No, I'm afraid not. The names of VLs will always be visible to everybody.

2) IIRC you dont need write access to sync books, but I could be misremembering.

3) Something worth doing, I think. Open a ticket for it so I dont forget.
kovidgoyal is offline   Reply With Quote
Old 01-17-2018, 09:36 PM   #30
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
Browsers require explicit user action to enter full screen mode.
Today I found a workaround to keep Browser Viewer always in Fullscreen mode (or non-fullscreen mode), putting an end to the annoying loss of last reading position and to the need of tapping to re-access fullscreen to resume reading.

I installed this free Webview app in my phone, and configured it to open the content server. Http auth must be in 'basic' mode. That's it. It feels like Lithium with all the added features (user style sheet, last reading position etc.). Download button doesn't work though, but I don't mind that and it is easy to switch back to browser (Chrome) for that. Changing the app icon makes it look like a dedicated Calibre reader on Android.

Last edited by nqk; 01-17-2018 at 11:58 PM.
nqk 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 05:33 AM.


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