Quote:
Originally Posted by theducks
Calibre support embedding fonts, but this seems redundant (and a space hog) for many devices that have the provision to use Device (system) fonts
(only provide support for CSS, Font declarations)
When sending to device:
1) Query CSS for @Font callouts
2) Add the FONT (if needed) to Device Font folder <move from the book?>
3) adjust the CSS font SRC as needed
4) remove the embedded font
send skinnier book 
|
I could see something like this working in a few different ways. One is within the library in the way Polish Books or convert work. Or as part of the Modify ePub plugin. That already has font removal, but I don't know if it fixes references.
An alternative is during send-to-device. The books are already being modified to update the metadata and covers. Stripping the fonts could be done there. It would need support in the device drivers to report the fonts on the device and if anything special is needed to fix references. The advantage of this is that it doesn't change the in-library copy, so that if you use multiple devices you get a copy that is appropriate for each.
Another way would be a plugin that wraps send-to-device. That could prepare the book and then call send-to-device to send the modified version rather than the in-library copy.
Lastly, a driver could be written that subclasses the existing drivers. The KoboTouchExtended driver already does this and it would be "easy" to add this function to that driver. The disadvantage of this is that an extra driver needs to be written for each device that needs the support.
I know the first and last would be doable. I'm not sure about the other two. The second is the way I'd prefer to do it, but is probably the most work.
Oh, one thing I probably wouldn't do is to automatically send the fonts to the device. I would probably write it to check the font is on the device, and if it is strip it from the book. If the font isn't there, I'd leave it alone. A danger of sending the font is if subsetting has been done. You might end up with a font on the device that doesn't support all the characters in all the books.