Thread: ePUB Optimizer
View Single Post
Old 12-01-2014, 10:36 AM   #13
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by DiapDealer View Post
I'm not going to beleaguer the point (I'm not one to do much font embedding in the first place), but it does seem a little drastic to throw a font out on such a technical definition of "being used." It renders in ADE, Adobe's RMSDK, Sigil and calibre, so the font is clearly "being used" (even if it's being used improperly).

It just seems odd to me that doing nothing other than removing "font-weight: bold" from the "first-words" class, makes your plugin believe the font is suddenly being used (with no change to the @font-face declaration) ... and that adding the line back in renders the font "unused" once again.

I do understand the technical distinction, but it doesn't seem appropriate to me to delete font files (and their accompanying css references) that are, in fact, being used. Inappropriately perhaps, but "used" nonetheless.

If I were doing it, "used" would mean: a font-face declaration; the font-family being used in a class selector; and that class being applied to elements in the (x)html that contain text. But in the end ... it's your plugin.
The point is, it is not a technical definition. Let me try to explain in more detail what my problem is. The purpose to remove as many glyphs as possible to get the smallest font files. Lets give an example. Lets say I implement Charis Sil as base font. That would mean that I would need 4 fonts to implement this correctly: regular, bold, italic and bolditalic. I cannot just do with one, because otherwise there would be no italic and such. All those 4 fonts have the same font-family of course.
Now, if I use certain glyphs in italic but not in bold, they could be removed from bold.
The way to discriminate between these fonts, are the attributes font-weight and font-style. I have to tell in the stylesheet which is which. If I don't add those, the reading application should fall back to the default value which is normal for both. If I would not use it, the wrong font would be used.
The same applies for all the other default values for all classes/tags. Headers are bold by default for example.

If I would ignore the font-weight and font-style, I would not know which glyphs could be deleted from the fonts in the same family. I could combine of course all used characters for that font-family, but then the font is not optimized fully. There is of course a difference between a font and a font-family.

I am actually quite surprised that ADE shows the font when the usage is actually not correct. Does it also render on ADE 1.7?

Perhaps I will add a feature that only discriminates on font-family used instead of actually used fonts as it is now.
Toxaris is offline   Reply With Quote