Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-04-2021, 06:10 PM   #151
phillipgessert
Addict
phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.
 
phillipgessert's Avatar
 
Posts: 311
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
Quote:
Originally Posted by KevinH View Post
So it appears that your system PATH environment variable is set improperly.
Thank you again for this--you are absolutely right, my PATH was all wrong. I think that in an earlier attempt, upon the plugin not finding mono, I added a line to /etc/paths that pointed to that capital-M Mono. Got rid of that line and reinstalled mono, and now everything mono-related seems pretty normal ('which mono' returns the results you shared, as does 'find ./ -name "mono"' within that folder). Running 'mono' in Terminal also works to show usage info.

Plugin still doesn't find it, though--tried removing and reinstalling both mono and the plugin a couple times, no dice. I'll tinker a bit more--I've actually never used this plugin, just wanted to try it out as it seems pretty useful. You gave me a heck of a lot of help here and I'm grateful for it--if nothing else, I now have a repaired mono install.
phillipgessert is offline   Reply With Quote
Old 10-04-2021, 06:32 PM   #152
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,635
Karma: 5433388
Join Date: Nov 2009
Device: many
Have you tried logging out and relogging in as I thoght the /etc/paths were only read on login. To be safe, you could just do a restart.
KevinH is online now   Reply With Quote
Old 10-05-2021, 11:52 AM   #153
phillipgessert
Addict
phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.
 
phillipgessert's Avatar
 
Posts: 311
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
Yep, thought of that too--rebooted a couple times, each time double-checked with 'which mono' in Terminal before trying the plugin (also tried removing/reinstalling the plugin a few times), no luck. Quite a pickle.
phillipgessert is offline   Reply With Quote
Old 10-05-2021, 01:35 PM   #154
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,635
Karma: 5433388
Join Date: Nov 2009
Device: many
Do you have a mono.commands folder in /etc/paths.d/ ?

Not sure why a newly created plugin python process would not inherit the system PATH that you are seeing in any new Terminal.app now.

Very strange. Could the EPUBOptimizer have stashed the wrong path someplace. You might want to try manually removing that plugin and any preferences folder it created and try again.
KevinH is online now   Reply With Quote
Old 10-05-2021, 01:45 PM   #155
phillipgessert
Addict
phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.
 
phillipgessert's Avatar
 
Posts: 311
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
I have a mono-commands (with a dash) file there, but not a mono.commands (with a dot) folder. Wonders never cease!

I will try wiping out the plugin and perhaps I'll also poke around to see if there are other plugins that also use mono to see if they fail for me as well.
phillipgessert is offline   Reply With Quote
Old 10-05-2021, 01:47 PM   #156
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,635
Karma: 5433388
Join Date: Nov 2009
Device: many
I may have misremembered that name. I am not in front of my mac to check.

Look for a plugin preferences folder and delete it too.
KevinH is online now   Reply With Quote
Old 10-05-2021, 05:55 PM   #157
phillipgessert
Addict
phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.
 
phillipgessert's Avatar
 
Posts: 311
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
I didn't find anything for it in the plugins_prefs folder, but I deleted the plugin and reinstalled, same result. I don't know how helpful this is, but the plugin version is 0.73, which I believe is the latest. Also I realize at a certain point we're getting into lost cause territory here, I'm OK knowing I may not be able to join the ePUB Optimizer club just yet. Had to give it a shot!
phillipgessert is offline   Reply With Quote
Old 10-05-2021, 06:01 PM   #158
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,635
Karma: 5433388
Join Date: Nov 2009
Device: many
You seem to have everything done properly. The built in python3 interpreter that comes with Sigil on macOS should have no issues running mono if Terminal.app "which" finds it properly.

If you ever want to track this down further just pm me.
KevinH is online now   Reply With Quote
Old 10-06-2021, 11:35 AM   #159
phillipgessert
Addict
phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.
 
