Package: qtbase5-dev
Version: 5.15.10+dfsg-7.2+b1
Severity: normal
X-Debbugs-Cc: t...@mirbsd.de
Control: found -1 5.15.2+dfsg-9
Control: found -1 5.7.1+dfsg-3+deb9u4
Control: affects -1 musescore
Control: affects -1 musescore3

I’ve received reports that PDFs generated by Mu͒seScore when
viewed in Atril (but not in Okular or mupdf!) have the top
of the treble clef cut off. I found that the same happens
for glyphs of the font I use for URLs and copyright notices
(attached), but only from Mu͒seScore, not from LibreOffice.

I first reported this to Atril both because I couldn’t find
anything wrong with the font metrics (or after fixing what
could have been, I tried multiple variants) upstream at
https://github.com/mate-desktop/atril/issues/610 where a
helpful soul found that there’s some clip path in the PDFs
which Atril honours that clips off the rendering but that
under that the glyphs are fully present.

Then I dug into the Mu͒seScore Studio source code, but could
not find anything suspicious, so I extracted an MWE from its
source code (under GPLv2 though I doubt the example below is
actually nōntrivial enough to be copyrightable) to generate
a PDF and, voilà, the top of the text is cut off in Atril but
not in mupdf.

I’m attaching the MWE (qex.pro + qex.cc) and the font file
(SIL OFL, currently the .otf is the source) so you can
reproduce this. It reproduces for me on stretch, bullseye and
sid, probably universally. (Make sure $DISPLAY is set. Put the
.otf into ~/.local/share/fonts/ to test.)

$ QT_SELECT=5 qmake qex.pro && make && ./qex
$ mupdf moo.pdf
$ atril moo.pdf

Please forward this bug upstream as suitable. Thanks in advance!
(I don’t have the means to test with upstream’s versions.)

-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unreleased'), (500, 
'buildd-unstable'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, x32

Kernel: Linux 5.10.0-26-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/lksh
Init: sysvinit (via /sbin/init)

Versions of packages qtbase5-dev depends on:
ii  libegl-dev                     1.7.0-1+b1
ii  libgl-dev                      1.7.0-1+b1
ii  libglu1-mesa-dev [libglu-dev]  9.0.2-1.1+b1
ii  libqt5concurrent5t64           5.15.10+dfsg-7.2+b1
ii  libqt5core5t64                 5.15.10+dfsg-7.2+b1
ii  libqt5dbus5t64                 5.15.10+dfsg-7.2+b1
ii  libqt5gui5t64                  5.15.10+dfsg-7.2+b1
ii  libqt5network5t64              5.15.10+dfsg-7.2+b1
ii  libqt5printsupport5t64         5.15.10+dfsg-7.2+b1
ii  libqt5sql5t64                  5.15.10+dfsg-7.2+b1
ii  libqt5test5t64                 5.15.10+dfsg-7.2+b1
ii  libqt5widgets5t64              5.15.10+dfsg-7.2+b1
ii  libqt5xml5t64                  5.15.10+dfsg-7.2+b1
ii  libvulkan-dev                  1.3.280.0-1
ii  libxext-dev                    2:1.3.4-1+b1
ii  qt5-qmake                      5.15.10+dfsg-7.2+b1
ii  qtbase5-dev-tools              5.15.10+dfsg-7.2+b1
ii  qtchooser                      66-2

Versions of packages qtbase5-dev recommends:
pn  libqt5opengl5-dev  <none>

Versions of packages qtbase5-dev suggests:
pn  default-libmysqlclient-dev  <none>
pn  firebird-dev                <none>
pn  libpq-dev                   <none>
pn  libsqlite3-dev              <none>
pn  unixodbc-dev                <none>

-- no debconf information
#include <err.h>

#include <QFont>
#include <QGuiApplication>
#include <QMarginsF>
#include <QPainter>
#include <QPdfWriter>
#include <QPageSize>

#define ensure(what) if (!(what)) errx(1, "%s", #what)

int main(int argc, char *argv[]) {
        QGuiApplication MyApp(argc, argv);
        QPdfWriter printerDev("moo.pdf");
        QPainter p;
        ensure(p.begin(&printerDev));
        p.setRenderHint(QPainter::Antialiasing, true);
        p.setRenderHint(QPainter::TextAntialiasing, true);

        QPointF ofs(100, 1000);
        QFont font("Inconsolatazi4varl_qu", 72);
        p.setFont(font);
        p.drawText(ofs, "foi Test 0'l");

        p.end();
        errx(0, "done");
}
CONFIG += debug
SOURCES += qex.cc
TARGET = qex

Attachment: Inconsolatazi4varl_qu-Regular.otf
Description: application/vnd.ms-opentype

Reply via email to