sumatrapdfreader / sumatrapdf

SumatraPDF reader
http://www.sumatrapdfreader.org
GNU General Public License v3.0
13.81k stars 1.74k forks source link

Problems in epubs rendering? #3730

Open mauriva opened 1 year ago

mauriva commented 1 year ago

Hi! I'm with SumatraPDF pre-release 3.5.15670 64 bit. It often happens to me that when opening an epub file, the rendering of the page is not as I expect: I feel that some text alignments and paragraph separation are not correct. I show images of the same epub file opened with 3 different readers: SumatraPDF, Freda and Calibre. Note that all programmes have default settings. Is there a problem in SumatraPDF? SumatraPDF immagine

Freda immagine

Calibre immagine

GitHubRulesOK commented 1 year ago

It usually depends where a copy comes from so here is Amazon portrait of Italian Layout image

I can only find an English copy but layout is similar SumatraPDF on left and Edge on right.

image

mauriva commented 1 year ago

I don't understand the answer. In my post I show how the same epub file is displayed differently by SumatraPDF compared to two other ebook readers. What is the reason for this difference? It seems that Sumatra cannot correctly interpret the 'style' (css?) of the epub...

GitHubRulesOK commented 1 year ago

no two readers will layout an ePub as fixed like PDF but SumatraPDF depends on MuPDF which is not Microsoft. image

mauriva commented 1 year ago

So does this mean that the problem depends on MuPDF? On the 'physical' reader (a Kobo) the file is displayed as in Calibre and Freda... immagine

GitHubRulesOK commented 1 year ago

Without any reference then see my comparison the normal font in nearly all cases is Serif but Microsoft Edge uses their own Calibre which is Sans Serif. Which is write and which is not right here is the style, so why are other readers not using Microsofts licensed Sans Serif font (it is not in that file)

.calibre {
    display: block;
    font-size: 1em;
    line-height: 1.2;
    padding-left: 0;
    padding-right: 0;
    text-align: justify;
    margin: 0 5pt
    }

ebooks were effectively fontless since the font is provided by the system hardware, no two hardware readers were guaranteed to use same tab stops indents or font styles.

mauriva commented 1 year ago

Thank you for your reply. These are very technical matters that I almost completely ignore. And, despite what you wrote, I still don't understand why the same file is opened correctly by two different software (and even the 'physical' ereader) while Sumatra can't...

GitHubRulesOK commented 1 year ago

@mauriva depends how you define "correctly" is the text stored as 11001010010010 readable as readable human text = yes then the devices machine codes were translated correctly into readable pixels. was a font provided / needed for the device = no did it substitute any font correctly for display = yes

what is a big problem is foreign languages where a font is not correctly accented or described as Chinese or Russian

It is not Just ePubs here is same issue in PDF 2 different browsers using Adobe Acrobat (note they use different Sans Serif defaults) and SumatraPDF using MuPDF default Serif font. ALL are correct.

image

mauriva commented 1 year ago

What you wrote is very clear and I understood what you were referring to in previous posts concerning fonts. However, let me make it clear that when I write "correctly" I am referring to something else and it seemed quite obvious from the very first post. As you can see from the images, Sumatra (due to MuPDF's "fault"?) does not centre-align the chapter title and insert a spacing between each paragraph, which other software does not do. Are you telling me that these problems depend on the font used in the epub? It still remains at least strange (if not incomprehensible) behaviour, given that all the software whose screenshots I included are on the same PC and opened the same file... In any case, I give up.

GitHubRulesOK commented 1 year ago

It is not just MuPDF it is the source file 1st makes a difference, when not designed as fit for wider usage. The PDF example I used last is "fontless" and in a PDF unlike DocX, there are no indents, no tabs, all text is ragged right unless defined otherwise and any font may be used unless defined "correctly"

The point I am trying to convey is the file itself is at fault OR MuPDF is either not passed information to use correctly or needs a sample to correct for.