Epub reader issues: custom font not used; font size different from .txt

#1
Firstly, I'd like to say: thanks a lot for finally bringing epub support to Android. I've been reading Chinese books frequently on my phone/tablet recently via Pleco Reader, having converted them to plain .txt files, and proper ebook support was the one thing I was still lacking.

I noticed two small issues with the ebook reader just now:
- I have a custom font installed, and it seems that it doesn't display in the epub reader mode. Opening a .txt file works fine, but if it's an epub, the font reverts to the Android default. My guess is that the epub rendering library needs to have its default font set separately.
- The font size of epubs is definitely controlled by the "reader font size" setting, but it's offset by some amount: normal book text is much bigger in an epub than in a .txt file. My intuition is that whatever font size is used for .txt files should also be what is used for otherwise un-annotated text in epub format; this might just need to be a scaling factor inserted somewhere in the code.
 
#2
Whoops, here's two more issues (sorry, doesn't look like I can edit my original post).
- It looks like the epub reader has a one-finger-drag-to-highlight feature which interferes with the "swipe to change pages" behavior of the typical Pleco reader. Whether or not a given one-finger swipe works to flip to the next page is kind of unpredictable, but it definitely looks like it sometimes gets caught by the epub renderer itself instead of whatever it's sitting on top of.
- I tried to enable the "volume buttons scroll" feature to get around this, but it turns out that doesn't work when reading an epub either. Possibly the "button pressed" callbacks need to be separately hooked up to the epub renderer's scroll feature.
 

mikelove

皇帝
Staff member
#3
Thanks for the feedback.

- I have a custom font installed, and it seems that it doesn't display in the epub reader mode. Opening a .txt file works fine, but if it's an epub, the font reverts to the Android default. My guess is that the epub rendering library needs to have its default font set separately.
Actually the problem here is that laying out formatted paginated text like an EPUB requires some precise font math and we've found that with a lot of third-party fonts the math comes out wrong (due to some combination of Android's wonky font renderer and the fonts themselves having incorrect data). I suppose we could offer the option anyway and then simply tell people that it's not officially supported if their favorite font garbles their EPUBs, but I'm not sure if that's an improvement :)

- The font size of epubs is definitely controlled by the "reader font size" setting, but it's offset by some amount: normal book text is much bigger in an epub than in a .txt file. My intuition is that whatever font size is used for .txt files should also be what is used for otherwise un-annotated text in epub format; this might just need to be a scaling factor inserted somewhere in the code.
Does this happen with all EPUBs? My best guess about that one is that something in the HTML is causing the font size to scale in a way that we're not detecting / overriding.

- It looks like the epub reader has a one-finger-drag-to-highlight feature which interferes with the "swipe to change pages" behavior of the typical Pleco reader. Whether or not a given one-finger swipe works to flip to the next page is kind of unpredictable, but it definitely looks like it sometimes gets caught by the epub renderer itself instead of whatever it's sitting on top of.
That highlighting feature should be disabled entirely, so it sounds like we need to go back and figure out why Android isn't listening to us when we tell us not to enable swipe text highlighting.

- I tried to enable the "volume buttons scroll" feature to get around this, but it turns out that doesn't work when reading an epub either. Possibly the "button pressed" callbacks need to be separately hooked up to the epub renderer's scroll feature.
That one we just never bothered implementing since hardly anybody seems to use it with text files. (but might make sense to support it, yes)
 
#4
I was about to open a new thread when I saw this post :) Have the same issue with custom fonts for epub files. While the standard Pleco font might be good for dictionary entries and short definitions, for long texts like novels it's rather unpleasant. It's also helpful to be able to scale the font for a better reading experience. I would be fine with the "not officially supported" option, I think it wouldn't look much worse than an epub conferted to txt with pagination, and it would retain the useful table of contents of epubs.
 

mikelove

皇帝
Staff member
#5
We can at least do a quick survey to figure out whether a large enough % of fonts would in fact work with this to let us make that an option - it's not worth adding the checkbox if people are going to test out half a dozen fonts, find that none of them work and then give up.
 
Top