Bug 695937

Summary: font-size isn’t inherited, but inherited and applied again (ePub CSS)
Product: MuPDF Reporter: Pablo Rodríguez <ghostscript>
Component: mupdfAssignee: MuPDF bugs <mupdf-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: tor.andersson
Priority: P4    
Version: master   
Hardware: Other   
OS: All   
Customer: Word Size: ---
Bug Depends on:    
Bug Blocks: 695935    
Attachments: wrong display of CSS font-size
ePub document with title in different font sizes
screenshot showing title with code and emphasis
ePub document with relative font size

Description Pablo Rodríguez 2015-04-18 04:54:53 UTC
Created attachment 11599 [details]
wrong display of CSS font-size

The ePub file attached to bug 695935 contains the following CSS code:

    p {
        font-size: 100%;
        }
    
    h1 {
        font-size: 150%;
        }

In the attached image, ebook-viewer from calibre-2.25 displays font-sizes right and mupdf-1.7 doesn’t.
Comment 1 Pablo Rodríguez 2015-04-18 05:08:50 UTC
Sorry, I forgot to mention.

The attached screenshot includes mupdf display on the left and ebook-viewer display on the right.
Comment 2 Pablo Rodríguez 2015-04-28 09:47:50 UTC
Created attachment 11629 [details]
ePub document with title in different font sizes

It seems to be fixed in master, although I found another similar issue.

The title from the attached ePub file contains both italics and monospaced font with are clearly bigger than the rest of the title.
Comment 3 Pablo Rodríguez 2015-04-28 09:48:55 UTC
Created attachment 11630 [details]
screenshot showing title with code and emphasis

The attached image shows the display in mupdf (left) and in calibre (right).
Comment 4 Pablo Rodríguez 2015-05-09 02:53:38 UTC
Although the release notes from mupdf-1.7a include:

    * Fixed EPUB font scaling bug.

I’m afraid that the font switch (to monospace font or italics) in the title results in displaying higher sizes than they should be (as shown at http://bugs.ghostscript.com/attachment.cgi?id=11630).

Many thanks for your help,

Pablo
Comment 5 Pablo Rodríguez 2015-05-11 13:34:01 UTC
Created attachment 11668 [details]
ePub document with relative font size
Comment 6 Pablo Rodríguez 2015-05-11 13:38:19 UTC
Tor,

the new ePub document contains only the following CSS code:

    body {
        font-size: 1.05em;
        }

Instead of inheritance, elements seem to have the font-size setup again for them.

This is why font size is increased by no reason. Even unordered list has a slightly bigger font than the standard paragraph.

Could you fix this?

Many thanks for your help,


Pablo
Comment 7 Pablo Rodríguez 2015-05-16 10:05:01 UTC
Issue has been fixed with commit afa0a2b.
Comment 8 Tor Andersson 2015-05-26 06:42:54 UTC
Yeah, it took a while to iron out all the corner cases of the font-size inheritance. It should work properly now.