phillipgessert's Avatar
 
Posts: 311
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
Thanks, Kevin--I'll definitely come back to it at some point. Thanks again for all the help here, very much appreciated.
phillipgessert is offline   Reply With Quote
Old 11-09-2021, 05:47 PM   #160
Peter Ahlstrom
Connoisseur
Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.
 
Posts: 75
Karma: 500000
Join Date: Oct 2011
Location: Utah
Device: iPad
phillipgessert, I fixed it on my mac. Open ePUBOptimizer/plugin.py in a text editor and find line 87:

args = ["mono", exe_path]

Change it to:

args = ["/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono", exe_path]

Then the plugin will run correctly. You may need to trash plugin.pyc.

Why calling mono from its explicit path works while just using the bare command does not, I have no idea.

Also it's the slowest Sigil plugin I have. Takes at least 3 minutes to finish.

Last edited by Peter Ahlstrom; 11-09-2021 at 05:50 PM.
Peter Ahlstrom is offline   Reply With Quote
Old 11-09-2021, 06:28 PM   #161
Peter Ahlstrom
Connoisseur
Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.
 
Posts: 75
Karma: 500000
Join Date: Oct 2011
Location: Utah
Device: iPad
...Except wow, the font embedding screws up the font's character encoding. The font wasn't showing correctly, so I opened the subsetted font up in FontForge and the characters are all wacky. Characters are assigned these names:
! : carriage return
# : space
& : exclam
( : quotedbl

etc. I'm going to change the encoding of the original font and then subset it again and see what happens.

OK, I did that, and it did not help. When I opened the subsetted font in FontForge, it said the encoding was UnicodeBmp. So I took the original font and changed its encoding from Glyph Order to UnicodeBmp, then put that in my ePub and ran the plugin again. The result was exactly the same: character names still screwed up.

I don't know how to fix this, but at least now I know which characters I need for the subset, so I'm just going to do it manually in FontForge...

Note: the other Sigil plugin that subsets fonts did not have this problem, but it goes by all the characters in the whole ePub, not the spots where that particular font is actually used.

EDIT: Well, never mind that, this plugin also does not base the subsetting on where that particular font is actually used. Guess I'll just go back to my wholly manual method.

Last edited by Peter Ahlstrom; 11-09-2021 at 06:53 PM.
Peter Ahlstrom is offline   Reply With Quote
Old 11-09-2021, 07:39 PM   #162
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by Peter Ahlstrom View Post
...Except wow, the font embedding screws up the font's character encoding. The font wasn't showing correctly, so I opened the subsetted font up in FontForge and the characters are all wacky. Characters are assigned these names:
! : carriage return
# : space
& : exclam
( : quotedbl

etc. I'm going to change the encoding of the original font and then subset it again and see what happens.

.../...

Note: the other Sigil plugin that subsets fonts did not have this problem, but it goes by all the characters in the whole ePub, not the spots where that particular font is actually used.

EDIT: Well, never mind that, this plugin also does not base the subsetting on where that particular font is actually used. Guess I'll just go back to my wholly manual method.
Hi

Maybe, "the other Sigil plugin that subsets fonts" is SubsetFonts?

If this is so, some comment about it. Say, your ePub is written mostly with font-family A. It also uses some few characters from a Chinese font B (this one is sparsely used with some spans here and there), or for that matter any other font-family.

After using the plugin, A and B will both be subsetted. So, the Fonts folder in the ePub will include both of them. It then maybe easier, if need be, to just replace font-family A in this folder by a full version of it rather than fiddling with FontForge...

My two-cents.
roger64 is offline   Reply With Quote
Old 11-10-2021, 01:30 PM   #163
Peter Ahlstrom
Connoisseur
Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.Peter Ahlstrom ought to be getting tired of karma fortunes by now.
 
Posts: 75
Karma: 500000
Join Date: Oct 2011
Location: Utah
Device: iPad
Yes, SubsetFonts is the other plugin I was thinking of, but I didn't have the exact name off the top of my head.

Sure, any automatic process (or not subsetting at all) is easier than using FontForge. But as I see it, the entire point of subsetting fonts is to only include in the font those characters that are actually used from that font by the ebook.

For example, I don't use an embedded font for the body text—only for headings and (usually) the first 3 words of each chapter. The body of my book includes the word "café" but the headings and first 3 words do not. When I ran either SubsetFonts or ePUBOptimizer, the resulting subsetted version of the heading font included the character é. Which will never get used, among a few other extraneous characters. (I do appreciate that the ligatures were subsetted by ePUBOptimizer.)

ePUBOptimizer also subsetted & and #, which don't even appear in the body text—only in html entities.

The version of the manual process I used this time was:
1. Use Calibre to convert the ePub to HTMLZ
2. Unzip the file
3. Open the html in Word
4. Use Find Format to delete any text in the default body text font
5. Copy everything that's left into BBEdit
6. Add a line break after each character
7. Process duplicate lines, case sensitive, leaving one
8. Sort lines
9. Remove line breaks
10. Use the resulting list: (space),-.0123456789ABCDEFGHIJLMNOPRSTUVWYabcdefghiklmnoprs tuvwxyz®’“”
to determine which characters to keep in FontForge, plus (CR)fifl (which do get used in this book by readers that do ligatures automatically).

It would be possible to do all of that in a plugin—take each @font-face from the CSS, see which tags use that font-face, process only the text included in those tags in the ePub to find the unique characters. It would also be possible to do the ligature selection algorithmically, before the unique characters are found.

I've kludged some things together in python in the past, so maybe I could take a stab at adjusting SubsetFonts before the "# get rid of the tags" section, but someone who actually knows what they're doing could do it better and in a fraction of the time. I like a challenge, so maybe I'll take some Saturdays and try it anyway. I've never touched C#, so trying to alter ePUBOptimizer is beyond me.
Peter Ahlstrom is offline   Reply With Quote
Old 11-12-2021, 06:21 AM   #164
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Peter Ahlstrom View Post
The version of the manual process I used this time was: [...]
My Sigil SubsetFonts plugin is certainly less sophisticated than the Calibre Polish book tools, however, since the Python library used for subsetting also recompresses fonts, the resulting subset fonts are often smaller than the subset fonts generated by the Calibre Polish tools.
BTW, you could also use the command line version of Polish books to subset fonts.
Doitsu is offline   Reply With Quote
Old 11-12-2021, 01:19 PM   #165
phillipgessert
Addict
phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.
 
phillipgessert's Avatar
 
Posts: 311
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
Quote:
Originally Posted by Peter Ahlstrom View Post
phillipgessert, I fixed it on my mac. Open ePUBOptimizer/plugin.py in a text editor and find line 87:

args = ["mono", exe_path]

Change it to:

args = ["/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono", exe_path]

Then the plugin will run correctly. You may need to trash plugin.pyc.

Why calling mono from its explicit path works while just using the bare command does not, I have no idea.

Also it's the slowest Sigil plugin I have. Takes at least 3 minutes to finish.
Thank you very much for the suggestion, I'll give it a shot when I get a chance, and I'll come back either way.
phillipgessert is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Comic optimizer script rhon Kobo Reader 0 11-08-2012 06:04 PM
Mokle - Mangas Optimizer for Kindle devorez Kindle Developer's Corner 11 08-14-2012 07:15 PM
Patent/Heavy graphics pdfs and Adobe PDF Optimizer andrewscheinman iRex 4 12-26-2009 11:39 AM
epub, ePub, EPUB, warum blos ePub? flowoeB Lounge 5 11-27-2009 09:37 AM
PRS-500 PDF file optimizer phigdon Sony Reader Dev Corner 1 04-01-2007 11:40 PM


All times are GMT -4. The time now is 02:44 PM.


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