02-05-2024, 01:18 PM | #76 | ||
Evangelist
Posts: 419
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
|
Quote:
On the other hand, if your stylesheet only referenced .chapterheader {}, then it doesn't matter if that class name is in an h1, an h2 or even a p, it will still get applied. Quote:
In the first case, you aren't using the base h1 at all in h1.specialchapter, so why pretend it's related to the base? In the second case, if you change the base h1, then h1.specialchapter will also change, if you didn't override that property. If that's not what you want, you have to change both declarations. My way means I only change the declaration I want to change, and don't have to worry about any other side effects. Part of the reason I do this is because physical books often had what would be h1 and h2 in an EPUB having formatting that has nothing at all in common. For example h1 was a fairly large sans-serif font centered (the chapter number) with a very large bottom margin, while h2 was left-justified, italic, and only slightly larger than the body text, and a normal bottom margin ("datelines" that occured 3-4 times per chapter). |
||
02-05-2024, 01:28 PM | #77 | |
Evangelist
Posts: 419
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
|
Quote:
I have no idea what it looks like on devices I don't own. Last edited by nabsltd; 02-05-2024 at 01:31 PM. |
|
Advert | |
|
02-05-2024, 01:58 PM | #78 | |
the rook, bossing Never.
Posts: 11,660
Karma: 87654321
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
On physical epub readers with user line-height, like a Kobo, it's fixed if it's set in the ebook. If there is no setting, then the user can change it easily from no spacing to more than double spaced. The font metrics set larger relative spacing for larger fonts.
Also you see the absolute space is different on different fonts of the same size. There is less control on a Kindle, but none if the line-height is set. I forget what the iRiver, Sony, Nook etc do. Different Andriod apps behave differently. KOReader can override CSS like line-height. Many apps won't. I don't like naked tags. I think it's less error prone that at least <p> and <hx> have classes in the CSS. This is a good point: Quote:
Last edited by Quoth; 02-05-2024 at 02:03 PM. |
|
02-05-2024, 03:16 PM | #79 | ||
Resident Curmudgeon
Posts: 74,627
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Quote:
|
||
02-05-2024, 03:29 PM | #80 | |
Resident Curmudgeon
Posts: 74,627
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
Advert | |
|
02-05-2024, 03:31 PM | #81 | |
Resident Curmudgeon
Posts: 74,627
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
02-06-2024, 03:07 AM | #82 | ||
Zealot
Posts: 131
Karma: 9236
Join Date: Jun 2020
Device: Kindle PW3 [KOReader]
|
Quote:
Quote:
It does makes sense not to style h1, h2 etc. and focus on their semantic roles (which would be akin to the no-style, [Basic Paragraph] in InDesign), so I may end up not styling them in practice, but that means I will end up with declarations for .regularchapter and .exception, the latter of which might be longer than if I had used styled bare tags, am I correct (if I wanted, say, a sans-serif font for both)? It would also make no difference if they were attached to h1 or not, since I wouldn’t be able to use them elsewhere and they would make the style sheet a little harder to follow (it’s easier for me to parse h1.exception than .exception). Last edited by paperwhite13; 02-06-2024 at 03:50 AM. |
||
02-06-2024, 10:20 AM | #83 | |
Resident Curmudgeon
Posts: 74,627
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
The rule is to keep it simple and <p class="codebloat"> and <h1 class="idontneedaclasshere"> is not keeping it simple. |
|
02-06-2024, 11:55 AM | #84 |
Evangelist
Posts: 419
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
|
I did not post a screenshot of my test when not using line-height on KFX. How can you say it's noticed and terrible?
With line-height, KFX makes the line space smaller than default. This is likely caused by an error on my part with picking the right number for the line-height. Without line-height, KFX adds about 1 pixel of extra line height per extra em of the initial capital. So, a 4em capital adds about 3 pixels. This is not very noticeable. Without line-height, KF8 adds about 1 line of extra line height per extra em of the initial capital. This is insanely ugly. Again, KFX for the win. |
02-06-2024, 12:23 PM | #85 | |
Evangelist
Posts: 419
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
|
Quote:
In my library, a 188,000 word EPUB with <p class="para-indent"> is 829,165 bytes. In that EPUB, there are 6,207 p elements with that classname. Changing it to just <p> shrinks the EPUB to 824,776 bytes, a miniscule savings of 4,389 bytes, or less than 1 byte per paragraph. To put it another way, on a device with 32GB of storage, the you could hold 38,593 "bloated" books, but only 205 more if you remove the "bloat". The use of a meaningful class name far outweighs the space savings. And, it doesn't really matter how long the class name is. Changing to <p class="ThisIsFarTooLongAClassNameToType"> increases the overall size to 833,321. This is an increase of less than 1 byte per paragraph, and it's a ridiculously long class name that would never be used for real. OTOH, removing the cover saves 336,714 bytes. That's a lot more "bloat" than anything caused by the HTML and CSS markup. |
|
02-06-2024, 02:54 PM | #86 | |
the rook, bossing Never.
Posts: 11,660
Karma: 87654321
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Quote:
https://en.wikipedia.org/wiki/ZIP_(f...ession_methods You can rename a whatever.epub to .zip and unzip it with your desired archive tool. If you are a only having a plain text editor and an archive tool you could even make an epub, though knowing structure of the system text files rather than just the HTML and CSS content is a challenge. So 10,000 instances of a really long class name really is little more than one instance. Jon: Zip uses LZW and/or deflate Original LZW replaces matching arbitrary length data with a 12 bit code (one and a half bytes). https://en.wikipedia.org/wiki/Lempel...%E2%80%93Welch Deflate https://en.wikipedia.org/wiki/Deflate Is more computation to compress and uses some similar ideas. There is never bloat. Having it human readable for maintaining or fixing bugs in automatic epub generation is important. Last edited by Quoth; 02-06-2024 at 02:58 PM. |
|
02-06-2024, 03:04 PM | #87 | |
the rook, bossing Never.
Posts: 11,660
Karma: 87654321
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Quote:
Illustrated / picture books. Designers adding big fonts and not subsetting (some non-asian ones won't). Class names are not an issue. |
|
02-06-2024, 06:06 PM | #88 | ||
Resident Curmudgeon
Posts: 74,627
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Quote:
Of course, the simple solution is to edit the KF8 eBook and remove the code for the large letter as it's not needed and the book can easily do without it. |
||
02-06-2024, 06:11 PM | #89 | |
Resident Curmudgeon
Posts: 74,627
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
02-07-2024, 03:00 AM | #90 |
Zealot
Posts: 131
Karma: 9236
Join Date: Jun 2020
Device: Kindle PW3 [KOReader]
|
Dear people, I understand you have some axes to grind about what is and what isn’t "code bloat" and I hope it gets settled , but at this point all the KF8 and KFX talk has very little to do with the topic? I'm really grateful for the replies I've gotten so far, but I see no use in going through the same points over and over again.
Last edited by paperwhite13; 02-07-2024 at 03:44 AM. |
Tags |
indesign, sigil |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Any Addons that aid in Library Cleanup and/or metadata repair/cleanup? | Meido | Calibre | 2 | 01-17-2018 03:49 AM |
Adobe InDesign and poor code | JSWolf | ePub | 15 | 01-18-2017 01:02 PM |
HTML cleanup on epub conversion | Lofwyr23 | Conversion | 4 | 06-06-2014 04:56 PM |
EPUB Expert Needed: Cant properly export epub from InDesign | crottmann | ePub | 17 | 08-27-2010 10:23 AM |
InDesign and epub | FredD | ePub | 2 | 04-13-2009 08:38 PM |