Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 04-29-2012, 10:14 AM   #61
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Many thanks, kiwidude.

Got it.

Quote:
Originally Posted by kiwidude View Post
...leaving such orphaned declarations in the css file does absolutely no harm, and the reader will just fall back to using its default font which is what people wanted.
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.
paulfiera is offline   Reply With Quote
Old 04-29-2012, 10:57 PM   #62
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,867
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by paulfiera View Post
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.
During the ePub to ePub conversion have you tried selecting the option to completely remove all fonts? See attached.
Attached Thumbnails
Click image for larger version

Name:	fontremoval.jpg
Views:	1059
Size:	149.5 KB
ID:	85870  
DoctorOhh is offline   Reply With Quote
Advert
Old 04-30-2012, 05:10 AM   #63
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Quote:
Originally Posted by dwanthny View Post
During the ePub to ePub conversion have you tried selecting the option to completely remove all fonts?
Thanks, Walt.

Just tried it. Same results. Font declarations are moved from the css file to every html/xhtml file.

I really wonder why calibre does that.
paulfiera is offline   Reply With Quote
Old 05-03-2012, 05:20 PM   #64
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
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:
  • Remove Adobe .xpgt files and links - for completely clean xpgt file removal (deletes the file and the <link> references from the html files)
  • Remove Adobe resource DRM meta tags - to strip some Adobe cruft of a <meta> tag from the html files.
  • Remove embedded fonts - extended to also remove @font-face declarations from the CSS and html files
  • Remove unused image files - remove orphaned images not referenced from the html content to save space.
  • Flatten TOC hierarchy in NCX file - move all the navPoints in the NCX file to a single level if they are nested, to support devices that don't like a nested TOC

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...
Attached Thumbnails
Click image for larger version

Name:	Screenshot_1_Options.png
Views:	1046
Size:	28.4 KB
ID:	86041  

Last edited by kiwidude; 05-04-2012 at 08:16 PM. Reason: Removed attachment as latest version officially released
kiwidude is offline   Reply With Quote
Old 05-03-2012, 08:20 PM   #65
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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?
JSWolf is offline   Reply With Quote
Advert
Old 05-04-2012, 03:25 AM   #66
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Quote:
Originally Posted by kiwidude View Post
  • Remove Adobe .xpgt files and links - for completely clean xpgt file removal (deletes the file and the <link> references from the html files)
Thanks, kiwidude.

I never understood the meaning of this xpgt files. They are not really needed?
paulfiera is offline   Reply With Quote
Old 05-04-2012, 04:00 AM   #67
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
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.
paulfiera is offline   Reply With Quote
Old 05-04-2012, 04:02 AM   #68
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,688
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by JSWolf View Post
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?
That is exactly the ethos of this plugin. It does not use any of calibre's conversion pipeline code, nor does it do any css or html parsing/rewriting.

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.
kiwidude is offline   Reply With Quote
Old 05-04-2012, 04:17 AM   #69
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
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.
kiwidude is offline   Reply With Quote
Old 05-04-2012, 04:37 AM   #70
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
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:
  • - in line @font-face declarations.
  • - Meta DRM tag.
  • - Link to Adobe xpgt file.

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.
paulfiera is offline   Reply With Quote
Old 05-04-2012, 04:48 AM   #71
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
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?
kiwidude is offline   Reply With Quote
Old 05-04-2012, 05:00 AM   #72
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Quote:
Originally Posted by kiwidude View Post
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?
As I see it, once you have decided to remove the embedded fonts, both the inline and css @font-face declarations make no sense at all.

My vote for the "Remove embedded fonts" checkbox taking care of everything. Fonts and declarations.
paulfiera is offline   Reply With Quote
Old 05-04-2012, 06:22 AM   #73
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
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.
jackie_w is offline   Reply With Quote
Old 05-04-2012, 06:34 AM   #74
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
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...
kiwidude is offline   Reply With Quote
Old 05-04-2012, 06:47 AM   #75
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Quote:
Originally Posted by kiwidude View Post
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...
A single "Check @font-face" would be perfect.
paulfiera is offline   Reply With Quote
Reply

Tags
modify epub


Forum Jump

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


All times are GMT -4. The time now is 12:24 AM.


MobileRead.com is a privately owned, operated and funded community.