Hyphenation support in QTWebEngine
-
Hi,
I'm using a software, calibre, to manage and read my collection of e-books. calibre's e-book viewer makes use of QTWebEngine under the hood to show EPUBs, which are simply a collection of XHTML and CSS files bundled together.
Sometimes I edit my EPUB files to fix typos and improve their appearance by tweaking their CSS. While doing this, I realised that I couldn't make hyphenation work in any way I tried. In particular I expected a code like this:
<head> <title>Title</title> <link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css"/> </head> <body lang="en"> <p class="main">Some text that shows hyphenation here.</p> </body> </html>
and
.main { hyphens: auto; }
to display hyphenation. However, no hyphenation appeared in calibre's viewer, which uses Qt 6.4. After doing some research, I managed to replicate the same behavior in qutebrowser 3.1.0, which uses QTWebEngine too (but from Qt 6.6.1).
Chromium supports automatic hyphenation since version 88 and supports many languages, so a fair guess is that hyphenation rules/dictionaries are not included in QTWebEngine.
I looked through the bug tracker and the forums but I found nothing to help me. Is there any info about how to get hyphenation to work inside QTWebEngine? And if the reason for the failure is that hyphenation rules are missing, why is that so and what could be done to include them in?