I have thought about this for a while. I think I will start working on the following in the weekend (depends on a lot of personal stuff...):
- ability to select an ePUB
- parse XHTML to find all characters in use by a certain CSS class
- open the used fonts in the ePUB and shrink it according to the used characters for that font
- replace the fonts in the ePUB by the shrinked ones.
Don't expect it to be ready soon though, it needs quite some testing and the most difficult part will probably be the parsing of the stylesheet to find the classes where a font is defined/used. It might be that an intermediate version will be created where the styles class names have to be entered manually.
As as special service to JSWolf (
) I will automatically add the ligatures to the unique characters used.