From afa0a2b4b0508fb6b095c30a6e27afd0c5c21c64 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 15 May 2015 16:11:21 +0200 Subject: epub: Don't inherit font-size textually, despite what the spec says. Ignore inheritance on font-size properties altogether. Since we already inherit the font-size during the 'em' calculations when laying out text, inheriting the font-size property textually will result in doubling the effect of any scaling. --- source/html/css-apply.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/html') diff --git a/source/html/css-apply.c b/source/html/css-apply.c index 6d99c07d..a4fe01d7 100644 --- a/source/html/css-apply.c +++ b/source/html/css-apply.c @@ -4,7 +4,6 @@ static const char *inherit_list[] = { "color", "direction", "font-family", - "font-size", "font-style", "font-variant", "font-weight", @@ -665,7 +664,8 @@ value_from_property(fz_css_match *match, const char *name) if (match->up) { if (value && !strcmp(value->data, "inherit")) - return value_from_property(match->up, name); + if (strcmp(name, "font-size") != 0) /* never inherit 'font-size' textually */ + return value_from_property(match->up, name); if (!value && keyword_in_list(name, inherit_list, nelem(inherit_list))) return value_from_property(match->up, name); } -- cgit v1.2.3