04-29-2012, 10:14 AM | #61 |
Addict
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Many thanks, kiwidude.
Got it. The only downside is that calibre removes these font declarations from the css and puts them in every html/xhtml file when doing a epub -> epub conversion - I don't know why calibre does this. So I usually open the css file after removing the fonts and delete the font declarations. |
04-29-2012, 10:57 PM | #62 | |
US Navy, Retired
Posts: 9,867
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
|
|
Advert | |
|
04-30-2012, 05:10 AM | #63 |
Addict
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
|
05-03-2012, 05:20 PM | #64 |
Calibre Plugins Developer
Posts: 4,688
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Modify ePub next version beta
I've moved a bunch of recent posts from this thread about other additions I may make to this plugin over on the related thread in the Development forums, but will try to keep the hopefully slightly less technical discussions on this thread.
The new features intended for this next release can be seen in the screenshot below:
This is a beta version!. Please make sure you have a backup of your ePub(s) you are modifying when you are experimenting with these new options in case I have badly screwed up. I've given them a quick whirl as a sanity check but there could be edge cases I've missed. Also note there is a new beta version of the Quality Check plugin here which has matching checks for all of the above. So please feel adventurous and install both together to more easily test them. Feedback very much welcomed before I officially release it. The other features I am considering working on can wait for a future version... Last edited by kiwidude; 05-04-2012 at 08:16 PM. Reason: Removed attachment as latest version officially released |
05-03-2012, 08:20 PM | #65 |
Resident Curmudgeon
Posts: 76,513
Karma: 136565488
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
When this plugin is used, does Calibre do any modification to the ePub other then the function(s) of the plugin being used? For example, removing the page-template file and links, is the ePub the same other then these missing things?
|
Advert | |
|
05-04-2012, 03:25 AM | #66 |
Addict
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
|
05-04-2012, 04:00 AM | #67 |
Addict
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
@kiwidude: currently testing this beta and it's working great but it looks like you have to do a couple of passes to remove every checked option.
With "Remove inline @font-face declarations" checked and the three Adobe options checked, this is what I've seen: In the first pass, it removes the declarations and the xpgt file. In the second pass, it removes the Adobe DRM meta tags if found. In the third pass, it removes the link to the xpgt file. No ill effects observed. Great work ! Last edited by paulfiera; 05-04-2012 at 04:06 AM. |
05-04-2012, 04:02 AM | #68 | |
Calibre Plugins Developer
Posts: 4,688
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Quote:
So if you choose the xpgt files & links option for example, the only change that should be made is to the opf file to remove the reference to the xpgt, the xpgt file itself will be deleted, and then on each html page that had a <link .../> it will do a simple raw text regex based replacement of just that. |
|
05-04-2012, 04:17 AM | #69 |
Calibre Plugins Developer
Posts: 4,688
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
@paulfiera - three passes should not be necessary (that is what it does internally in the code, but you should only have to click the ok button once). I must admit I only tested the options individually as I wrote them, I'll take a look at this shortly.
|
05-04-2012, 04:37 AM | #70 |
Addict
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Thanks, kiwidude.
This seems to happen when the three conditions are met:
I've tested it by running the plugin and opening the epub in Sigil. And it looks like the removal of these elements always happens in the same sequence. |
05-04-2012, 04:48 AM | #71 |
Calibre Plugins Developer
Posts: 4,688
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Ok, cool. It does bring up another question I meant to ask - do the removal of @font-face declarations have to be so granular? At the moment removing embedded fonts, css @font-face and html @font-face delcarations are three separate options.
I would anticipate most users being happy to just tick "Remove embedded fonts" and have it also remove *any* font-face declarations. Are there any scenarios at all where this would not be the case? |
05-04-2012, 05:00 AM | #72 | |
Addict
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Quote:
My vote for the "Remove embedded fonts" checkbox taking care of everything. Fonts and declarations. |
|
05-04-2012, 06:22 AM | #73 |
Grand Sorcerer
Posts: 6,225
Karma: 16536676
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
My 2p's worth... epubs with embedded fonts should also have @font-faces (in either css or html). Other epubs will have @font-faces (in either css or html), but no embedded font files, i.e. referencing external font files. I would be happy to have a single 'Remove embedded fonts' option which handles both scenarios. I don't need to know which scenario was found, I just want it all gone.
|
05-04-2012, 06:34 AM | #74 |
Calibre Plugins Developer
Posts: 4,688
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Thanks folks, I have rolled them all together for the next version I will post shortly. Paul I found the bug in the "individual step" stuff you were having to do so that will be sorted too.
It does beg the question as to whether Quality Check needs two checks then - should it just have a single "Check @font-face" which looks at both css and html files? The log can display where it found them... |
05-04-2012, 06:47 AM | #75 |
Addict
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
|
Tags |
modify epub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Quality Check | kiwidude | Plugins | 1214 | 11-14-2024 12:05 PM |
[GUI Plugin] Manage Series | kiwidude | Plugins | 167 | 07-28-2024 04:07 PM |
[GUI Plugin] Open With | kiwidude | Plugins | 403 | 04-01-2024 09:39 AM |
Modify ePub plugin dev thread | kiwidude | Development | 346 | 09-02-2013 06:14 PM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 01:27 PM |