Font subsetting problem with CSS pseudo classes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
calibre |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Raising this bug report as per your agreement in this thread https:/
The current container utility, subset_all_fonts, doesn't seem to take any account of text styled by a CSS font-family rule with a pseudo class selector. The result is that too many chars are removed during subsetting and sometimes even the whole font.
I've attached a 1-page test epub which uses ::first-letter and ::first-line to demo the problem.
As mentioned in the above MR link I know that text styled by ::first-line is variable depending on screen width but a compromise might be to retain all characters used by the main part of the selector,
e.g. .sb::first-line {font-family: MyFont} should retain all chars in MyFont used by class="sb"
Or if that's too finicky maybe allow subset_all_fonts to take a parameter of a list of fonts to *exclude* from subsetting.
My particular use case is for a utility I can call in a personal plugin rather than in Polish/Editor. Anything you can do to improve things will be much appreciated.
Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.
status fixreleased