|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#31 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 709
Karma: 2383546
Join Date: Aug 2007
Location: Schiedam (The Netherlands)
Device: Lots of eInk devices and iOS stuff
|
I don't know how you are building the definitive CSS for each book, @QuietShelfLife, but as developer myself, I will start with an empty CSS. First step should be importing the ones in the ePub itself (yes, some ebooks have multiple CSS), skipping conflicts or starting with the biggest one and importing the others item by item, and finally import your own to complete the holes in the CSS ebook. Last step will be overwrite the customizations made by the reader in the app options.
That way I think you don't need to stay with custom optimizations. The only thing you need is a strong piece of code that will review and incorporate or overwrite the added sub-CSS options. |
|
|
|
|
|
#32 |
|
Enthusiast
![]() Posts: 46
Karma: 10
Join Date: Feb 2026
Device: iPad
|
@rfog That's essentially the approach — book CSS loads first, then app defaults fill in anything unspecified, and user settings override last. The issue JSWolf found is that our defaults were too aggressive in a couple of places (widows/orphans and line-height), overriding values the book already set. Fixing that now along with user-adjustable margins and line height. Should be in the next release.
|
|
|
|
|
|
#33 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82,839
Karma: 153071045
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
When you have no line height, YOU DO NOT SPECIFY ONE! You let the font do the work. Also, when there are no paragraph gaps specified, again the font does the work at going from one paragraph to another. When windows and orphans are specified to a value of 1, you don't have your own defaults override that because those defaults don't work. As for the line height, this is what you do when you don't have a line height setting or it's turned off. Last edited by JSWolf; 03-27-2026 at 03:17 PM. |
|
|
|
|
|
|
#34 | |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 709
Karma: 2383546
Join Date: Aug 2007
Location: Schiedam (The Netherlands)
Device: Lots of eInk devices and iOS stuff
|
Quote:
A working algorithm could be as easy as start with an empty dictionary data structure with a list in each node and then fill it with each CSS. Then you start with your full master CSS as dictionary with the selector as key, and the declaration block as a list of pairs. And then follow the reverse: starting with your full dictionary, go across low-to-high priority ebook and UI customizations, and for each selector in the other CSS, evaluate the declaration block and for each pair, if they are valid ones, replace or add it in the master CSS. No error can happen. If an ebook CSS contains widows and orphans, they will overwrite your own master CSS, and if not, it will respect master ones. And same with any other declaration pair for each selector. |
|
|
|
|
|
|
#35 |
|
Enthusiast
![]() Posts: 46
Karma: 10
Join Date: Feb 2026
Device: iPad
|
@JSWolf The fix for widows/orphans and line-height isn't in the current App Store version yet — that's why it still looks the same. When I said "next release" in my last post I meant the one I'm still building. I'll post here the moment it's on the App Store so you know which version to grab. My plan is to wrap the default in :where(), so the publisher CSS "wins". For line-height I'm still undecided, it will be user configurable.
@rfog Appreciate the suggestion — that's roughly the direction. The tricky part is knowing when a property is "missing" vs intentionally unset by the book, but a dictionary merge with priority levels is a clean way to handle it. Last edited by QuietShelfLife; 03-27-2026 at 03:40 PM. |
|
|
|
|
|
#36 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82,839
Karma: 153071045
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
|
|
|
|
|
#37 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82,839
Karma: 153071045
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I notice there are new versions being released that have nothing to do with the rendering issues. Why are you working on things that are not nearly as important as proper rendering?
I just had a look at the CSS for the eBook I'm using to check the app and the CSS for <p> has a bottom margin of 0. So there should be no paragraph spaces. CSS for <p> Code:
p {
margin-top: 0;
margin-bottom: 0;
text-indent: 1.2em;
widows: 1;
orphans: 1;
}
Last edited by JSWolf; 04-03-2026 at 04:00 PM. |
|
|
|
|
|
#38 |
|
Enthusiast
![]() Posts: 46
Karma: 10
Join Date: Feb 2026
Device: iPad
|
Hi JSWolf,
Thanks for the specific CSS example — that's exactly what I needed. You're right: when a book sets margin-bottom: 0 on paragraphs, we should respect that. I found the issue. We fixed the widows/orphans override back in 1.0.12, but the default paragraph margin (margin-bottom: 1em) still has the same problem — it's injected at normal specificity, which means it overwrites the publisher's zero margins due to cascade order. The fix is the same approach: wrap it in :where() so publisher CSS always wins. To your point about priorities — the recent releases (1.0.13–1.0.15) were crash fixes and iCloud reliability issues that were affecting a lot of users. Rendering is definitely not off the radar, and your reports are directly shaping what gets fixed. |
|
|
|
|
|
#39 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82,839
Karma: 153071045
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
|
|
|
|
|
#40 | |
|
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,264
Karma: 319569784
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
Quote:
|
|
|
|
|
|
|
#41 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82,839
Karma: 153071045
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| justRead.app – Native iOS EPUB Reader (Built for Power Readers) | petrjahoda | Apple Devices | 163 | 03-12-2026 01:16 PM |
| ‘Assistive Reader’ (text-to-speech) comes to Kindle apps for Android and iOS/macOS | tomsem | Amazon Kindle | 4 | 06-13-2024 04:53 AM |
| EPUB thumbnails in macOS Ventura/iOS | Pargeo | ePub | 1 | 01-06-2023 08:11 AM |
| Can I build Calibre 4.0 on a native macOS machine running OS X El Capitan 10.11.6? | vaboro | Development | 23 | 10-16-2019 04:37 PM |
| Idea of Bookshelves - How to organize books by drag and drop to bookshelves | duytrung | Library Management | 5 | 09-04-2015 06:28 PM |