On Mon, Sep 25, 2017 at 08:50:11PM +0200, Stephan Witt wrote:
> Am 25.09.2017 um 17:05 schrieb Enrico Forestieri <for...@lyx.org>:
> > 
> > So, it seems that a QApplication is necessary when the svg image contains
> > text. All of our icons should be text free, but some pathological cases
> > may occur, as demonstrated.
> 
> You’re right.
> 
> Meanwhile I found the relevant bug https://bugreports.qt.io/browse/QTBUG-31990
> 
> We may cleanup our icons. Unfortunately we cannot guarantee the fallback
> converter is not used by some arbitrary SVG image and crashes.

There are a few icons with empty text, but there are also all the ipa icons
that contain text. These texts should be changed to paths, otherwise they
will be rendered wrongly if the requested font is not present. This is easy
to do with inkscape.

> I tried to pass -platform offscreen to QApplication args. This works too.
> But I’m not sure how this would work on platforms not being Linux.
> On Mac I have to fool the QFontDatabase class by creating an empty directory
> Contents/lib/fonts in the application bundle. On X11-Linux it should work.
> But Cygwin and Windows… I have no idea how it goes.
> 
> Please, try the updated patch attached if possible. Thanks.

It works on Cygwin. But I don't know whether the offscreen plugins is to
be expected on native Windows because it relies on the freetype library.
Maybe the available plugins can be checked before instantiating a
QApplication and, if the offscreen one is not there, the -platform option
can be removed form argv. I don't seem to observe the same adverse effect
you see on Mac and the behavior on Windows seems to be the same whether
using a QApplication or a QCoreApplication.

-- 
Enrico

Reply via email to