06-05-2011, 08:11 AM | #1 |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Removing embedded fonts from ePubs
I've noticed that some epubs have embedded 4 True Type Charis fonts making up for about 5 MBs. I'm not particularly fond of that font as I rather use the iPad's default Palatino which I think is good for reading on screen.
Two questions: - Will removing these fonts break anything in the epub? I believe that if the style sheet is referencing these fonts and they are not found, the rendering will default to the system font, correct? - Right now, for removing the fonts I explode the epub, remove the fonts from the fonts folder and rebuild the epub. Is there an option in the GUI to remove the embedded fonts - and perhaps all references to them in the style sheet? Many thanks |
06-05-2011, 08:49 AM | #2 |
Wizard
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
This is the first request I have seen to REMOVE embedded fonts. The normal question seems to be about how to ADD them!
|
06-05-2011, 09:45 AM | #3 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Removing them may cause breakage, it depends on how they are used. Sometimes special fonts are used for special characters/metrics. There's no automated way to remove fonts, though if you ask kiwidude may add it to his epub fixer plugin.
|
06-05-2011, 10:26 AM | #4 | |
Guru
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
Quote:
@paulfiera: I delete the font folder and also remove the references to the fonts in the stylesheet, (specifying my preferred system fonts instead). You may also need to remove them from the manifest, (OPF). |
|
06-05-2011, 01:35 PM | #5 |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Thanks, guys.
I know storage space in computers is cheap and I shouldn't be worrying about a couple of megs per book - that's what the 5 MB fonts come down to when packed in an ePub, but this is not the case with tablets. Especially with iPads, where you do not have the possibility of external storage. And when you want to add a couple of hundred ePubs to your iPad - where you already have music and videos, these fonts really fill up. I can only talk about iPad, as that's the only reader I've had, but it does a very decent job using Palatino as the default font. Sharp on the screen - for a serif font - and able to deal with non ASCII characters, from what I've seen. I've done some tests removing the fonts from a couple of ePubs and at first sight, there seems to be no problem. Agama, how would I remove them from the manifest? I'd also like to vote for an option to remove both the fonts and all the references to them - CSS, manifest - from the GUI. Kovid, should we ask kiwidude for this feature as an enhacement of the ePub fixer plugin or is it something you would consider adding to the main calibre program? |
06-05-2011, 01:41 PM | #6 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
epubfixer is the logical place for this.
|
06-05-2011, 01:52 PM | #7 |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
|
06-05-2011, 02:14 PM | #8 | |
Grand Sorcerer
Posts: 5,886
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
|
a possibility
Quote:
|
|
06-05-2011, 02:25 PM | #9 |
Resident Curmudgeon
Posts: 73,976
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
It sounds like the OP is using (GASP!) iBooks and the embedded fonts won't work unless you do something non-standard. And in that case, you can pick from whatever fonts are on the list and they'll be used instead of the embedded fonts. iBooks does a lot of things non-standard.
|
06-05-2011, 07:07 PM | #10 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
|
|
06-06-2011, 02:35 AM | #11 |
Guru
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
Open the OPF file in the exploded ePub, (often it's called content.opf), and look for the section starting <manifest>. The elements in this section are supposed to list all the files which make up the publication. Simply delete all elements which reference the Charis fonts. These elements show up as <item href= ... />.
The fonts should not be referenced in the <spine> or <guide> sections but delete their entries if they are. Note: Readers seem quite tolerant of ePubs where items present in the publication are NOT actually referenced in the manifest, so you may find that there are no references to the fonts - but it's best to check since a well formed ePub is likely to work on more readers than a poorly formed one. (I have known ADE fail to open books where I have created a faulty manifest section). |
06-06-2011, 04:49 AM | #12 | |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Quote:
Yes, I am using iBooks. This iPad is the only reader I've got and it works OK. Not so good to read under sunlight but I can't afford another reader right now. So, how would other readers behave if there is referenced a missing font in the style sheet? Wouldn't they default to a system font like browsers do? |
|
06-06-2011, 04:50 AM | #13 | |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Quote:
|
|
06-06-2011, 04:52 AM | #14 | |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Quote:
Great to know. Guess I'll be exploding a heck of a lot of epubs |
|
06-06-2011, 07:15 AM | #15 |
Guru
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
Maybe kiwidude can come to the rescue with another plugin! This might be a bit trickier than his Modify ePub as it would have to do a bit more parsing - and perhaps allow user definition of a substitute font-name whenever an embedded font reference is found in, (and removed from), the CSS.
I also seem to recall some discussions in this forum on installing ePub fonts as external fonts rather than embedding. This would mean that the fonts were only in a single location on a device and then shared by all ePubs which reference them. Haven't tried this yet myself but it could be worth looking into. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Embedded fonts? | Greenmantle | Kobo Reader | 66 | 07-27-2011 08:20 PM |
Removing embedded font/overwrite some css? | silentguy | Conversion | 4 | 01-25-2011 12:41 PM |
Embedded fonts, Calibre, and choice of fonts | AlexBell | ePub | 8 | 05-30-2010 06:00 AM |
Classic Support for embedded fonts in sideloaded EPUBs ? | nycaleksey | Barnes & Noble NOOK | 6 | 02-25-2010 11:10 PM |
Encypted Embedded Fonts in ePubs | pdurrant | ePub | 9 | 09-24-2009 03:34 PM |