|
|
#106 | |
|
Enthusiast
![]() Posts: 33
Karma: 10
Join Date: Feb 2011
Device: Android Tablet
|
Quote:
|
|
|
|
|
|
|
#107 | |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,356
Karma: 62500000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Sorry, but that makes little sense (as a 1 click) FIND search1, But don't pause or replace. FIND search2, But don't pause or replace. A simple search for 1 of multiple values: [red!black] , but again, Editor chains is for an AUTOMATED task and you want a STOP for manual |
|
|
|
|
|
|
#108 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 90
Karma: 6698
Join Date: Sep 2022
Location: South Africa
Device: kindle pw10
|
New action request
Hi,
Thanks for all your work. I would like to request an additional action. Remove all fonts. I do not use any of the fonts in a book and rely on the font I select on my reading device. Just a help in the cleanup.
|
|
|
|
|
|
#109 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,356
Karma: 62500000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
It is a conversion option: (at the bottom)
On the Styling tab or Preferences: Common Options: if you want it as the default |
|
|
|
|
|
#110 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 90
Karma: 6698
Join Date: Sep 2022
Location: South Africa
Device: kindle pw10
|
Thanks for the tip.
Didn't work for me though. Tried adding an epub- still there. Converted epub to epub - still there. Will try some more. Maybe there is another setting somewhere. Last edited by skil-phil; Yesterday at 01:58 AM. Reason: Spelling |
|
|
|
|
|
#111 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 90
Karma: 6698
Join Date: Sep 2022
Location: South Africa
Device: kindle pw10
|
Found it does remove fonts that are not imbedded.
Imbedded fonts remain. Now to try to automate unembeding them. Thanks Last edited by skil-phil; Yesterday at 01:58 AM. |
|
|
|
|
|
#112 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,218
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
The plugin has a generic "Remove files" action. It supports regex, so you can use it to remove fonts with this regex
Code:
(?i).+\.(otf|ttf)$ Attached below is a sample chain. Please test and verify before saving your books. |
|
|
|
|
|
#113 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 90
Karma: 6698
Join Date: Sep 2022
Location: South Africa
Device: kindle pw10
|
Thanks capink,
That worked and removed them from the file browser. They still show in the manage fonts dialogue though. Is this a problem? Can I just ignore it? Thanks |
|
|
|
|
|
#114 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,218
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Manage font dialog will show any font referenced in any CSS rule, with the embedded font having a "✓" sign next to it, as opposed to non embedded fonts. If you want to delete all fonts and all references to them as done in the Manage fonts dialog, you can use this custom action which is based on the remove fonts functionality in "Manage fonts dialog":
Code:
from calibre.ebooks.oeb.polish.fonts import change_font, font_family_data
from calibre_plugins.editor_chains.actions.base import EditorAction
class RemoveAllFonts(EditorAction):
name = 'Remove All Fonts'
headless = True
def run(self, chain, settings, *args, **kwargs):
container = chain.current_container
font_data = font_family_data(container)
for font in font_data.keys():
change_font(container, font)
def validate(self, settings):
return True
Note: Using the above method, you will lose all the font formatting even if the font is installed on your device, as the function deletes all font-family properties from the epub. This apply to previously embedded as well as non-embedded fonts. Last edited by capink; Yesterday at 07:09 AM. |
|
|
|
|
|
#115 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 90
Karma: 6698
Join Date: Sep 2022
Location: South Africa
Device: kindle pw10
|
Thank you.
All good now. Your hard work certainly makes life easier for users. Cheers. |
|
|
|
|
|
#116 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 90
Karma: 6698
Join Date: Sep 2022
Location: South Africa
Device: kindle pw10
|
Hi,
I also found that I needed to add the following to the Remove all fonts chain. Search and replace "font-family: (.*?);" with "" in All Style Files. Cheers |
|
|
|
|
|
#117 | |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,356
Karma: 62500000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Calibre (editor debug) will issues a warning if no generic font is declared in a "font-family" |
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Editor Plugin] EpubCheck | Doitsu | Plugins | 220 | 11-09-2025 06:12 PM |
| [Editor Plugin] LanguageTool | Doitsu | Plugins | 17 | 04-20-2024 03:21 PM |
| [Editor Plugin] - Enabling 'Customize plugin' dialog directly from the Editor | thiago.eec | Development | 7 | 01-09-2019 09:05 PM |
| Sample Plugin for the Editor | DiapDealer | Editor | 77 | 12-10-2014 08:16 AM |
| Editor plugin question | DiapDealer | Development | 2 | 07-28-2014 11:23 PM |