![]() |
#1 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 769
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
Font-Size Every Couple of Words
Well, this is a new one. Started editing the CSS of another book that I'm reading, and every couple of words, they reset the font-size to the same value. I even went back to my original, archived azw3 from Amazon and confirmed it: everything's in one file, everything's run together into one blob, and "<span style=" font-size:0.96rem">" every handful of words:
Quote:
|
|
![]() |
![]() |
![]() |
#2 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,914
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
What book is this?
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,914
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Search and replace [code] style="font-size:0.96rem; line-height:120%; text-align:justify"[/code Search Code:
<span style=" font-size:0.96rem"> Code:
<span> |
|
![]() |
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 769
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
Jack L. Chalker's "A Snake in the Grass" (ASIN : B0057U12SM) Book one of his "The Four Lords of the Diamond" series:
https://www.amazon.com/gp/product/B0...oreType=ebooks And thank goodness for Diap's Editing Toolbag. I can't imagine having to re-format that without it. That allowed me to pull out a lot of those spans, convert others and get rid of the left over empty spans and divs. This is the first book I've seen with everything dumped into a single file (~500kb). I'm actually surprised it would load decently on an old Kindle. My computer was spinning furiously when I tried messing with the original. I'm guessing that this came over from a pdf, converted it to text, and stuck those spans on the beginning and end of every line. Although it does have this at the top: Code:
<meta name="generator" content="Aspose.Words for .NET 9.7.0.0"/> Last edited by enuddleyarbl; 09-12-2022 at 12:25 PM. |
![]() |
![]() |
![]() |
#5 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,914
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
At least fixing the mess in the HTML files is fairly easy. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,581
Karma: 14328510
Join Date: Nov 2019
Device: none
|
Quote:
In the long run I find it quicker and easier to be very heavy handed and delete all of their CSS and replace it with my simplified CSS: Code:
body { font-size: 100%; border: 0; margin: 0; padding: 0; width: auto; } body * { line-height: inherit; } p { font-size: 100%; margin: 0; padding: 0; border: 0; text-indent: 2em; } a { color: inherit; text-decoration: none; } h1,h2,h3,h4 { text-align: center; } .bold { font-weight: 900; } .italic { font-style: italic; } .bold_italic { font-weight: 900; font-style: italic; } When you do this all of your books will have the same font size, line spacing, margins, etc. because it's using the ereader's built in CSS for everything that's not specified here. All of the classes in the HTML are ignored since there's nothing for them in this simplified CSS. |
|
![]() |
![]() |
![]() |
#7 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 260
Karma: 2092424
Join Date: Oct 2011
Location: Arlington, TX
Device: Kindle PW4, Moon+ Reader on a cheap Android tablet
|
The publisher of that book is Phoenix Pick - which explains the horrific code.
|
![]() |
![]() |
![]() |
#8 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 769
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
Way back at the beginning of time, I had Calibre convert that azw3 over to epub. It tried its best to clean it up. For instance, those "style=" spans all got converted to class="calibre\d" spans. It also added the spacing back in and managed to split the chapters into their own files. But, the "front matter" pages didn't have any heading markers, so they got dumped into one file.
I was just amazed at the original azw3 when I went back to see what was originally there. And, yep, I do have my own set of css classes that I bring into each book so I can re-format it. |
![]() |
![]() |
![]() |
#9 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,914
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
For example, in most eBooks, there is no indent for <p> and by putting one in, you then sometimes have to add a text-indent: 0; for the classes that have a center and for any classes that expect there not to be an indent. As for your simplified CSS, I've simplified it even more. Code:
body { widows: 1; orphans: 1; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; text-align: justify; } p { margin-top: 0; margin-bottom: 0; text-indent: 1.2em; } h1,h2,h3,h4 { text-align: center; } .bold { font-weight: bold; } .italic { font-style: italic; } .bold_italic { font-weight: bold; font-style: italic; } |
|
![]() |
![]() |
![]() |
#10 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 769
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
I'd seen that, too. I don't know anything about them, but I went off to their website to make sure I hadn't bought a counterfeit 8 years ago on Amazon. But, Phoenix Picks site points to that same Amazon page where it says I bought it all those years ago.
|
![]() |
![]() |
![]() |
#11 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,914
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#12 |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,581
Karma: 14328510
Join Date: Nov 2019
Device: none
|
I've had books that use div tags instead of p tags. And ones that have a space entity wrapped by p tags, between every paragraph, to make a blank line between paragraphs. There's no end to the crazy stuff.
|
![]() |
![]() |
![]() |
#13 | |
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 |
|
![]() |
![]() |
![]() |
#14 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,914
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#15 | |
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:
I have NOT tested it since they announced that KC would now, in beta, be able to export ePUB files. Honestly...kinda afraid to look, to see what on earth they're doing in there. I was so gobsmacked by the divs and /brs all over the place, inside KC that...well, possibly may be scarred for life. I may have Post-eProduction Stress Syndrome. May take me decades to get over it. :-) H |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Moon+ Reader your favorite font and font size? | loodio | Android Devices | 6 | 01-30-2016 06:50 PM |
Problem changing font size using font size key | Waylander | Conversion | 0 | 10-02-2013 03:30 PM |
Determine font and font size on incoming epub? | peaceridge | Calibre | 4 | 01-30-2012 03:35 PM |
PRS-300 Med font size too big, but small font size too small | eli2k | Sony Reader | 4 | 05-28-2010 09:47 AM |