![]() |
#1 |
Member
![]() Posts: 12
Karma: 10
Join Date: May 2012
Device: Kindle Oasis 2, Kindle Paperwhite 4,Samsung Tab S,
|
Homogenise font size
Hi all...
...I'm currently reading a book that has an unusual font structure - the main body of text is in my "normal" font size of about 12pt (level 5 on Kindle) but whole chunks of the text (reminiscences of intervoewees etc) are in a drastically smaller size. These sections can go on for several pages at a time forcing me to "up" the text size to Kidle level 7. Is there any way I can re-process the book in Calibre to obtain a uniform font size throughout? Any assistance will be gratefully received! TIA |
![]() |
![]() |
![]() |
#2 | |
Hedge Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
|
Quote:
Some of my ebooks also may specify five or more font sizes all slightly different in the CSS (none in sub or superscript) Ranging from 0.91EM to 1.01EM. I do not think multiple font sizes like this makes the ebook look better so I change them all to the standard size. Last edited by Thasaidon; 11-12-2020 at 05:17 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#4 | |
Member
![]() Posts: 12
Karma: 10
Join Date: May 2012
Device: Kindle Oasis 2, Kindle Paperwhite 4,Samsung Tab S,
|
Quote:
The CSS specifies two font sizes - 1.125em and 0.75em - I changed them both to 1.125em and that seems to have solved the problem ( well, there's still a miniscule difference but almost imperceptible) |
|
![]() |
![]() |
![]() |
#5 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
You shouldn't willy-nilly change font sizes with knowing what you are changing. if you have the unchanged code, you can post samples so we can see what it is you are changing. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 450
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
|
I have a blunt-instrument approach that works for cases where the css is in em and there are small fonts:
Search for font-size: 0\.\d+em; Replace with: font-size: 1em; I run this on the css file(s) to get rid of those small sizes in quotations and so on. It doesn't fix everything, but it's helpful on many books. All the "0.nnem" sizes become 1em. There is a regex function that was posted here some long time ago that is also quite helpful, so probably worth repeating, that lets you redefine font size key words to em, and roll your own mapping: Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs): # Match from list of size keywords i = ["medium", "small", "large", "x-small", "xx-small", "x-large", "xx-large", "larger", "smaller"].index(match.group(1)) # Map of corresponding sizes. Adjust as needed. size = ["1em", "1em", "1.2em", ".9em", ".9em", "1.3em", "1.5em", "1.1em", ".9em"] return size[i] |
![]() |
![]() |
![]() |
#7 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
What I do is remove any funky font sizes. So if small is used for the base font size, I'll dump it and also fix x-small to small. I prefer no font size specified for the base font. Sometimes offset text is in a smaller size and I'll fix that as well. The more you work with the CSS, the more you'll learn and then you'll be able to edit better especially when the code is a mess (aka Vellum). |
|
![]() |
![]() |
![]() |
#8 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 450
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
|
Quote:
Since I'm mostly fixing up books just for my own elderly eyes, I can also let a lot of stuff slide: get the main text OK, and I don't much care if the copyright page is messed up...I won't be sharing it with anyone else. |
|
![]() |
![]() |
![]() |
#9 |
Hedge Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
|
|
![]() |
![]() |
![]() |
#10 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 210
Karma: 4491791
Join Date: Jul 2020
Location: South Africa
Device: Kindle PW4
|
Just make a rule in Transform styles, then when you convert to ebook it will be done.
Font-size is less than X Change the value to X . By playing around to can probably make all font size the same, including headings. My2c |
![]() |
![]() |
![]() |
#11 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
It's a lot better to learn to do this yourself. Then you can do it properly and have font sizes as you want them. And by doing it yourself, you learn CSS.
|
![]() |
![]() |
![]() |
#12 | |
Hedge Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
|
Quote:
I then moved on to using transform. Now I first run Remove unused CSS in Calibre editors . . It can be surprising how many unused rule it deletes It also stacks identical rules, again stacks can be surprisingly large. Now I am able to look at the CSS Rules and say, that one is redundant, that styles text in a way I do not like, and that one boils down to make the text italic. Then I delete the unwanted style rules and run Remove unused CSS in Calibre editors again. This will now remove styles from the html that had style rules in the CSS but they have been deleted. I then check what each of the remaing CSS rules do and look at their use in the html. If it does something I want, I change the rule name in the html to the name I use for the rule in my stylesheet I then delete the rule from the original stylesheet. Often these original rules only apply to a single word or letter. Eventually I often end up with a blank stylesheet. I then paste my standard CSS into the blank stylesheet. I love clips and snippets. I then just need to eyeball the code/preview to see if I have missed something somewhere. I finally run Remove unused CSS again to remove the unused rules from my stylesheet. Normally I am left with four or five rules. If there are tables, lists and/or lots of pictures in an eBook I do not touch the styling for these items and paste my CSS rules above them in the stylesheet. For a siimple novel this process can take about 20 to 30 minutes. For a complicated book where almost every word is individually styled it can take anything from 2 to 4 hours. Last edited by Thasaidon; 11-18-2020 at 07:49 PM. Reason: Multiple typos |
|
![]() |
![]() |
![]() |
#13 |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,586
Karma: 14328510
Join Date: Nov 2019
Device: none
|
You can just completely blow away the existing CSS. The ereader has somewhat reasonable defaults. Try opening the ebook in calibre's editor and renaming the css files, then save it, then open it in Calibre's viewer. It may not be pretty but it's usable.
(Although the above won't work in the unfortunate situation where there are style= things on the individual html tags. There's a special place in Hades for authors who do that.) |
![]() |
![]() |
![]() |
#14 | |
Hedge Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
|
Quote:
![]() Thanks for the suggestion. Two things 1.I enjoy tinkering with the eBooks' html 2. I like reading eBooks with my idiosyncratic styling |
|
![]() |
![]() |
![]() |
#15 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
I've never had an eBook take hours to fix. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |