![]() |
#151 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 312
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#152 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,504
Karma: 5703586
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.
|
![]() |
![]() |
Advert | |
|
![]() |
#153 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 312
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.
|
![]() |
![]() |
![]() |
#154 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,504
Karma: 5703586
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. |
![]() |
![]() |
![]() |
#155 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 312
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. |
![]() |
![]() |
Advert | |
|
![]() |
#156 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,504
Karma: 5703586
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. |
![]() |
![]() |
![]() |
#157 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 312
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!
|
![]() |
![]() |
![]() |
#158 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,504
Karma: 5703586
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. |
![]() |
![]() |
![]() |
#159 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 312
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.
|
![]() |
![]() |
![]() |
#160 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#161 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#162 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#163 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#164 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,689
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
BTW, you could also use the command line version of Polish books to subset fonts. |
|
![]() |
![]() |
![]() |
#165 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 312
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |