diff --git a/resources/compiled_coffeescript.zip b/resources/compiled_coffeescript.zip index 10e6f498b3..18908ea0bb 100644 Binary files a/resources/compiled_coffeescript.zip and b/resources/compiled_coffeescript.zip differ diff --git a/src/calibre/ebooks/oeb/polish/font_stats.coffee b/src/calibre/ebooks/oeb/polish/font_stats.coffee index b7306b7a11..e96d3184ed 100644 --- a/src/calibre/ebooks/oeb/polish/font_stats.coffee +++ b/src/calibre/ebooks/oeb/polish/font_stats.coffee @@ -27,6 +27,7 @@ font_dict = (style, computed=false) -> 'font-style':style.getPropertyValue('font-style'), 'font-stretch':style.getPropertyValue('font-stretch'), 'text-transform':style.getPropertyValue('text-transform'), + 'font-variant':style.getPropertyValue('font-variant'), } font_usage = (node) -> diff --git a/src/calibre/ebooks/oeb/polish/stats.py b/src/calibre/ebooks/oeb/polish/stats.py index 023f1b2b44..afa60b3dbd 100644 --- a/src/calibre/ebooks/oeb/polish/stats.py +++ b/src/calibre/ebooks/oeb/polish/stats.py @@ -338,7 +338,7 @@ class StatsCollector(object): for font in font_usage: text = set() for t in font['text']: - tt = font['text-transform'] + tt = (font['text-transform'] or '').lower() if tt != 'none': if tt == 'uppercase': t = icu_upper(t) @@ -348,6 +348,9 @@ class StatsCollector(object): m = self.capitalize_pat.search(t) if m is not None: t += icu_upper(m.group()) + fv = (font['font-variant'] or '').lower() + if fv in {'smallcaps', 'small-caps', 'all-small-caps', 'petite-caps', 'all-petite-caps', 'unicase'}: + t += icu_upper(t) # for renderers that try to fake small-caps by using small normal caps text |= frozenset(t) text.difference_update(exclude) if not text: