baskerville / plato

Document reader
Other
1.23k stars 102 forks source link

Bad Rendering of MOBI Books #321

Closed baskerville closed 9 months ago

baskerville commented 10 months ago

I would seem that the output we get when rendering MOBI books within Plato differs from the output we get with mutool draw…. The most noticeable problem is that the font sizes are reversed in the Plato output.

baskerville commented 10 months ago

I've made some progress : I'm getting a correct output when I comment out this line.

NiLuJe commented 10 months ago

MuPDF (well, mutool) may be hardcoding something like 72 or 96 dpi, maybe?

baskerville commented 10 months ago

mutool uses the default layout values (FZ_DEFAULT_LAYOUT_{W,H,EM}), so the fz_layout_document call (implemented as fz_layout_html for MOBI documents) returns without doing anything. But mutool has layout parameters, so I might be able to reproduce the bug using only mutool.

baskerville commented 9 months ago

Upstream bug report.

baskerville commented 9 months ago

My guess is that the problem comes from the fact that MuPDF interprets the size attribute of the archaic font tag in points, instead of using ems.

baskerville commented 9 months ago

Fixed upstream.