|
|||||||
![]() |
|
|
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: 45
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.
|
|
|
|
| Advert | |
|
|
|
|
#33 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82,643
Karma: 151278869
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; Yesterday 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: 45
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; Yesterday at 03:40 PM. |
|
|
|
| Advert | |
|
|
|
|
#36 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82,643
Karma: 151278869
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
|
|
|
![]() |
|
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 |