![]() |
#16 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,581
Karma: 11380098
Join Date: Aug 2010
Location: NE Oregon
Device: Kobo Sage, Pocketbook Era, Kobo Forma, Kindle Oasis 2
|
Quote:
Whether your CSS will be honored depends on the app. How images get treated depends on the app. Some will let you tap to zoom, some won't. FWIW, things I've found: A lot of Android reader apps don't like too large of an image. Many will give you a blank page if an image goes much over 2200 pixels high/1500 pixels wide. This is annoying when one owns a 10" tablet with 300 dpi resolution, since covers or other full page images will look a little softer. Reasonably acceptable, but not ideal. There's no error message to let you know an image didn't load, just a blank page to mystify the reader. I used to think I was doing something wrong, but I saw someone else on MR mention the same problem. About half of the apps I've tested on don't seem to care for a transparent PNG in an SVG wrapper, giving a blank white page again, or in the case of the Overdrive app, a solid black rectangle. Non-transparent images seem to work fine in SVG wrappers though. But a tablet or phone is exactly where you want transparency most, sigh. SVG images are generally supported OK, and transparency works. I've had no issues with using SVG for title pages. Use title and desc tags, those are generally honored when an SVG image won't display. However, bitmap tracing a complex drawing can result in a larger file size of the SVG than a PNG would give you. I created an SVG yesterday where the size was 1.83 MB vs 401 KB for a transparent PNG at full resolution. This created a slight lag for image loading on a fast tablet (Pixel C). The loading lag time for the same image on my e-ink Kobo was just entirely unacceptable! CSS support in Android apps is somewhat variable. Best at rendering my books as they appear in ADE are Bookari, Pocketbook and Bluefire Reader. These however, are amongst those that the image issues I mentioned can be found in. One more infuriating issue, a few Android reading apps don't play well with 4:3 aspect ratio tablets. Gitden Reader and Lithium will cut off the bottoms of images on the aforesaid tablets and display that cut bit on the next page. The identical ebook file will display absolutely fine on a narrower phone screen with no image cut off. Overdrive and Google Play Books are sometimes guilty of the image cut off behavior on 4:3 tablets as well, though to a lesser extent. Android reading apps I've played with so far: Aldiko Bluefire Bookari Cool Reader FB Reader Gitden Reader Google Play Books Lithium Kobo Moon+ Reader Nook Overdrive Pocketbook UB Reader Sent from my Pixel C using Tapatalk |
|
![]() |
![]() |
![]() |
#17 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 97
Karma: 44418
Join Date: Jul 2013
Location: Mostly in my own head!
Device: Kindle Fire, iPad
|
![]()
So I couldn't get Turtle91's code to work in iBooks or ADE (and Sony PRS-T2, but that's based on ADE AFAIK so I suppose I'm stating the obvious) but he gave me the start I needed.
After playing around with tables for a while, I've got the following to work in ADE and iBooks. By the way, I'm not trying to vertically center the text... I want about 1/3rd whitespace above the text and 2/3rd whitespace below. The XHTML has one table with 3 rows. The first row is empty, the second has the book title and the third row has the author's name. This is the XHTML: Code:
<body> <table id="tableContainer"> <tr> <td id="emptyRow"></td> </tr> <tr> <td id="bookTitle" valign="top">SCARAMOUCHE</td> </tr> <tr> <td id="bookAuthor">Rafael Sabatini</td> </tr> </table> </body> Code:
table#tableContainer {
margin: 0;
padding: 0;
text-indent: 0;
position: fixed;
height: 98%;
width:98%;
}
td#emptyRow {
margin: 0;
padding: 0;
height: 25%;
}
td#bookTitle {
font-family: Rye;
font-size: 2em;
font-weight: bold;
text-align: center;
height: 10%;
}
td#bookAuthor {
font-family: Italianno;
font-size: 1.8em;
font-weight: bold;
text-align: center;
}
Setting table height and width to 100% renders correctly in ADE but fortunately the 98% setting is not making a discernable difference. With these settings, iBooks displays a table which fills the entire screen; since the height of the first and second row is defined, the last row fills up the rest of the screen. In ADE, the third row only takes as much vertical space as is required to display the text. The crucial property in this entire code is "position: fixed" applied to the table tag. Without this property, iBooks ignores the height set on the table rows. The presence or absence of this property does not affect the display in ADE. The other thing I found was that if you set a table height (of say 70%), iBooks resizes the table accordingly. ADE, on the other hand, ignores this property; if a height is not explicitly set on the table rows, the table will be only as high as needed to accommodate the text. Lastly, using the valign attribute in the <td> is not mandatory; I just found it easier to visualise while doing the math for the row heights. Oh, and I checked... according to w3schools, position: fixed means the element is positioned relative to the browser window. I've tested this on ADE 4.5, Sony PRS-T2, iBooks on iPad, Aldiko and a Kobo reader whose model number I can't remember. |
![]() |
![]() |
Advert | |
|
![]() |
#18 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 557
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
|
Be aware: a epubcheck warning will be for a position:fixed in ePub
|
![]() |
![]() |
![]() |
#19 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 97
Karma: 44418
Join Date: Jul 2013
Location: Mostly in my own head!
Device: Kindle Fire, iPad
|
Quote:
Update: Ok, just ran epubcheck on the file. I have two versions of epubcheck on my computer; the older v3.0.1 and the latest 4.0.2. The epub passes validation on the older version but generates a warning in the current version. And again. ![]() Last edited by Nabodita; 06-21-2017 at 03:49 AM. Reason: Ran epubcheck and posted results |
|
![]() |
![]() |
![]() |
#20 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
(n.b.: I meant to add, that table will cause you grief, if not in ePUB, certainly in MOBI. Now, you may be utterly disinterested in MOBI, for all I know, but for those that cometh later, to read this post, I wished to make that point.) Hitch Last edited by Hitch; 06-24-2017 at 04:23 PM. Reason: Forgot my aside/nb. |
|
![]() |
![]() |
Advert | |
|
![]() |
#21 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 97
Karma: 44418
Join Date: Jul 2013
Location: Mostly in my own head!
Device: Kindle Fire, iPad
|
Quote:
Took a small break, getting back to work now. I think I'll spend a little more time playing around with this and post back here with any updates... worst case scenario, I'll use an image for the title page. ![]() Cheers Nabodita |
|
![]() |
![]() |
![]() |
#22 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Hitch |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PDF page number positioning | TheOldFellow | Conversion | 2 | 11-10-2014 04:02 PM |
PDF page number positioning | TheOldFellow | Introduce Yourself | 0 | 11-10-2014 02:48 PM |
How do you vertically center a text? | Julius Caesar | Workshop | 9 | 09-08-2013 02:58 PM |
How do you center text vertically? | 44reader | ePub | 8 | 08-06-2012 01:52 PM |
Problem: positioning text to the bottom-right | JulienDym | ePub | 5 | 07-06-2011 09:03 AM |